Discovery.Linear­Disentanglement.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.

abbrev SqMatrix reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

A square matrix represents a latent change of coordinates in dimension d.

Definition (Lean source)
d :
ℕ
SqMatrix d :
Type
Matrix (Fin d) (Fin d) ℝ
Causalean.Discovery.LinearDisentanglement.Quantitative.SqMatrix · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:30
def congruenceDefect reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

The congruence defect measures how far candidate coordinates B fail to turn observed matrix A into the prescribed diagonal s, in dimension d.

Definition (Lean source)
d :
ℕ
A :
s :
Fin d → ℝ
B :
congruenceDefect A s B :
B * A * B.transpose - diagonal s
Causalean.Discovery.LinearDisentanglement.Quantitative.congruenceDefect · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:34 · uses SqMatrix
def simultaneousCongruenceResidual reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
E :
Type*
Nonempty E
A :
E → SqMatrix d
s :
E → Fin d → ℝ
B :
simultaneousCongruenceResidual A s B :
ℝ
Finset.univ.sup' univ_nonempty fun e => ‖congruenceDefect (A e) (s e) B‖
Causalean.Discovery.LinearDisentanglement.Quantitative.simultaneousCongruenceResidual · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:41 · uses SqMatrix
theorem simultaneousCongruenceResidual_le_iff reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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
d :
ℕ
E :
Type*
Nonempty E
A :
E → SqMatrix d
s :
E → Fin d → ℝ
B :
ε :
ℝ
simultaneousCongruenceResidual A s B ≤ ε ↔ ∀ e, ‖congruenceDefect (A e) (s e) B‖ ≤ ε
Proof (Lean source)
theorem simultaneousCongruenceResidual_le_iff {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (B : SqMatrix d) (ε : ℝ) : simultaneousCongruenceResidual A s B ≤ ε ↔ ∀ e, ‖congruenceDefect (A e) (s e) B‖ ≤ ε := by classical simp only [simultaneousCongruenceResidual, Finset.sup'_le_iff, Finset.mem_univ, forall_const]
Causalean.Discovery.LinearDisentanglement.Quantitative.simultaneousCongruenceResidual_le_iff · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:61 · uses SqMatrix , congruenceDefect , simultaneousCongruenceResidual
def AffineMinorSeparated reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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 δ.

Definition (Lean source)
d :
ℕ
E :
Type*
s :
E → Fin d → ℝ
δ :
ℝ
AffineMinorSeparated s δ :
Prop
∃ (base : E) (pick : Fin d → E), δ ≤ |det (fun i j => s (pick i) j - s base j)|
Causalean.Discovery.LinearDisentanglement.Quantitative.AffineMinorSeparated · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:73
def ShiftScaleBound reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

The shift-scale bound caps every coordinate of all environmental shifts by magnitude L, across finite environment collection E in dimension d.

Definition (Lean source)
d :
ℕ
E :
Type*
s :
E → Fin d → ℝ
L :
ℝ
e i :
ShiftScaleBound s L :
Prop
|s e i| ≤ L
Causalean.Discovery.LinearDisentanglement.Quantitative.ShiftScaleBound · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:81
def UnitDiagonal reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

Unit-diagonal normalization fixes the otherwise free row scales of matrix B in dimension d.

Definition (Lean source)
d :
ℕ
B :
i :
UnitDiagonal B :
Prop
B i i = 1
Causalean.Discovery.LinearDisentanglement.Quantitative.UnitDiagonal · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:88 · uses SqMatrix
def operatorConditionNumber reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
B :
operatorConditionNumber B :
ℝ
‖B‖ * ‖B⁻¹‖
Causalean.Discovery.LinearDisentanglement.Quantitative.operatorConditionNumber · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:93 · uses SqMatrix
def WellConditioned reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
κ :
ℝ
B :
WellConditioned κ B :
Prop
clause 1
IsUnit B.det
clause 2
Causalean.Discovery.LinearDisentanglement.Quantitative.WellConditioned · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:100 · uses SqMatrix
def PairConditionBound reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
κ :
ℝ
B₀ B :
PairConditionBound κ B₀ B :
Prop
clause 1
clause 2
Causalean.Discovery.LinearDisentanglement.Quantitative.PairConditionBound · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:106 · uses SqMatrix
def PairMatrixScaleBound reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
R :
ℝ
B₀ B :
PairMatrixScaleBound R B₀ B :
Prop
clause 1
‖B₀‖ ≤ R
clause 2
‖B‖ ≤ R
Causalean.Discovery.LinearDisentanglement.Quantitative.PairMatrixScaleBound · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:112 · uses SqMatrix
def transition reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

The transition matrix expresses candidate coordinates relative to the reference coordinates in dimension d, so identity is exact recovery.

Definition (Lean source)
d :
ℕ
B₀ B :
transition B₀ B :
B * B₀⁻¹
Causalean.Discovery.LinearDisentanglement.Quantitative.transition · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:118 · uses SqMatrix
def ExactCongruence reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

Exact congruence means reference coordinates B₀ recover every prescribed diagonal shift from the observed matrix family, throughout finite environment collection E in dimension d.

Definition (Lean source)
d :
ℕ
E :
Type*
A :
E → SqMatrix d
s :
E → Fin d → ℝ
B₀ :
e :
ExactCongruence A s B₀ :
Prop
B₀ * A e * B₀.transpose = diagonal (s e)
Causalean.Discovery.LinearDisentanglement.Quantitative.ExactCongruence · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:123 · uses SqMatrix
def ApproximateCongruence reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
E :
Type*
Nonempty E
A :
E → SqMatrix d
s :
E → Fin d → ℝ
B :
ε :
ℝ
ApproximateCongruence A s B ε :
Prop
Causalean.Discovery.LinearDisentanglement.Quantitative.ApproximateCongruence · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:130 · uses SqMatrix
def affineSolveFactor reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
L δ :
ℝ
affineSolveFactor d L δ :
ℝ
(d : ℝ) * (factorial (d - 1) : ℝ) * (2 * L) ^ (d - 1) / δ
Causalean.Discovery.LinearDisentanglement.Quantitative.affineSolveFactor · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:137
def productControlFactor reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
L δ :
ℝ
productControlFactor d L δ :
ℝ
Causalean.Discovery.LinearDisentanglement.Quantitative.productControlFactor · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:143
def stabilityConstant reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

The stability constant turns congruence residuals into recovery error under dimension d, shift scale L, separation margin δ, and matrix scale R.

Definition (Lean source)
d :
ℕ
L δ R :
ℝ
stabilityConstant d L δ R :
ℝ
2 * (d : ℝ) * R * productControlFactor d L δ
Causalean.Discovery.LinearDisentanglement.Quantitative.stabilityConstant · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:149
def admissibleRadius reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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)
d :
ℕ
L δ R :
ℝ
admissibleRadius d L δ R :
ℝ
min (1 / (4 * productControlFactor d L δ)) (1 / (4 * (d : ℝ) ^ 2 * R ^ 2 * productControlFactor d L δ))
Causalean.Discovery.LinearDisentanglement.Quantitative.admissibleRadius · Causalean/Discovery/LinearDisentanglement/Quantitative/Definitions.lean:155
3 supporting declarations (lemmas, instances)
Compact­Exclusion 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.

theorem exists_simultaneousCongruence_exclusionRadius reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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
d :
ℕ
E :
Type*
Nonempty E
A :
E → SqMatrix d
s :
E → Fin d → ℝ
K U :
B₀ :
hK :
hU :
hB₀U :
B₀ ∈ U
hfar :
(K \ U).Nonempty
hzero :
∀ B ∈ K
then
B = B₀
Proof (Lean source)
theorem exists_simultaneousCongruence_exclusionRadius {d : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix d) (s : E → Fin d → ℝ) (K U : Set (SqMatrix d)) (B₀ : SqMatrix d) (hK : IsCompact K) (hU : IsOpen U) (hB₀U : B₀ ∈ U) (hfar : (K \ U).Nonempty) (hzero : ∀ B ∈ K, simultaneousCongruenceResidual A s B = 0 → B = B₀) : Nonempty (PositiveExclusionRadius K U (simultaneousCongruenceResidual A s)) := by exact exists_positiveExclusionRadius K U (simultaneousCongruenceResidual A s) B₀ hK hU hB₀U hfar (continuous_simultaneousCongruenceResidual A s) (fun B _ => simultaneousCongruenceResidual_nonneg A s B) hzero
Causalean.Discovery.LinearDisentanglement.Quantitative.exists_simultaneousCongruence_exclusionRadius · Causalean/Discovery/LinearDisentanglement/Quantitative/CompactExclusion.lean:62 · uses SqMatrix , simultaneousCongruenceResidual , PositiveExclusionRadius
3 supporting declarations (lemmas, instances)
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.

theorem opNorm_sub_le_of_approximate_simultaneous_congruence reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative

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
d :
ℕ
E :
Type*
Nonempty E
A :
E → SqMatrix d
s :
E → Fin d → ℝ
B₀ B :
L δ R ε :
ℝ
hd :
0 < d
hL :
0 < L
hδ :
0 < δ
hR :
0 < R
hscale :
hsep :
hnorm₀ :
hnorm :
hmatrixScale :
hB₀unit :
IsUnit B₀.det
hexact :
hε :
0 ≤ ε
hsmall :
ε ≤ admissibleRadius d L δ R
happrox :
‖B - B₀‖ ≤ stabilityConstant d L δ R * ε
Proof (Lean source)
-- Proof route: the preceding half-bound and cross-product control give -- `|M i a| ≤ 2qε` for `i ≠ a`; square control bounds `|M i i - 1|`. Convert this to -- `‖M-I‖ ≤ 2d qε`, write `B-B₀ = (M-I)B₀`, and use `‖B₀‖ ≤ R`. theorem opNorm_sub_le_of_approximate_simultaneous_congruence {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₀) (hε : 0 ≤ ε) (hsmall : ε ≤ admissibleRadius d L δ R) (happrox : ApproximateCongruence A s B ε) : ‖B - B₀‖ ≤ stabilityConstant d L δ R * ε := by classical let q := productControlFactor d L δ let M := transition B₀ B have hq : 0 < q := productControlFactor_pos hd hL hδ have hqε : 0 ≤ q * ε := mul_nonneg hq.le hε have hcontrol := transition_coordinate_product_control A s B₀ B hL.le hδ hscale hsep hB₀unit hexact happrox have hhalf := transition_diagonal_ge_half A s B₀ B hd hL hδ hR hscale hsep hnorm₀ hnorm hmatrixScale hB₀unit hexact hsmall happrox have hoff : ∀ i a, i ≠ a → |M i a| ≤ 2 * q * ε := by intro i a hia have hp := hcontrol.2 i a a hia change |M i a * M a a| ≤ q * ε at hp rw [abs_mul] at hp have haa : (1 : ℝ) / 2 ≤ |M a a| := (show (1 : ℝ) / 2 ≤ M a a from hhalf a).trans (le_abs_self _) have hmul : |M i a| * ((1 : ℝ) / 2) ≤ |M i a| * |M a a| := mul_le_mul_of_nonneg_left haa (abs_nonneg _) nlinarith have hdiag : ∀ i, |M i i - 1| ≤ 2 * q * ε := by intro i have hsquare := hcontrol.1 i i rw [if_pos rfl] at hsquare change |M i i ^ 2 - 1| ≤ q * ε at hsquare have hi : (1 : ℝ) / 2 ≤ M i i := hhalf i have hplus : 1 ≤ |M i i + 1| := by rw [abs_of_nonneg] · linarith · linarith have hfactor : |M i i - 1| * |M i i + 1| = |M i i ^ 2 - 1| := by rw [← abs_mul] congr 1 ring calc |M i i - 1| ≤ |M i i - 1| * |M i i + 1| := by nlinarith [mul_le_mul_of_nonneg_left hplus (abs_nonneg (M i i - 1))] _ = |M i i ^ 2 - 1| := hfactor _ ≤ q * ε := hsquare _ ≤ 2 * q * ε := by nlinarith have hentry : ∀ i a, |(M - 1) i a| ≤ 2 * q * ε := by intro i a by_cases hia : i = a · subst a simpa using hdiag i · simpa [Matrix.sub_apply, Matrix.one_apply, hia] using hoff i a hia have hMnorm : ‖M - 1‖ ≤ (d : ℝ) * (2 * q * ε) := opNorm_le_dimension_mul_of_entry_bound (M - 1) (by positivity) hentry 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 have hfactor : B - B₀ = (M - 1) * B₀ := by rw [Matrix.sub_mul, Matrix.one_mul, hMB] rw [hfactor] calc ‖(M - 1) * B₀‖ ≤ ‖M - 1‖ * ‖B₀‖ := norm_mul_le _ _ _ ≤ ((d : ℝ) * (2 * q * ε)) * R := by exact mul_le_mul hMnorm hmatrixScale.1 (norm_nonneg _) (by positivity) _ = 2 * (d : ℝ) * R * q * ε := by ring _ = stabilityConstant d L δ R * ε := by dsimp [q] unfold stabilityConstant ring
6 supporting declarations (lemmas, instances)
  • abs_entry_le_opNorm theorem — 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.
    d :
    ℕ
    M :
    i j :
    Fin d
    |M i j| ≤ ‖M‖
    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]
    Causalean.Discovery.LinearDisentanglement.Quantitative.abs_entry_le_opNorm · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:146
  • opNorm_le_dimension_mul_of_entry_bound theorem — 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.
    d :
    ℕ
    M :
    c :
    ℝ
    hc :
    0 ≤ c
    hM :
    ∀ i j, |M i j| ≤ c
    ‖M‖ ≤ (d : ℝ) * c
    Proof (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
    Causalean.Discovery.LinearDisentanglement.Quantitative.opNorm_le_dimension_mul_of_entry_bound · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:165
  • coordinate_le_affineSolveFactor theorem — 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.
    d :
    ℕ
    V :
    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 δ * η
    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
    Causalean.Discovery.LinearDisentanglement.Quantitative.coordinate_le_affineSolveFactor · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:191
  • transition_diagonal_congruence theorem — 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.
    d :
    ℕ
    E :
    Type*
    A :
    E → SqMatrix d
    s :
    E → Fin d → ℝ
    B₀ B :
    hunit :
    IsUnit B₀.det
    hexact :
    e :
    E
    transition B₀ B * diagonal (s e) * (transition B₀ B).transpose
    = B * A e * B.transpose
    Proof (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
    Causalean.Discovery.LinearDisentanglement.Quantitative.transition_diagonal_congruence · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:244
  • transition_coordinate_product_control theorem — 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.
    d :
    ℕ
    E :
    Type*
    Nonempty E
    A :
    E → SqMatrix d
    s :
    E → Fin d → ℝ
    B₀ B :
    L δ ε :
    ℝ
    hL :
    0 ≤ L
    hδ :
    0 < δ
    hscale :
    hsep :
    hunit :
    IsUnit B₀.det
    hexact :
    happrox :
    conclusion 1
    i a :
    |(transition B₀ B i a) ^ 2 - if i = a then 1 else 0| ≤ productControlFactor d L δ * ε
    conclusion 2
    i j a :
    i ≠ j
    |transition B₀ B i a * transition B₀ B j a| ≤ productControlFactor d L δ * ε
    Proof (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
    Causalean.Discovery.LinearDisentanglement.Quantitative.transition_coordinate_product_control · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:267
  • transition_diagonal_ge_half theorem — 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.
    d :
    ℕ
    E :
    Type*
    Nonempty E
    A :
    E → SqMatrix d
    s :
    E → Fin d → ℝ
    B₀ B :
    L δ R ε :
    ℝ
    hd :
    0 < d
    hL :
    0 < L
    hδ :
    0 < δ
    hR :
    0 < R
    hscale :
    hsep :
    hnorm₀ :
    hnorm :
    hmatrixScale :
    hB₀unit :
    IsUnit B₀.det
    hexact :
    hsmall :
    ε ≤ admissibleRadius d L δ R
    happrox :
    i :
    (1 : ℝ) / 2 ≤ transition B₀ B i i
    Proof (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
    Causalean.Discovery.LinearDisentanglement.Quantitative.transition_diagonal_ge_half · Causalean/Discovery/LinearDisentanglement/Quantitative/Quantitative.lean:363