Discovery.LinearDisentanglement.Quantitative
Paper-independent finite-dimensional stability tools for approximate simultaneous congruence diagonalization: residuals, affine-minor separation, explicit operator-norm bounds, and compact exclusion radii.
Definitions 18 core · 3 supporting This module gives paper-independent definitions for the residual of a finite family of real congruence equations, quantitative affine separation of their prescribed diagonal vectors, normalization and conditioning assump ★ simultaneousCongruenceResidual_le_iff
Quantitative simultaneous-congruence stability: definitions
This module gives paper-independent definitions for the residual of a finite family of real congruence equations, quantitative affine separation of their prescribed diagonal vectors, normalization and conditioning assumptions, and the explicit constants used by the stability theorem.
The matrix norm in this API is the Euclidean (ℓ²) operator norm.
A square matrix represents a latent change of coordinates in dimension d.
The congruence defect measures how far candidate coordinates B fail to turn observed matrix A into the prescribed diagonal s, in dimension d.
The simultaneous congruence residual is the worst transformation error across a nonempty finite environment collection, comparing observed matrices with prescribed diagonal shifts under candidate coordinates B in dimension d.
Definition (Lean source)
A simultaneous residual meets a tolerance exactly when every environment does, for observed matrices, prescribed shifts, candidate coordinates, and tolerance ε over environment collection E in dimension d.
Formal statement
Proof (Lean source)
Affine minor separation certifies that environmental shift vectors span enough independent variation to solve all dimension d coordinates: within finite environment collection E, some shift-difference determinant is at least margin δ.
The shift-scale bound caps every coordinate of all environmental shifts by magnitude L, across finite environment collection E in dimension d.
Unit-diagonal normalization fixes the otherwise free row scales of matrix B in dimension d.
Definition (Lean source)
The Euclidean operator-norm condition number quantifies how strongly matrix B can amplify perturbations in dimension d. It is meaningful with a separate nonsingularity condition because the library's inverse convention assigns zero to singular matrices.
Definition (Lean source)
Bounded conditioning rules out unstable coordinate systems by requiring matrix B in dimension d to be (1) nonsingular and (2) no more ill conditioned than envelope κ.
Definition (Lean source)
The pair condition bound puts reference and candidate coordinates in the same stable class for dimension d: (1) the reference is well conditioned and (2) the candidate is well conditioned under envelope κ.
Definition (Lean source)
The pair matrix-scale bound keeps reference and candidate coordinates inside a common compact scale envelope in dimension d with radius R: (1) the reference norm obeys the radius and (2) the candidate norm obeys it.
Definition (Lean source)
The transition matrix expresses candidate coordinates relative to the reference coordinates in dimension d, so identity is exact recovery.
Exact congruence means reference coordinates B₀ recover every prescribed diagonal shift from the observed matrix family, throughout finite environment collection E in dimension d.
Approximate congruence accepts candidate coordinates B when their worst error against observed matrices and prescribed shifts is at most tolerance ε, across environment collection E in dimension d.
Definition (Lean source)
The affine solve factor converts residual error into coordinate error; it worsens with dimension d and shift scale L, and improves with affine-separation margin δ.
Definition (Lean source)
The product-control factor is the two-sided amplification budget for controlling transition products from dimension d, shift scale L, and separation margin δ.
Definition (Lean source)
The stability constant turns congruence residuals into recovery error under dimension d, shift scale L, separation margin δ, and matrix scale R.
Definition (Lean source)
The admissible residual radius is the noise regime where local stability estimates remain valid, determined by dimension d, shift scale L, separation margin δ, and matrix scale R.
Definition (Lean source)
3 supporting declarations (lemmas, instances)
-
simultaneousCongruenceResidual_nonnegtheorem — The worst-environment congruence residual cannot be negative, for observed matrices, prescribed shifts, and candidate coordinates over environment collection E in dimension d.hypothesesconclusion0 ≤ simultaneousCongruenceResidual A s BProof (Lean source)
theorem simultaneousCongruenceResidual_nonneg {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (B : SqMatrix d) : 0 ≤ simultaneousCongruenceResidual A s B := by classical let e : E := choice ‹Nonempty E› exact (norm_nonneg _).trans (Finset.le_sup' (fun e => ‖congruenceDefect (A e) (s e) B‖) (Finset.mem_univ e)) -
productControlFactor_postheorem — When the matrix dimension is positive, the shift scale is positive, and the affine separation margin is positive, the coordinate-product amplification factor is strictly positive.Proof (Lean source)
theorem productControlFactor_pos {d : ℕ} {L δ : ℝ} (hd : 0 < d) (hL : 0 < L) (hδ : 0 < δ) : 0 < productControlFactor d L δ := by unfold productControlFactor affineSolveFactor positivity -
admissibleRadius_postheorem — When the matrix dimension is positive, the shift scale is positive, the affine separation margin is positive, and the matrix scale is positive, the declared small-residual radius is strictly positive.hypothesesd :ℕL δ R :ℝhd :0 < dhL :0 < Lhδ :0 < δhR :0 < Rconclusion0 < admissibleRadius d L δ RProof (Lean source)
theorem admissibleRadius_pos {d : ℕ} {L δ R : ℝ} (hd : 0 < d) (hL : 0 < L) (hδ : 0 < δ) (hR : 0 < R) : 0 < admissibleRadius d L δ R := by have hq : 0 < productControlFactor d L δ := productControlFactor_pos hd hL hδ unfold admissibleRadius positivity
CompactExclusion 1 core · 3 supporting This module specializes the generic compact-exclusion API of Causalean.Mathlib.Topology.CompactExclusion to real square matrices. ★ exists_simultaneousCongruence_exclusionRadius
Compact exclusion for simultaneous congruence
This module specializes the generic compact-exclusion API of
Causalean.Mathlib.Topology.CompactExclusion to real square matrices. It shows that the
simultaneous-congruence residual is continuous, so on a compact candidate set whose only
zero-residual candidate is a reference matrix, the residual has a strictly positive attained
minimum outside any open neighborhood of the reference. It also restates the uniform
compact-correspondence dichotomy and residual tolerance for parameter-matrix correspondences, with
distance measured by the Euclidean operator norm.
A unique exact diagonalizer is uniformly separated from all candidates outside its local chart: for observed matrices and shifts over finite environments in dimension d, compact candidates, an open chart, and a reference candidate inside the chart yield a positive attained residual whenever far candidates exist and zero residual identifies the reference.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
continuous_simultaneousCongruenceResidualtheorem — The worst-environment congruence residual varies continuously with the candidate matrix, so compact separation arguments apply to observed matrices A and prescribed shifts s over finite environments E in dimension d.hypothesesconclusionProof (Lean source)
-- Proof route: matrix multiplication, transpose, subtraction, diagonal constants, and -- the norm are continuous in finite dimension; close under the finite nonempty `sup'`. theorem continuous_simultaneousCongruenceResidual {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) : Continuous (simultaneousCongruenceResidual A s) := by classical unfold simultaneousCongruenceResidual have h : Continuous (Finset.univ.sup' univ_nonempty (fun e B => ‖congruenceDefect (A e) (s e) B‖)) := by apply Continuous.finset_sup' univ_nonempty intro e _ apply Continuous.norm unfold congruenceDefect fun_prop rw [show (fun B => Finset.univ.sup' univ_nonempty (fun e => ‖congruenceDefect (A e) (s e) B‖)) = Finset.univ.sup' univ_nonempty (fun e B => ‖congruenceDefect (A e) (s e) B‖) by funext B exact (Finset.sup'_apply univ_nonempty (fun e B => ‖congruenceDefect (A e) (s e) B‖) B).symm] exact h -
sqMatrix_uniformCompactCorrespondence_dichotomytheorem — A compact feasible correspondence either has no far candidate or has a positive attained residual gap away from the reference, uniformly over parameter space P and matrix dimension d. For correspondence K, reference section B₀, residual r, and radius ρ, this requires compactness, continuity of the reference, residual, and radius, positive radii, nonnegative feasible residuals, and uniqueness at zero.hypothesesP :d :ℕB₀ :P → SqMatrix dr :P × SqMatrix d → ℝρ :P → ℝhK :hB₀ :Continuous B₀hr_cont :hρ_cont :hρ_pos :∀ p, 0 < ρ phr_nonneg :∀ z ∈ K, 0 ≤ r zhr_zero :∀ p Bif(p, B) ∈ Kandr (p, B) = 0thenB = B₀ pconclusionfarFeasibleSet K B₀ ρ = ∅ ∨ Nonempty (UniformPositiveExclusionRadius K B₀ ρ r)Proof (Lean source)
theorem sqMatrix_uniformCompactCorrespondence_dichotomy {P : Type*} [TopologicalSpace P] [T2Space P] {d : ℕ} (K : Set (P × SqMatrix d)) (B₀ : P → SqMatrix d) (r : P × SqMatrix d → ℝ) (ρ : P → ℝ) (hK : IsCompact K) (hB₀ : Continuous B₀) (hr_cont : Continuous r) (hρ_cont : Continuous ρ) (hρ_pos : ∀ p, 0 < ρ p) (hr_nonneg : ∀ z ∈ K, 0 ≤ r z) (hr_zero : ∀ p B, (p, B) ∈ K → r (p, B) = 0 → B = B₀ p) : farFeasibleSet K B₀ ρ = ∅ ∨ Nonempty (UniformPositiveExclusionRadius K B₀ ρ r) := by exact uniformCompactCorrespondence_dichotomy K B₀ r ρ hK hB₀ hr_cont hρ_cont hρ_pos hr_nonneg hr_zero -
exists_sqMatrix_uniformExclusionTolerancetheorem — One positive residual tolerance keeps every feasible matrix inside its parameter-specific reference neighborhood, uniformly over parameter space P and matrix dimension d. For correspondence K, reference section B₀, residual r, and radius ρ, this requires compactness, continuity of the reference, residual, and radius, positive radii, nonnegative feasible residuals, and uniqueness at zero.hypothesesP :d :ℕB₀ :P → SqMatrix dr :P × SqMatrix d → ℝρ :P → ℝhK :hB₀ :Continuous B₀hr_cont :hρ_cont :hρ_pos :∀ p, 0 < ρ phr_nonneg :∀ z ∈ K, 0 ≤ r zhr_zero :∀ p Bif(p, B) ∈ Kandr (p, B) = 0thenB = B₀ pconclusion∃ ε₀ : ℝ,0 < ε₀conclusion 1p B :(p, B) ∈ Kr (p, B) ≤ ε₀‖B - B₀ p‖ < ρ pProof (Lean source)
theorem exists_sqMatrix_uniformExclusionTolerance {P : Type*} [TopologicalSpace P] [T2Space P] {d : ℕ} (K : Set (P × SqMatrix d)) (B₀ : P → SqMatrix d) (r : P × SqMatrix d → ℝ) (ρ : P → ℝ) (hK : IsCompact K) (hB₀ : Continuous B₀) (hr_cont : Continuous r) (hρ_cont : Continuous ρ) (hρ_pos : ∀ p, 0 < ρ p) (hr_nonneg : ∀ z ∈ K, 0 ≤ r z) (hr_zero : ∀ p B, (p, B) ∈ K → r (p, B) = 0 → B = B₀ p) : ∃ ε₀ : ℝ, 0 < ε₀ ∧ ∀ p B, (p, B) ∈ K → r (p, B) ≤ ε₀ → ‖B - B₀ p‖ < ρ p := by simpa only [dist_eq_norm] using (exists_uniformExclusionTolerance_le K B₀ r ρ hK hB₀ hr_cont hρ_cont hρ_pos hr_nonneg hr_zero)
Quantitative 1 core · 6 supporting This module proves a finite-dimensional residual-to-distance estimate. ★ opNorm_sub_le_of_approximate_simultaneous_congruence
Explicit quantitative simultaneous-congruence stability
This module proves a finite-dimensional residual-to-distance estimate. Affine minor separation first controls coordinatewise products of the transition matrix. Unit-diagonal normalization and the explicit small-residual threshold select the reference branch, after which coordinate bounds convert to a Euclidean operator-norm bound.
Explicit simultaneous-congruence stability. For a matrix family, prescribed shifts, reference coordinates, and candidate coordinates, positive matrix dimension, positive shift scale, positive affine separation, and positive matrix scale, if the diagonal shifts obey their scale bound, the shift family has a separated affine minor, the reference is unit-diagonal, the candidate is unit-diagonal, the pair obeys the matrix scale bound, the reference is invertible, the reference realizes every congruence exactly, the residual tolerance is nonnegative, the tolerance is admissibly small, and the candidate realizes the congruences up to that tolerance, then the candidate is within the explicit linear modulus times the tolerance of the reference in Euclidean operator norm.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
abs_entry_le_opNormtheorem — Every matrix entry is bounded by the Euclidean operator norm, allowing a global residual bound to control entry i,j of matrix M in dimension d.Proof (Lean source)
theorem abs_entry_le_opNorm {d : ℕ} (M : SqMatrix d) (i j : Fin d) : |M i j| ≤ ‖M‖ := by classical let e : EuclideanSpace ℝ (Fin d) := toLp 2 (single j 1) have he : ‖e‖ = 1 := by simp [e] have hcoord : |((EuclideanSpace.equiv (Fin d) ℝ).symm (M *ᵥ e)) i| ≤ ‖(EuclideanSpace.equiv (Fin d) ℝ).symm (M *ᵥ e)‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le ((EuclideanSpace.equiv (Fin d) ℝ).symm (M *ᵥ e)) i calc |M i j| = |((EuclideanSpace.equiv (Fin d) ℝ).symm (M *ᵥ e)) i| := by simp [e] _ ≤ ‖(EuclideanSpace.equiv (Fin d) ℝ).symm (M *ᵥ e)‖ := hcoord _ ≤ ‖M‖ * ‖e‖ := Matrix.l2_opNorm_mulVec M e _ = ‖M‖ := by rw [he, mul_one] -
opNorm_le_dimension_mul_of_entry_boundtheorem — Uniform entrywise control implies an operator-norm bound scaled by dimension: matrix M in dimension d needs a nonnegative entry cap c that every entry obeys.hypothesesconclusion‖M‖ ≤ (d : ℝ) * cProof (Lean source)
theorem opNorm_le_dimension_mul_of_entry_bound {d : ℕ} (M : SqMatrix d) {c : ℝ} (hc : 0 ≤ c) (hM : ∀ i j, |M i j| ≤ c) : ‖M‖ ≤ (d : ℝ) * c := by rw [Matrix.cstar_norm_def] calc ‖(Matrix.toEuclideanCLM (n := Fin d) (𝕜 := ℝ)) M‖ ≤ @norm (SqMatrix d) Matrix.frobeniusNormedAddCommGroup.toNorm M := l2CLM_norm_le_frobenius M _ = sqrt (∑ i, ∑ j, |M i j| ^ 2) := by rw [Matrix.frobenius_norm_def, Real.sqrt_eq_rpow] simp only [Real.rpow_two, Real.norm_eq_abs] _ ≤ (d : ℝ) * c := by rw [Real.sqrt_le_iff] constructor · positivity · calc ∑ i, ∑ j, |M i j| ^ 2 ≤ ∑ _i : Fin d, ∑ _j : Fin d, c ^ 2 := by gcongr with i j exact hM i j _ = ((d : ℝ) * c) ^ 2 := by simp [Finset.sum_const, nsmul_eq_mul] ring -
coordinate_le_affineSolveFactortheorem — A separated, bounded linear system converts uniform residual error into the explicit Cramer's-rule coordinate bound. For coefficient matrix V and solution x in dimension d, this uses scale L, determinant margin δ, and residual cap η, with positive margin, nonnegative scale, bounded coefficients, determinant separation, and bounded residual.hypothesesd :ℕV :SqMatrix dx :Fin d → ℝL δ η :ℝhδ :0 < δhL :0 ≤ LhV :∀ i j, |V i j| ≤ 2 * Lhdet :δ ≤ |V.det|hres :∀ i, |(V *ᵥ x) i| ≤ ηj :conclusion|x j| ≤ affineSolveFactor d L δ * ηProof (Lean source)
-- Proof route: use `V⁻¹ *ᵥ (V *ᵥ x) = x`, expand `V⁻¹` through the adjugate (or use -- `Matrix.det_smul_inv_mulVec_eq_cramer`), expand each `(d-1)`-minor determinant, and -- bound its `factorial (d-1)` Leibniz terms by `(2L)^(d-1)`. theorem coordinate_le_affineSolveFactor {d : ℕ} (V : SqMatrix d) (x : Fin d → ℝ) {L δ η : ℝ} (hδ : 0 < δ) (hL : 0 ≤ L) (hV : ∀ i j, |V i j| ≤ 2 * L) (hdet : δ ≤ |V.det|) (hres : ∀ i, |(V *ᵥ x) i| ≤ η) : ∀ j, |x j| ≤ affineSolveFactor d L δ * η := by classical intro j have hdet0 : V.det ≠ 0 := by intro h rw [h, abs_zero] at hdet linarith have hunit : IsUnit V.det := isUnit_iff_ne_zero.mpr hdet0 let b := V *ᵥ x have hx : V⁻¹ *ᵥ b = x := by rw [show b = V *ᵥ x from rfl, Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul V hunit, Matrix.one_mulVec] have hcramer := congrFun (V.det_smul_inv_mulVec_eq_cramer b hunit) j have heq : V.det * x j = (V.updateCol j b).det := by simpa [hx, Matrix.cramer_apply] using hcramer have hbound : |(V.updateCol j b).det| ≤ (Nat.factorial d : ℝ) * (2 * L) ^ (d - 1) * η := abs_det_updateCol_le V b j (by positivity) hV hres have hmul : δ * |x j| ≤ (Nat.factorial d : ℝ) * (2 * L) ^ (d - 1) * η := by calc δ * |x j| ≤ |V.det| * |x j| := by gcongr _ = |(V.updateCol j b).det| := by rw [← abs_mul, heq] _ ≤ _ := hbound have hd0 : d ≠ 0 := Nat.ne_of_gt (Fin.pos_iff_nonempty.mpr ⟨j⟩) have hfac : (d : ℝ) * (Nat.factorial (d - 1) : ℝ) = (Nat.factorial d : ℝ) := by norm_cast exact Nat.mul_factorial_pred hd0 unfold affineSolveFactor rw [mul_assoc, div_mul_eq_mul_div] apply (le_div_iff₀ hδ).2 calc |x j| * δ = δ * |x j| := mul_comm _ _ _ ≤ (Nat.factorial d : ℝ) * (2 * L) ^ (d - 1) * η := hmul _ = (d : ℝ) * ((Nat.factorial (d - 1) : ℝ) * (2 * L) ^ (d - 1)) * η := by rw [← hfac] ring -
transition_diagonal_congruencetheorem — Relative coordinates transport each exact reference diagonal into the candidate congruence, linking observable and latent representations for matrix family A, shifts s, reference and candidate matrices, and environment e over environment type E in dimension d, provided the reference is invertible and exactly diagonalizes the family.hypothesesd :ℕE :Type*Fintype EA :E → SqMatrix ds :E → Fin d → ℝB₀ B :SqMatrix dhunit :IsUnit B₀.dethexact :ExactCongruence A s B₀e :Econclusion= B * A e * B.transposeProof (Lean source)
theorem transition_diagonal_congruence {d : ℕ} {E : Type*} [Fintype E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (B₀ B : SqMatrix d) (hunit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (e : E) : transition B₀ B * diagonal (s e) * (transition B₀ B).transpose = B * A e * B.transpose := by rw [← hexact e] unfold transition rw [Matrix.transpose_mul, Matrix.transpose_nonsing_inv] have hut : IsUnit B₀.transpose.det := Matrix.isUnit_det_transpose B₀ hunit calc (B * B₀⁻¹) * (B₀ * A e * B₀.transpose) * ((B₀.transpose)⁻¹ * B.transpose) = B * (B₀⁻¹ * B₀) * A e * (B₀.transpose * (B₀.transpose)⁻¹) * B.transpose := by noncomm_ring _ = B * A e * B.transpose := by rw [Matrix.nonsing_inv_mul B₀ hunit, Matrix.mul_nonsing_inv B₀.transpose hut] simp -
transition_coordinate_product_controltheorem — Approximate simultaneous diagonalization controls every squared transition entry and cross-row product, the coordinate estimates needed for stable recovery. For matrix family A, shifts s, reference B₀, and candidate B over environments E in dimension d, the constants are shift scale L, separation δ, and residual ε; assumptions require nonnegative scale, positive separation, bounded shifts, an affine minor, an invertible exact reference, and an approximately congruent candidate.hypothesesd :ℕE :A :E → SqMatrix ds :E → Fin d → ℝB₀ B :SqMatrix dL δ ε :ℝhL :0 ≤ Lhδ :0 < δhscale :ShiftScaleBound s Lhsep :hunit :IsUnit B₀.dethexact :ExactCongruence A s B₀happrox :ApproximateCongruence A s B εconclusionconclusion 1i a :|(transition B₀ B i a) ^ 2 - if i = a then 1 else 0| ≤ productControlFactor d L δ * εconclusion 2i j a :i ≠ jProof (Lean source)
-- Proof route: choose `base,pick` from `hsep`, subtract each picked congruence equation -- from the base equation, and apply `coordinate_le_affineSolveFactor`. On diagonal -- matrix entries solve for `M i a ^ 2 - 1_{i=a}`; off the diagonal solve for -- `M i a * M j a`. `abs_entry_le_opNorm` and the triangle inequality give `2ε`. theorem transition_coordinate_product_control {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (B₀ B : SqMatrix d) {L δ ε : ℝ} (hL : 0 ≤ L) (hδ : 0 < δ) (hscale : ShiftScaleBound s L) (hsep : AffineMinorSeparated s δ) (hunit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (happrox : ApproximateCongruence A s B ε) : (∀ i a, |(transition B₀ B i a) ^ 2 - if i = a then 1 else 0| ≤ productControlFactor d L δ * ε) ∧ (∀ i j a, i ≠ j → |transition B₀ B i a * transition B₀ B j a| ≤ productControlFactor d L δ * ε) := by classical obtain ⟨base, pick, hdet⟩ := hsep let M := transition B₀ B let V : SqMatrix d := fun k a => s (pick k) a - s base a have hV : ∀ k a, |V k a| ≤ 2 * L := by intro k a dsimp [V] calc |s (pick k) a - s base a| ≤ |s (pick k) a| + |s base a| := abs_sub _ _ _ ≤ L + L := add_le_add (hscale _ _) (hscale _ _) _ = 2 * L := by ring have hdef : ∀ e i j, |congruenceDefect (A e) (s e) B i j| ≤ ε := by intro e i j calc |congruenceDefect (A e) (s e) B i j| ≤ ‖congruenceDefect (A e) (s e) B‖ := abs_entry_le_opNorm _ _ _ _ ≤ ε := (simultaneousCongruenceResidual_le_iff A s B ε).mp happrox e have hdefM : ∀ e i j, |(M * diagonal (s e) * M.transpose - diagonal (s e)) i j| ≤ ε := by intro e i j rw [transition_diagonal_congruence A s B₀ B hunit hexact e] exact hdef e i j constructor · intro i a let y : Fin d → ℝ := fun b => M i b ^ 2 - if i = b then 1 else 0 have hres : ∀ k, |(V *ᵥ y) k| ≤ 2 * ε := by intro k have hid : (V *ᵥ y) k = ((M * diagonal (s (pick k)) * M.transpose - diagonal (s (pick k))) i i) - ((M * diagonal (s base) * M.transpose - diagonal (s base)) i i) := diagonal_difference_mulVec M (s (pick k)) (s base) i k rw [hid] calc |_ - _| ≤ |(M * diagonal (s (pick k)) * M.transpose - diagonal (s (pick k))) i i| + |(M * diagonal (s base) * M.transpose - diagonal (s base)) i i| := abs_sub _ _ _ ≤ ε + ε := add_le_add (hdefM _ _ _) (hdefM _ _ _) _ = 2 * ε := by ring have hy := coordinate_le_affineSolveFactor V y hδ hL hV hdet hres a change |M i a ^ 2 - if i = a then 1 else 0| ≤ _ change |y a| ≤ _ at hy unfold productControlFactor nlinarith · intro i j a hij let y : Fin d → ℝ := fun b => M i b * M j b have hres : ∀ k, |(V *ᵥ y) k| ≤ 2 * ε := by intro k have hid : (V *ᵥ y) k = ((M * diagonal (s (pick k)) * M.transpose - diagonal (s (pick k))) i j) - ((M * diagonal (s base) * M.transpose - diagonal (s base)) i j) := offDiagonal_difference_mulVec M (s (pick k)) (s base) i j k hij rw [hid] calc |_ - _| ≤ |(M * diagonal (s (pick k)) * M.transpose - diagonal (s (pick k))) i j| + |(M * diagonal (s base) * M.transpose - diagonal (s base)) i j| := abs_sub _ _ _ ≤ ε + ε := add_le_add (hdefM _ _ _) (hdefM _ _ _) _ = 2 * ε := by ring have hy := coordinate_le_affineSolveFactor V y hδ hL hV hdet hres a change |M i a * M j a| ≤ _ change |y a| ≤ _ at hy unfold productControlFactor nlinarith -
transition_diagonal_ge_halftheorem — Small residuals keep every transition diagonal on the positive identity branch, ruling out sign flips by forcing it above one half. This applies to matrix family, shifts, reference, and candidate over environments E in dimension d, with scales and tolerance, positive dimension and scales, bounded and separated shifts, unit-diagonal matrices, scale control, an invertible reference, exact reference congruences, an admissibly small tolerance, and a candidate achieving that tolerance.hypothesesd :ℕE :A :E → SqMatrix ds :E → Fin d → ℝB₀ B :SqMatrix dL δ R ε :ℝhd :0 < dhL :0 < Lhδ :0 < δhR :0 < Rhscale :ShiftScaleBound s Lhsep :hnorm₀ :UnitDiagonal B₀hnorm :hmatrixScale :PairMatrixScaleBound R B₀ BhB₀unit :IsUnit B₀.dethexact :ExactCongruence A s B₀hsmall :ε ≤ admissibleRadius d L δ Rhapprox :ApproximateCongruence A s B εi :conclusion(1 : ℝ) / 2 ≤ transition B₀ B i iProof (Lean source)
-- Proof route: square control first gives `|M i a| ≤ sqrt(qε)` for `a ≠ i`. From -- `B = M B₀` and both unit diagonals, bound `|M i i - 1|` by the off-diagonal terms -- times entries of `B₀`, hence by `d R sqrt(qε)`. The second threshold makes this ≤ 1/2. theorem transition_diagonal_ge_half {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (B₀ B : SqMatrix d) {L δ R ε : ℝ} (hd : 0 < d) (hL : 0 < L) (hδ : 0 < δ) (hR : 0 < R) (hscale : ShiftScaleBound s L) (hsep : AffineMinorSeparated s δ) (hnorm₀ : UnitDiagonal B₀) (hnorm : UnitDiagonal B) (hmatrixScale : PairMatrixScaleBound R B₀ B) (hB₀unit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (hsmall : ε ≤ admissibleRadius d L δ R) (happrox : ApproximateCongruence A s B ε) : ∀ i, (1 : ℝ) / 2 ≤ transition B₀ B i i := by classical let q := productControlFactor d L δ let K := R let M := transition B₀ B have hq : 0 < q := productControlFactor_pos hd hL hδ have hK : 0 < K := by simpa [K] using hR have hcontrol := transition_coordinate_product_control A s B₀ B hL.le hδ hscale hsep hB₀unit hexact happrox have heps : ε ≤ 1 / (4 * (d : ℝ) ^ 2 * K ^ 2 * q) := by exact hsmall.trans (min_le_right _ _) have hqeps : q * ε ≤ (1 / (2 * (d : ℝ) * K)) ^ 2 := by calc q * ε ≤ q * (1 / (4 * (d : ℝ) ^ 2 * K ^ 2 * q)) := mul_le_mul_of_nonneg_left heps hq.le _ = (1 / (2 * (d : ℝ) * K)) ^ 2 := by field_simp [ne_of_gt hq, ne_of_gt hK, Nat.cast_ne_zero.mpr (Nat.ne_of_gt hd)] ring have hoff : ∀ i a, i ≠ a → |M i a| ≤ 1 / (2 * (d : ℝ) * K) := by intro i a hia have hsquare := hcontrol.1 i a change |M i a ^ 2 - (if i = a then 1 else 0)| ≤ q * ε at hsquare simp only [if_neg hia, sub_zero, abs_sq] at hsquare apply (sq_le_sq₀ (abs_nonneg _) (by positivity)).mp rw [sq_abs] exact hsquare.trans hqeps have hB₀entry : ∀ a i, |B₀ a i| ≤ R := by intro a i exact (abs_entry_le_opNorm B₀ a i).trans hmatrixScale.1 have hMB : M * B₀ = B := by dsimp [M, transition] simpa only [Matrix.mul_assoc] using Matrix.nonsing_inv_mul_cancel_right B₀ B hB₀unit intro i have hentry := congrArg (fun N : SqMatrix d => N i i) hMB simp only [Matrix.mul_apply] at hentry have hsplit := Finset.sum_erase_add (Finset.univ : Finset (Fin d)) (fun a => M i a * B₀ a i) (Finset.mem_univ i) rw [← hsplit] at hentry rw [hnorm₀ i, mul_one, hnorm i] at hentry have heq : M i i - 1 = -∑ a ∈ Finset.univ.erase i, M i a * B₀ a i := by linarith have habs : |M i i - 1| ≤ 1 / 2 := by rw [heq, abs_neg] calc |∑ a ∈ Finset.univ.erase i, M i a * B₀ a i| ≤ ∑ a ∈ Finset.univ.erase i, |M i a * B₀ a i| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _a ∈ Finset.univ.erase i, 1 / (2 * (d : ℝ)) := by gcongr with a ha rw [abs_mul] have hia : i ≠ a := by exact fun h => (Finset.mem_erase.mp ha).1 h.symm calc |M i a| * |B₀ a i| ≤ (1 / (2 * (d : ℝ) * K)) * R := by gcongr · exact hoff i a hia · exact hB₀entry a i _ ≤ 1 / (2 * (d : ℝ)) := by have hRK : R ≤ K := by simp [K] field_simp [Nat.cast_ne_zero.mpr (Nat.ne_of_gt hd), ne_of_gt hK] nlinarith _ ≤ ∑ _a ∈ Finset.univ, 1 / (2 * (d : ℝ)) := by apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) intros positivity _ = 1 / 2 := by simp [Finset.sum_const, nsmul_eq_mul] field_simp [Nat.cast_ne_zero.mpr (Nat.ne_of_gt hd)] change (1 : ℝ) / 2 ≤ M i i have := (abs_le.mp habs).1 linarith