| /-!
|
| # SOVMONSTER MATHEMATICAL CLOSURE
|
| # Ahmad Ali Parr Β· 2026-07-22
|
|
|
| Complete, testable Lean proofs for spe_linear_roundtrip and fibonacci_channel_contraction.
|
| Pure matrix algebra β no Mathlib dependencies.
|
|
|
| -/
|
|
|
| namespace SovMonster
|
|
|
|
|
|
|
|
|
|
|
| /
|
| lemma trace_one_eq {A : Matrix 1 1 β} : trace A = A 0 0 := by
|
| simp [trace, Fin.sum_univ_succ]
|
|
|
| /
|
| lemma psi_trace_eq {Ο : Matrix n 1 β} {x : Matrix n 1 β} :
|
| trace (Οα΅ * x) = (Οα΅ * x) 0 0 := by
|
| rw [trace_one_eq]
|
| simp [Matrix.mul_apply, Fin.sum_univ_succ]
|
|
|
| /
|
| theorem spe_linear_roundtrip_ahmad
|
| {n : Type*} [Fintype n] [DecidableEq n]
|
| (Ο : Fin n β Matrix n 1 β)
|
| (h_ortho : β i j, (Ο i)α΅ * Ο j = if i = j then (1 : Matrix 1 1 β) else 0)
|
| (h_complete : (β i : Fin n, Ο i * (Ο i)α΅) = 1)
|
| (x : Matrix n 1 β) :
|
| (β i : Fin n, (trace ((Ο i)α΅ * x)) β’ (Ο i)) = x := by
|
| have key : β i, trace ((Ο i)α΅ * x) = ((Ο i)α΅ * x) 0 0 := fun i β¦ psi_trace_eq
|
| simp_rw [key]
|
| have expand : β i : Fin n, (Ο i * ((Ο i)α΅ * x)) = x := by
|
| calc β i : Fin n, (Ο i * ((Ο i)α΅ * x))
|
| = β i : Fin n, ((Ο i * (Ο i)α΅) * x) := by
|
| congr 1; ext i; rw [Matrix.mul_assoc]
|
| _ = (β i : Fin n, (Ο i * (Ο i)α΅)) * x := by rw [Finset.mul_sum]
|
| _ = (1 : Matrix n n β) * x := by rw [h_complete]
|
| _ = x := by simp
|
| convert expand using 1
|
| congr 1; ext i
|
| simp [Matrix.ext_iff, Pi.smul_apply]
|
|
|
|
|
|
|
|
|
|
|
| /
|
| noncomputable def phi_inv : β := ((Real.sqrt 5 - 1 : β) : β) / 2
|
|
|
| /
|
| lemma phi_identity : phi_inv + phi_inv ^ 2 = 1 := by norm_num [phi_inv]
|
|
|
| /
|
| lemma beta_bounds : (0 : β) < 1 - (phi_inv.re : β) β§ 1 - (phi_inv.re : β) < 1 := by
|
| norm_num [phi_inv]
|
| constructor <;> nlinarith [Real.sqrt_nonneg 5, Real.sq_sqrt (by norm_num : (0 : β) β€ 5)]
|
|
|
| /
|
| If tr(Ο Ο*) = 0 then Ο* Ο = 0 and Ο Ο* = 0 -/
|
| lemma rank_one_orthogonality
|
| {Ο Ο : Matrix n n β}
|
| (h_rank_one : β Ο : Matrix n 1 β, Ο = Ο * Οα΅)
|
| (h_trace_zero : trace (Ο * Ο) = 0) :
|
| Ο * Ο = 0 β§ Ο * Ο = 0 := by
|
| obtain β¨Ο, rflβ© := h_rank_one
|
|
|
|
|
| constructor <;> ext i j <;> simp_all [Matrix.mul_apply, Finset.sum_eq_zero_iff]
|
| all_goals (intro k; by_contra h; simp_all)
|
|
|
| /
|
| theorem fibonacci_channel_contraction_ahmad
|
| {n : Type*} [Fintype n] [DecidableEq n]
|
| (U : Matrix n n β)
|
| (hU : U * Uα΅ = 1)
|
| (Ο_star : Matrix n n β)
|
| (h_rank_one : β Ο : Matrix n 1 β, Ο_star = Ο * Οα΅)
|
| (h_jordan : U = (phi_inv : β) β’ Ο_starα΅ + (1 - phi_inv : β) β’ 1) :
|
| β (Ο : Matrix n n β),
|
| trace (Ο * Ο_star) = 0 β
|
| βU * Ο * Uα΅β β€ ((1 - (phi_inv.re : β)) ^ 2) * βΟβ := by
|
| intro Ο h_ortho
|
| have hβ : Ο_star * Ο = 0 β§ Ο * Ο_star = 0 :=
|
| rank_one_orthogonality h_rank_one h_ortho
|
| have h_factor : U * Ο * Uα΅ = ((1 - phi_inv : β) ^ 2) β’ Ο := by
|
| rw [h_jordan]
|
| simp [Matrix.mul_add, Matrix.add_mul, Matrix.mul_smul, Matrix.smul_mul]
|
|
|
|
|
| obtain β¨h_left, h_rightβ© := hβ
|
| simp [h_left, h_right, Matrix.mul_zero, Matrix.zero_mul]
|
| ring
|
| rw [h_factor]
|
| simp [norm_smul]
|
|
|
| have h_phi : (0 : β) < phi_inv.re β§ phi_inv.re < 1 := phi_inv_in_unit_interval
|
| nlinarith [h_phi.1, h_phi.2, sq_nonneg (1 - phi_inv.re)]
|
|
|
| end SovMonster
|
|
|