Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4c1d12f

Browse files
feat(data/complex/basic): Adding im_eq_sub_conj (#5750)
Adds `im_eq_sub_conj`, which I couldn't find in the library. Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
1 parent 94f45c7 commit 4c1d12f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/data/complex/basic.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,15 @@ instance char_zero_complex : char_zero ℂ :=
363363
char_zero_of_inj_zero $ λ n h,
364364
by rwa [← of_real_nat_cast, of_real_eq_zero, nat.cast_eq_zero] at h
365365

366+
/-- A complex number `z` plus its conjugate `conj z` is `2` times its real part. -/
366367
theorem re_eq_add_conj (z : ℂ) : (z.re : ℂ) = (z + conj z) / 2 :=
367-
by rw [add_conj]; simp; rw [mul_div_cancel_left (z.re:ℂ) two_ne_zero']
368+
by simp only [add_conj, of_real_mul, of_real_one, of_real_bit0,
369+
mul_div_cancel_left (z.re:ℂ) two_ne_zero']
370+
371+
/-- A complex number `z` minus its conjugate `conj z` is `2i` times its imaginary part. -/
372+
theorem im_eq_sub_conj (z : ℂ) : (z.im : ℂ) = (z - conj(z))/(2 * I) :=
373+
by simp only [sub_conj, of_real_mul, of_real_one, of_real_bit0, mul_right_comm,
374+
mul_div_cancel_left _ (mul_ne_zero two_ne_zero' I_ne_zero : 2 * I ≠ 0)]
368375

369376
/-! ### Absolute value -/
370377

0 commit comments

Comments
 (0)