MAT3253 Complex Variables

1.8. Norm square function🔗

@[pp_nodot] def normSq : ℚ[i] →*₀ where toFun z := z.re * z.re + z.im * z.im map_zero' := complexQ.re 0 * complexQ.re 0 + complexQ.im 0 * complexQ.im 0 = 0 0 * 0 + 0 * 0 = 0; All goals completed! 🐙 map_one' := complexQ.re 1 * complexQ.re 1 + complexQ.im 1 * complexQ.im 1 = 1 All goals completed! 🐙 map_mul' z w := z:ℚ[i]w:ℚ[i](z * w).re * (z * w).re + (z * w).im * (z * w).im = (z.re * z.re + z.im * z.im) * (w.re * w.re + w.im * w.im) z:ℚ[i]w:ℚ[i](z.re * w.re - z.im * w.im) * (z.re * w.re - z.im * w.im) + (z.re * w.im + z.im * w.re) * (z.re * w.im + z.im * w.re) = (z.re * z.re + z.im * z.im) * (w.re * w.re + w.im * w.im); All goals completed! 🐙 theorem normSq_apply (z : ℚ[i]) : normSq z = z.re * z.re + z.im * z.im := rfl @[simp] theorem normSq_ofRational (r : ) : normSq r = r * r := r:normSq r = r * r All goals completed! 🐙 @[simp] theorem normSq_natCast (n : ) : normSq n = n * n := normSq_ofRational _ @[simp] theorem normSq_intCast (z : ) : normSq z = z * z := normSq_ofRational _ @[simp] theorem normSq_ofNat (n : ) [n.AtLeastTwo] : normSq (no_index (OfNat.ofNat n : ℚ[i])) = OfNat.ofNat n * OfNat.ofNat n := normSq_natCast _ @[simp] theorem normSq_mk (x y : ) : normSq x,y = x*x + y*y := rfl theorem normSq_add_mul_I (x y : ) : normSq (x + y * I) = x ^ 2 + y ^ 2 := x:y:normSq (x + y * I) = x ^ 2 + y ^ 2 All goals completed! 🐙 theorem normSq_eq_conj_mul_self {z : } : (normSq z : ℚ[i]) = conj z * z := z:(normSq z) = ((starRingEnd ) z) * z z:(↑(normSq z)).re = (((starRingEnd ) z) * z).rez:(↑(normSq z)).im = (((starRingEnd ) z) * z).im repeat z:0 = (starRingEnd ) z * 0 + 0 * z ; All goals completed! 🐙 theorem normSq_zero : normSq 0 = 0 := normSq.map_zero theorem normSq_one : normSq 1 = 1 := normSq.map_one theorem normSq_nonneg (z : ℚ[i]) : 0 normSq z := add_nonneg (mul_self_nonneg _) (mul_self_nonneg _) theorem normSq_eq_zero {z : ℚ[i]} : normSq z = 0 z = 0 := fun h => ext (eq_zero_of_mul_self_add_mul_self_eq_zero h) (eq_zero_of_mul_self_add_mul_self_eq_zero <| (add_comm _ _).trans h), fun h => h.symm normSq_zero @[simp] theorem normSq_pos {z : ℚ[i]} : 0 < normSq z z 0 := (normSq_nonneg z).lt_iff_ne.trans <| not_congr (eq_comm.trans normSq_eq_zero) @[simp] theorem normSq_neg (z : ℚ[i]) : normSq (-z) = normSq z := z:ℚ[i]normSq (-z) = normSq z All goals completed! 🐙 @[simp] theorem normSq_conj (z : ℚ[i]) : normSq (conj z) = normSq z := z:ℚ[i]normSq ((starRingEnd ℚ[i]) z) = normSq z All goals completed! 🐙 theorem normSq_mul (z w : ℚ[i]) : normSq (z * w) = normSq z * normSq w := normSq.map_mul z w theorem normSq_add (z w : ℚ[i]) : normSq (z + w) = normSq z + normSq w + 2 * (z * conj w).re := z:ℚ[i]w:ℚ[i]normSq (z + w) = normSq z + normSq w + 2 * (z * (starRingEnd ℚ[i]) w).re z:ℚ[i]w:ℚ[i](z.re + w.re) * (z.re + w.re) + (z.im + w.im) * (z.im + w.im) = z.re * z.re + z.im * z.im + (w.re * w.re + w.im * w.im) + 2 * (z.re * w.re - z.im * -w.im); All goals completed! 🐙 theorem re_sq_le_normSq (z : ℚ[i]) : z.re * z.re normSq z := le_add_of_nonneg_right (mul_self_nonneg _) theorem im_sq_le_normSq (z : ℚ[i]) : z.im * z.im normSq z := le_add_of_nonneg_left (mul_self_nonneg _) theorem mul_conj (z : ℚ[i]) : z * conj z = normSq z := z:ℚ[i]z * (starRingEnd ℚ[i]) z = (normSq z) z:ℚ[i](z * (starRingEnd ℚ[i]) z).re = (↑(normSq z)).re (z * (starRingEnd ℚ[i]) z).im = (↑(normSq z)).im z:ℚ[i]z.re * z.re - z.im * -z.im = normSq z z.re * -z.im + z.im * z.re = 0 ; z:ℚ[i]-(z.re * z.im) + z.im * z.re = 0 All goals completed! 🐙 theorem add_conj (z : ℚ[i]) : z + conj z = (2 * z.re : ) := z:ℚ[i]z + (starRingEnd ℚ[i]) z = (2 * z.re) z:ℚ[i](z + (starRingEnd ℚ[i]) z).re = (↑(2 * z.re)).re (z + (starRingEnd ℚ[i]) z).im = (↑(2 * z.re)).im z:ℚ[i]z.re + z.re = 2 * z.re z.im + -z.im = 0 ; z:ℚ[i]z.re + z.re = 2 * z.re All goals completed! 🐙 @[simp, norm_cast] theorem ofRational_one : ((1 : ) : ℚ[i]) = 1 := rfl -- The coercion `ℚ → ℚ[i]` is a ring homomorphism -- The symbol `→+*` signifies that -- the mapping is a ring homomorphism def ofRational' : →+* ℚ[i] where toFun x := (x : ℚ[i]) map_one' := ofRational_one map_zero' := ofRational_zero map_mul' := ofRational_mul map_add' := ofRational_add @[simp] theorem ofRational_eq_coe (r : ) : ofRational r = r := rfl @[simp] theorem I_sq : I ^ 2 = -1 := I ^ 2 = -1 All goals completed! 🐙 @[simp] theorem I_pow_four : I ^ 4 = 1 := I ^ 4 = 1 All goals completed! 🐙 -- The next two theorem are not true by definition, -- and require some proof. @[simp] theorem sub_re (z w : ℚ[i]) : (z - w).re = z.re - w.re := z:ℚ[i]w:ℚ[i](z - w).re = z.re - w.re z:ℚ[i]w:ℚ[i]z.re + -w.re = z.re - w.re All goals completed! 🐙 @[simp] theorem sub_im (z w : ℚ[i]) : (z - w).im = z.im - w.im := z:ℚ[i]w:ℚ[i](z - w).im = z.im - w.im z:ℚ[i]w:ℚ[i]z.im + -w.im = z.im - w.im All goals completed! 🐙 @[simp, norm_cast] theorem ofRational_sub (r s : ) : ((r - s : ) : ℚ[i]) = r - s := r:s:(r - s) = r - s r:s:(↑(r - s)).re = (r - s).re (↑(r - s)).im = (r - s).im r:s:r - s = (r - s).re 0 = (r - s).im ; All goals completed! 🐙 @[simp, norm_cast] theorem ofRational_pow (r : ) (n : ) : ((r^n : ) : ℚ[i]) = (r : ℚ[i])^n := r:n:(r ^ n) = r ^ n r:(r ^ 0) = r ^ 0r:n:hn:(r ^ n) = r ^ n(r ^ (n + 1)) = r ^ (n + 1) r:(r ^ 0) = r ^ 0 r:1 = 1 All goals completed! 🐙 r:n:hn:(r ^ n) = r ^ n(r ^ (n + 1)) = r ^ (n + 1) -- inductive step r:n:hn:(r ^ n) = r ^ nr ^ n * r = r ^ (n + 1) All goals completed! 🐙 theorem sub_conj (z : ℚ[i]) : z - conj z = (2 * z.im : ) * I := z:ℚ[i]z - (starRingEnd ℚ[i]) z = (2 * z.im) * I z:ℚ[i](z - (starRingEnd ℚ[i]) z).re = ((2 * z.im) * I).re (z - (starRingEnd ℚ[i]) z).im = ((2 * z.im) * I).im z:ℚ[i](z - (starRingEnd ℚ[i]) z).re = 2 * z.im * 0 - 0 * 1 (z - (starRingEnd ℚ[i]) z).im = 2 * z.im * 1 + 0 * 0 ; z:ℚ[i]z.im + z.im = 2 * z.im All goals completed! 🐙 theorem normSq_sub (z w : ℚ[i]) : normSq (z - w) = normSq z + normSq w - 2 * (z * conj w).re := z:ℚ[i]w:ℚ[i]normSq (z - w) = normSq z + normSq w - 2 * (z * (starRingEnd ℚ[i]) w).re z:ℚ[i]w:ℚ[i]normSq (z + -w) = normSq z + normSq w - 2 * (z * (starRingEnd ℚ[i]) w).re z:ℚ[i]w:ℚ[i]normSq z + normSq (-w) + 2 * (z * (starRingEnd ℚ[i]) (-w)).re = normSq z + normSq w - 2 * (z * (starRingEnd ℚ[i]) w).re z:ℚ[i]w:ℚ[i]normSq z + normSq w + 2 * (-(z.im * w.im) + -(z.re * w.re)) = normSq z + normSq w - 2 * (z.re * w.re + z.im * w.im) All goals completed! 🐙