Discovery.Linear­Disentanglement.Quantitative.Pairwise­Affine

Pairwise-affine simultaneous-congruence stability tools: each coordinate pair may use its own three separating environments, yielding explicit local operator-norm perturbation bounds.

Definitions 17 core · 7 supporting This module defines pair-dependent affine-minor separation, off-diagonal approximate simultaneous congruence, the entrywise Euclidean matrix norm used for aggregation, and the explicit constants and scale envelopes used ★ opNorm_le_conditionRoot

Pairwise-affine simultaneous-congruence stability: definitions

This module defines pair-dependent affine-minor separation, off-diagonal approximate simultaneous congruence, the entrywise Euclidean matrix norm used for aggregation, and the explicit constants and scale envelopes used by the local stability theorem.

Unlike AffineMinorSeparated, the separation predicate here does not select one common base and a full-dimensional minor. Its three witnessing environments may depend on the coordinate pair.

def pairAffineDet reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, an environment collection, a diagonal shift vector for each environment, two selected coordinates, and three environments, the pairwise affine determinant is the signed area determinant of the three corresponding two-coordinate shift points.

Definition (Lean source)
p :
E :
Type*
s :
E → Fin p → ℝ
i j :
Fin p
e₀ e₁ e₂ :
E
pairAffineDet s i j e₀ e₁ e₂ :
(s e₁ i - s e₀ i) * (s e₂ j - s e₀ j) - (s e₂ i - s e₀ i) * (s e₁ j - s e₀ j)
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairAffineDet · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:32
def PairwiseAffineSeparated reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a finite environment collection, a diagonal shift vector for each environment, and a real margin, pairwise affine separation holds exactly when every two distinct coordinates admit three, possibly pair-specific, environments whose affine determinant has absolute value at least the margin.

Definition (Lean source)
p :
E :
Type*
s :
E → Fin p → ℝ
δ :
i j :
i ≠ j
PairwiseAffineSeparated s δ :
Prop
∃ e₀ e₁ e₂ : E, δ ≤ |pairAffineDet s i j e₀ e₁ e₂|
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.PairwiseAffineSeparated · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:41
def OffDiagonalApproximateCongruence reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a finite environment collection, an observed matrix for each environment, a candidate matrix, and a real tolerance, off-diagonal approximate congruence holds exactly when every off-diagonal entry of every transformed matrix has absolute value at most the tolerance.

Definition (Lean source)
p :
E :
Type*
A :
E → SqMatrix p
B :
ε :
e i j :
i ≠ j
OffDiagonalApproximateCongruence A B ε :
Prop
|(B * A e * B.transpose) i j| ≤ ε
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.OffDiagonalApproximateCongruence · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:49 · uses SqMatrix
def transitionError reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension and a reference and candidate matrix, the transition error is the transition matrix minus the identity matrix.

Definition (Lean source)
p :
B₀ B :
transitionError B₀ B :
transition B₀ B - 1
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.transitionError · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:59 · uses SqMatrix
def entryL2 reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension and a square matrix, its entrywise Euclidean size is its Frobenius norm: the square root of the sum of squared absolute values of all its entries.

Definition (Lean source)
p :
R :
entryL2 R :
@norm (SqMatrix p) Matrix.frobeniusNormedAddCommGroup.toNorm R
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.entryL2 · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:64 · uses SqMatrix
def pairwiseSolveFactor reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a shift scale and a pairwise affine-separation margin, the pairwise solve factor is 6M/δ6M/\delta.

Definition (Lean source)
M δ :
pairwiseSolveFactor M δ :
6 * M / δ
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairwiseSolveFactor · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:90
def pairwiseAggregateFactor reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a shift scale, a pairwise affine-separation margin, and a matrix scale, the pairwise aggregate factor is the pairwise solve factor times the square root of p(p1)(1+L2)p(p-1)(1+L^2).

Definition (Lean source)
p :
M δ L :
pairwiseAggregateFactor p M δ L :
pairwiseSolveFactor M δ * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2))
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairwiseAggregateFactor · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:98
def pairwiseStabilityConstant reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a shift scale, a pairwise affine-separation margin, and a matrix scale, the pairwise stability constant is sixteen times the pairwise aggregate factor times L3L^3.

Definition (Lean source)
p :
M δ L :
pairwiseStabilityConstant p M δ L :
16 * pairwiseAggregateFactor p M δ L * L ^ 3
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairwiseStabilityConstant · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:105
def pairwiseResidualRadius reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a shift scale, a pairwise affine-separation margin, and a matrix scale, the pairwise residual radius is the reciprocal of thirty-two times the squared maximum of one and the pairwise aggregate factor, times the shift scale.

Definition (Lean source)
p :
M δ L :
pairwiseResidualRadius p M δ L :
1 / (32 * (max 1 (pairwiseAggregateFactor p M δ L)) ^ 2 * M)
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairwiseResidualRadius · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:111
def pairwiseLocalRadius reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a shift scale, a pairwise affine-separation margin, a matrix scale, and an inverse-norm envelope, the pairwise local radius is the minimum of one and three divided by eight times the shift scale times the larger of one and the pairwise aggregate factor, all divided by the product of the dimension and the inverse-norm envelope.

Definition (Lean source)
p :
M δ L J :
pairwiseLocalRadius p M δ L J :
min 1 (3 / (8 * max 1 (pairwiseAggregateFactor p M δ L) * M)) / ((p : ℝ) * J)
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pairwiseLocalRadius · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:120
def conditionRoot reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension and a condition-number envelope, the condition root is ((p!)κp1)1/p((p!)\kappa^{p-1})^{1/p} for positive dimension. At dimension zero the exponents are evaluated by convention (natural subtraction gives p1=0p-1=0 and 1/0=01/0=0), so the value is one.

Definition (Lean source)
p :
κ :
conditionRoot p κ :
((Nat.factorial p : ℝ) * κ ^ (p - 1)) ^ (1 / (p : ℝ))
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.conditionRoot · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:131
abbrev PairMatrixNormBound reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a real scale bound, and a reference and candidate matrix, the pair matrix-norm bound is the pair matrix-scale bound for the same data: both Euclidean operator norms are at most the scale bound. It is an abbreviation kept for compatibility; PairMatrixScaleBound is the canonical name.

Definition (Lean source)
p :
L :
B₀ B :
PairMatrixNormBound L B₀ B :
Prop
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.PairMatrixNormBound · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:137 · uses SqMatrix
def InReferenceNeighborhood reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a real neighborhood radius, and a reference and candidate matrix, membership in the reference neighborhood holds exactly when their entrywise Euclidean distance is at most the radius.

Definition (Lean source)
p :
ρ :
B₀ B :
InReferenceNeighborhood ρ B₀ B :
Prop
entryL2 (B - B₀) ≤ ρ
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.InReferenceNeighborhood · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:144 · uses SqMatrix
def DetConditionEnvelope reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a condition-number envelope, and a square matrix, the determinant-condition envelope holds exactly when the matrix is nonsingular, its determinant has absolute value at most p!p!, and its Euclidean operator-norm condition number is at most the envelope.

Definition (Lean source)
p :
κ :
B :
DetConditionEnvelope κ B :
Prop
clause 1
IsUnit B.det
clause 2
|B.det| ≤ (Nat.factorial p : ℝ)
clause 3
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.DetConditionEnvelope · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:150 · uses SqMatrix
def PairDetConditionEnvelope reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a condition-number envelope, and a reference and candidate matrix, the pair determinant-condition envelope holds exactly when the reference matrix satisfies that determinant-condition envelope and the candidate matrix satisfies that determinant-condition envelope.

Definition (Lean source)
p :
κ :
B₀ B :
PairDetConditionEnvelope κ B₀ B :
Prop
clause 1
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.PairDetConditionEnvelope · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:158 · uses SqMatrix
def InIdentityBranch reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For a dimension, a shift scale, a pairwise affine-separation margin, a matrix scale, and a reference and candidate matrix, membership in the identity branch holds exactly when the transition error has entrywise Euclidean size at most one and twice the pairwise aggregate factor times the shift scale times that size is at most one half.

Definition (Lean source)
p :
M δ L :
B₀ B :
InIdentityBranch M δ L B₀ B :
Prop
clause 1
entryL2 (transitionError B₀ B) ≤ 1
clause 2
2 * pairwiseAggregateFactor p M δ L * M * entryL2 (transitionError B₀ B) ≤ 1 / 2
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.InIdentityBranch · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:165 · uses SqMatrix
theorem opNorm_le_conditionRoot reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For positive dimension, condition envelope at least one, and a determinant/condition envelope for the matrix, the matrix operator norm is bounded by the determinant/condition root.

Formal statement
p :
κ :
B :
hp :
0 < p
:
1 ≤ κ
henv :
‖B‖ ≤ conditionRoot p κ
Proof (Lean source)
-- Proof route: order the singular values; -- `cond(B) ≤ κ` bounds every lower singular value below by `‖B‖/κ`, while their -- product is `|det B| ≤ p!`. Take the positive `p`-th root. theorem opNorm_le_conditionRoot {p : ℕ} {κ : ℝ} (B : SqMatrix p) (hp : 0 < p) (hκ : 1 ≤ κ) (henv : DetConditionEnvelope κ B) : ‖B‖ ≤ conditionRoot p κ := by have hcond_nonneg : 0 ≤ operatorConditionNumber B := mul_nonneg (norm_nonneg B) (norm_nonneg B⁻¹) have hpow : ‖B‖ ^ p ≤ (Nat.factorial p : ℝ) * κ ^ (p - 1) := by calc ‖B‖ ^ p ≤ |B.det| * operatorConditionNumber B ^ (p - 1) := opNorm_pow_le_det_mul_condition_pow hp B henv.1 _ ≤ (Nat.factorial p : ℝ) * κ ^ (p - 1) := by exact mul_le_mul henv.2.1 (pow_le_pow_left₀ hcond_nonneg henv.2.2 _) (pow_nonneg hcond_nonneg _) (by positivity) unfold conditionRoot have hrpow := Real.rpow_le_rpow (pow_nonneg (norm_nonneg B) _) hpow (show 0 ≤ 1 / (p : ℝ) by positivity) calc ‖B‖ = (‖B‖ ^ p) ^ (1 / (p : ℝ)) := by rw [← Real.rpow_natCast] rw [← Real.rpow_mul (norm_nonneg B)] have hpR : (p : ℝ) ≠ 0 := by positivity rw [mul_div_cancel₀ 1 hpR, Real.rpow_one] _ ≤ ((Nat.factorial p : ℝ) * κ ^ (p - 1)) ^ (1 / (p : ℝ)) := hrpow
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.opNorm_le_conditionRoot · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/Definitions.lean:327 · uses DetConditionEnvelope , conditionRoot , SqMatrix
7 supporting declarations (lemmas, instances)
Local­Branch 1 core · 5 supporting This module converts an ordinary entrywise-L² neighborhood of the reference into control of the transition error. ★ inIdentityBranch_of_small_residual

Local branch selection for pairwise-affine congruence stability

This module converts an ordinary entrywise-L² neighborhood of the reference into control of the transition error. It then combines that control with an explicit small-residual threshold and the pairwise quadratic estimate to select the identity branch. Thus the stability API does not ask callers to assume the desired transition-error bound directly.

theorem inIdentityBranch_of_small_residual reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

Small-residual local identity-branch selection. For positive dimension, shift scale, affine margin, matrix scale, and inverse envelope, bounded pairwise-separated shifts, an exact invertible unit-diagonal reference, a unit-diagonal candidate, a reference operator norm at most the matrix scale, an inverse bound, nonnegative approximate residual, the explicit residual smallness condition, and membership in the explicit ordinary reference neighborhood, the transition lies on the identity branch needed by the linear stability estimate.

Formal statement
p :
E :
Type*
Nonempty E
A :
E → SqMatrix p
s :
E → Fin p → ℝ
B₀ B :
M δ L J ε :
hp :
0 < p
hM :
0 < M
:
0 < δ
hL :
1 ≤ L
hJ :
0 < J
hscale :
hunit :
IsUnit B₀.det
hexact :
hdiag₀ :
hdiag :
hB₀ :
‖B₀‖ ≤ L
hinv :
‖B₀⁻¹‖ ≤ J
:
0 ≤ ε
hsmall :
ε ≤ pairwiseResidualRadius p M δ L
hlocal :
InIdentityBranch M δ L B₀ B
Proof (Lean source)
-- Proof route: the neighborhood and inverse envelope give `u ≤ min 1 (3/(8 max(1,K)M))` -- for `u = entryL2 R`. Pairwise control gives `u ≤ 2 K M u² + 2 K ε`; the coarse -- local bound absorbs three quarters of `u`, and the residual radius improves this to -- `2 K M u ≤ 1/2`. This derives, rather than assumes, `InIdentityBranch`. theorem inIdentityBranch_of_small_residual {p : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix p) (s : E → Fin p → ℝ) (B₀ B : SqMatrix p) {M δ L J ε : ℝ} (hp : 0 < p) (hM : 0 < M) (hδ : 0 < δ) (hL : 1 ≤ L) (hJ : 0 < J) (hscale : ShiftScaleBound s M) (hsep : PairwiseAffineSeparated s δ) (hunit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (hdiag₀ : UnitDiagonal B₀) (hdiag : UnitDiagonal B) (hB₀ : ‖B₀‖ ≤ L) (hinv : ‖B₀⁻¹‖ ≤ J) (hε : 0 ≤ ε) (hsmall : ε ≤ pairwiseResidualRadius p M δ L) (happrox : OffDiagonalApproximateCongruence A B ε) (hlocal : InReferenceNeighborhood (pairwiseLocalRadius p M δ L J) B₀ B) : InIdentityBranch M δ L B₀ B := by let R := transitionError B₀ B let u := entryL2 R let K := pairwiseAggregateFactor p M δ L have hpR : (0 : ℝ) < p := by exact_mod_cast hp have hL0 : 0 ≤ L := le_trans (by norm_num) hL have hK0 : 0 ≤ K := by dsimp [K, pairwiseAggregateFactor, pairwiseSolveFactor] positivity have hmax : 0 < max 1 K := lt_of_lt_of_le (by norm_num) (le_max_left _ _) have hKmax : K ≤ max 1 K := le_max_right _ _ have hu0 : 0 ≤ u := by exact entryL2_nonneg R have huLocal : u ≤ min 1 (3 / (8 * max 1 K * M)) := by have h := transitionError_entryL2_le_of_neighborhood B₀ B hp hJ.le hunit hinv hlocal change u ≤ (p : ℝ) * J * pairwiseLocalRadius p M δ L J at h calc u ≤ (p : ℝ) * J * pairwiseLocalRadius p M δ L J := h _ = min 1 (3 / (8 * max 1 K * M)) := by dsimp [pairwiseLocalRadius, K] field_simp have hu1 : u ≤ 1 := huLocal.trans (min_le_left _ _) have huCoarse : u ≤ 3 / (8 * max 1 K * M) := huLocal.trans (min_le_right _ _) have hc0 : 0 ≤ pairwiseSolveFactor M δ * (2 * M * u ^ 2 + 2 * ε) := by unfold pairwiseSolveFactor positivity have hoff : ∀ i j, i ≠ j → |R i j| ≤ pairwiseSolveFactor M δ * (2 * M * u ^ 2 + 2 * ε) := by simpa [R, u] using pairwise_offDiagonal_control A s B₀ B hM.le hδ hε hscale hsep hunit hexact happrox have huAgg := entryL2_transitionError_le B₀ B hp hL0 hc0 hunit hdiag₀ hdiag hB₀ hoff have huK : u ≤ K * (2 * M * u ^ 2 + 2 * ε) := by change u ≤ pairwiseSolveFactor M δ * (2 * M * u ^ 2 + 2 * ε) * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2)) at huAgg calc u ≤ pairwiseSolveFactor M δ * (2 * M * u ^ 2 + 2 * ε) * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2)) := huAgg _ = K * (2 * M * u ^ 2 + 2 * ε) := by dsimp [K, pairwiseAggregateFactor] ring have hcoefficient : 2 * K * M * u ≤ 3 / 4 := by calc 2 * K * M * u ≤ 2 * (max 1 K) * M * u := by gcongr _ ≤ 2 * (max 1 K) * M * (3 / (8 * max 1 K * M)) := by gcongr _ = 3 / 4 := by field_simp; ring have huLinear : u ≤ 8 * K * ε := by have hquad : 2 * K * M * u ^ 2 ≤ (3 / 4) * u := by nlinarith [mul_nonneg hu0 (sub_nonneg.mpr hcoefficient)] nlinarith have hsmall' : ε ≤ 1 / (32 * (max 1 K) ^ 2 * M) := by simpa [pairwiseResidualRadius, K] using hsmall have hbranch : 2 * K * M * u ≤ 1 / 2 := by calc 2 * K * M * u ≤ 2 * K * M * (8 * K * ε) := by gcongr _ = 16 * K ^ 2 * M * ε := by ring _ ≤ 16 * (max 1 K) ^ 2 * M * ε := by gcongr _ ≤ 16 * (max 1 K) ^ 2 * M * (1 / (32 * (max 1 K) ^ 2 * M)) := by gcongr _ = 1 / 2 := by field_simp; ring exact ⟨by simpa [u, R] using hu1, by simpa [u, R, K] using hbranch⟩
5 supporting declarations (lemmas, instances)
Pairwise­Control 1 core · 5 supporting This module expands a congruence around the identity transition, bounds its quadratic coordinate-product remainder, solves the two-coordinate affine system furnished by one pair's selected environment triple, and control ★ pairwise_offDiagonal_control

Pairwise affine coordinate control

This module expands a congruence around the identity transition, bounds its quadratic coordinate-product remainder, solves the two-coordinate affine system furnished by one pair's selected environment triple, and controls diagonal transition entries using unit-diagonal normalization.

theorem pairwise_offDiagonal_control reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

For nonnegative scale and residual parameters with a positive affine margin, pairwise affine-separated bounded shifts, an exact invertible reference, and an off-diagonally approximate candidate, every ordered off-diagonal transition error obeys the common pairwise estimate.

Formal statement
p :
E :
Type*
Nonempty E
A :
E → SqMatrix p
s :
E → Fin p → ℝ
B₀ B :
M δ ε :
hM :
0 ≤ M
:
0 < δ
:
0 ≤ ε
hscale :
hunit :
IsUnit B₀.det
hexact :
i j :
i ≠ j
|transitionError B₀ B i j|
pairwiseSolveFactor M δ * (2 * M * entryL2 (transitionError B₀ B) ^ 2 + 2 * ε)
Proof (Lean source)
theorem pairwise_offDiagonal_control {p : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix p) (s : E → Fin p → ℝ) (B₀ B : SqMatrix p) {M δ ε : ℝ} (hM : 0 ≤ M) (hδ : 0 < δ) (hε : 0 ≤ ε) (hscale : ShiftScaleBound s M) (hsep : PairwiseAffineSeparated s δ) (hunit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (happrox : OffDiagonalApproximateCongruence A B ε) : ∀ i j, i ≠ j → |transitionError B₀ B i j| ≤ pairwiseSolveFactor M δ * (2 * M * entryL2 (transitionError B₀ B) ^ 2 + 2 * ε) := by intro i j hij obtain ⟨e₀, e₁, e₂, hdet⟩ := hsep i j hij exact (selectedTriple_offDiagonal_control A s B₀ B i j hij e₀ e₁ e₂ hM hδ hε hscale hdet hunit hexact happrox).1
5 supporting declarations (lemmas, instances)
  • coordinateProductRemainder_le theorem — For a real square matrix, two rows, and two environments, if the shifts have scale at most M and M is nonnegative, then the weighted coordinate-product remainder is bounded by 2 M times the squared entrywise L² size.
    p :
    E :
    Type*
    s :
    E → Fin p → ℝ
    R :
    M :
    hM :
    0 ≤ M
    hscale :
    e₁ e₀ :
    E
    i j :
    Fin p
    |∑ k, R i k * R j k * (s e₁ k - s e₀ k)| ≤ 2 * M * entryL2 R ^ 2
    Proof (Lean source)
    -- Proof route: `|s₁ k-s₀ k| ≤ 2M`, then Cauchy--Schwarz on the two rows and the -- fact that each row's squared sum is bounded by the full entrywise squared sum. theorem coordinateProductRemainder_le {p : ℕ} {E : Type*} [Fintype E] (s : E → Fin p → ℝ) (R : SqMatrix p) {M : ℝ} (hM : 0 ≤ M) (hscale : ShiftScaleBound s M) (e₁ e₀ : E) (i j : Fin p) : |∑ k, R i k * R j k * (s e₁ k - s e₀ k)| ≤ 2 * M * entryL2 R ^ 2 := by classical have hshift (k : Fin p) : |s e₁ k - s e₀ k| ≤ 2 * M := by calc |s e₁ k - s e₀ k| ≤ |s e₁ k| + |s e₀ k| := abs_sub _ _ _ ≤ M + M := add_le_add (hscale _ _) (hscale _ _) _ = 2 * M := by ring have hterm (k : Fin p) : |R i k * R j k * (s e₁ k - s e₀ k)| ≤ M * (|R i k| ^ 2 + |R j k| ^ 2) := by have huv : 2 * (|R i k| * |R j k|) ≤ |R i k| ^ 2 + |R j k| ^ 2 := by nlinarith [sq_nonneg (|R i k| - |R j k|)] calc |R i k * R j k * (s e₁ k - s e₀ k)| = (|R i k| * |R j k|) * |s e₁ k - s e₀ k| := by simp only [abs_mul] _ ≤ (|R i k| * |R j k|) * (2 * M) := by gcongr exact hshift k _ ≤ M * (|R i k| ^ 2 + |R j k| ^ 2) := by nlinarith [mul_nonneg (abs_nonneg (R i k)) (abs_nonneg (R j k))] have hrow (a : Fin p) : (∑ k, |R a k| ^ 2) ≤ ∑ u, ∑ k, |R u k| ^ 2 := by exact Finset.single_le_sum (fun u _ => sum_nonneg fun k _ => sq_nonneg |R u k|) (Finset.mem_univ a) have hentry : entryL2 R ^ 2 = ∑ u, ∑ k, |R u k| ^ 2 := by rw [entryL2_eq_sqrt, Real.sq_sqrt] positivity calc |∑ k, R i k * R j k * (s e₁ k - s e₀ k)| ≤ ∑ k, |R i k * R j k * (s e₁ k - s e₀ k)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ k, M * (|R i k| ^ 2 + |R j k| ^ 2) := by gcongr with k exact hterm k _ = M * ((∑ k, |R i k| ^ 2) + ∑ k, |R j k| ^ 2) := by simp_rw [mul_add] rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] _ ≤ 2 * M * (∑ u, ∑ k, |R u k| ^ 2) := by nlinarith [hrow i, hrow j] _ = 2 * M * entryL2 R ^ 2 := by rw [hentry]
    Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.coordinateProductRemainder_le · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/PairwiseControl.lean:26
  • pair_cramer_control theorem — If the scale is nonnegative, the determinant margin is positive, and the residual bound is nonnegative, all four coefficients have scale at most 2M, the two-by-two coefficient determinant is separated, the two displayed equations hold, and both equation residuals are at most η, then both unknowns obey the conservative explicit Cramer bound.
    a b c d x y r₁ r₂ M δ η :
    hM :
    0 ≤ M
    :
    0 < δ
    :
    0 ≤ η
    hcoeff :
    |a| ≤ 2 * M ∧ |b| ≤ 2 * M ∧ |c| ≤ 2 * M ∧ |d| ≤ 2 * M
    hdet :
    δ ≤ |a * d - c * b|
    heq₁ :
    a * x + b * y = r₁
    heq₂ :
    c * x + d * y = r₂
    hr₁ :
    |r₁| ≤ η
    hr₂ :
    |r₂| ≤ η
    conclusion 1
    |x| ≤ pairwiseSolveFactor M δ * η
    conclusion 2
    |y| ≤ pairwiseSolveFactor M δ * η
    Proof (Lean source)
    theorem pair_cramer_control {a b c d x y r₁ r₂ M δ η : ℝ} (hM : 0 ≤ M) (hδ : 0 < δ) (hη : 0 ≤ η) (hcoeff : |a| ≤ 2 * M ∧ |b| ≤ 2 * M ∧ |c| ≤ 2 * M ∧ |d| ≤ 2 * M) (hdet : δ ≤ |a * d - c * b|) (heq₁ : a * x + b * y = r₁) (heq₂ : c * x + d * y = r₂) (hr₁ : |r₁| ≤ η) (hr₂ : |r₂| ≤ η) : |x| ≤ pairwiseSolveFactor M δ * η ∧ |y| ≤ pairwiseSolveFactor M δ * η := by have hxid : (a * d - c * b) * x = d * r₁ - b * r₂ := by rw [← heq₁, ← heq₂] ring_nf have hyid : (a * d - c * b) * y = a * r₂ - c * r₁ := by rw [← heq₁, ← heq₂] ring have hxnum : |d * r₁ - b * r₂| ≤ 4 * M * η := by calc |d * r₁ - b * r₂| ≤ |d * r₁| + |b * r₂| := abs_sub _ _ _ = |d| * |r₁| + |b| * |r₂| := by simp only [abs_mul] _ ≤ (2 * M) * η + (2 * M) * η := by exact add_le_add (mul_le_mul hcoeff.2.2.2 hr₁ (abs_nonneg r₁) (by positivity)) (mul_le_mul hcoeff.2.1 hr₂ (abs_nonneg r₂) (by positivity)) _ = 4 * M * η := by ring have hynum : |a * r₂ - c * r₁| ≤ 4 * M * η := by calc |a * r₂ - c * r₁| ≤ |a * r₂| + |c * r₁| := abs_sub _ _ _ = |a| * |r₂| + |c| * |r₁| := by simp only [abs_mul] _ ≤ (2 * M) * η + (2 * M) * η := by exact add_le_add (mul_le_mul hcoeff.1 hr₂ (abs_nonneg r₂) (by positivity)) (mul_le_mul hcoeff.2.2.1 hr₁ (abs_nonneg r₁) (by positivity)) _ = 4 * M * η := by ring have hxmul : δ * |x| ≤ 4 * M * η := by calc δ * |x| ≤ |a * d - c * b| * |x| := by gcongr _ = |d * r₁ - b * r₂| := by rw [← abs_mul, hxid] _ ≤ 4 * M * η := hxnum have hymul : δ * |y| ≤ 4 * M * η := by calc δ * |y| ≤ |a * d - c * b| * |y| := by gcongr _ = |a * r₂ - c * r₁| := by rw [← abs_mul, hyid] _ ≤ 4 * M * η := hynum constructor <;> unfold pairwiseSolveFactor <;> rw [div_mul_eq_mul_div] <;> apply (le_div_iff₀ hδ).2 <;> nlinarith [mul_nonneg hM hη]
    Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.pair_cramer_control · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/PairwiseControl.lean:78
  • selectedTriple_offDiagonal_control theorem — For distinct selected coordinates, nonnegative scale and residual parameters with a positive affine margin, an exact invertible reference, an off-diagonally approximate candidate, bounded shifts, and one selected triple whose affine determinant separates the coordinates, both off-diagonal transition errors for that coordinate pair are bounded by the selected triple's affine-system estimate.
    p :
    E :
    Type*
    Nonempty E
    A :
    E → SqMatrix p
    s :
    E → Fin p → ℝ
    B₀ B :
    M δ ε :
    i j :
    Fin p
    hij :
    i ≠ j
    e₀ e₁ e₂ :
    E
    hM :
    0 ≤ M
    :
    0 < δ
    :
    0 ≤ ε
    hscale :
    hdet :
    δ ≤ |pairAffineDet s i j e₀ e₁ e₂|
    hunit :
    IsUnit B₀.det
    hexact :
    R :
    η :
    2 * M * entryL2 R ^ 2 + 2 * ε
    |R i j| ≤ pairwiseSolveFactor M δ * η
    |R j i| ≤ pairwiseSolveFactor M δ * η
    Proof (Lean source)
    -- Proof route: put `Q = B B₀⁻¹ = I+R`. Subtract the congruence equations at `e₀` -- from those at `e₁,e₂`. The `(i,j)` entries give a 2×2 system in `R i j` and -- `R j i`; `coordinateProductRemainder_le` bounds its nonlinear terms and the two -- off-diagonal residuals contribute `2ε`. Apply `pair_cramer_control`. theorem selectedTriple_offDiagonal_control {p : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix p) (s : E → Fin p → ℝ) (B₀ B : SqMatrix p) {M δ ε : ℝ} (i j : Fin p) (hij : i ≠ j) (e₀ e₁ e₂ : E) (hM : 0 ≤ M) (hδ : 0 < δ) (hε : 0 ≤ ε) (hscale : ShiftScaleBound s M) (hdet : δ ≤ |pairAffineDet s i j e₀ e₁ e₂|) (hunit : IsUnit B₀.det) (hexact : ExactCongruence A s B₀) (happrox : OffDiagonalApproximateCongruence A B ε) : let R := transitionError B₀ B let η := 2 * M * entryL2 R ^ 2 + 2 * ε |R i j| ≤ pairwiseSolveFactor M δ * η ∧ |R j i| ≤ pairwiseSolveFactor M δ * η := by classical dsimp only let Q := transition B₀ B let R := transitionError B₀ B have hQR : Q = 1 + R := by ext u v simp [Q, R, transitionError, Matrix.sub_apply] have hformula (e : E) : (B * A e * B.transpose) i j = R i j * s e j + R j i * s e i + ∑ k, R i k * R j k * s e k := by rw [← transition_diagonal_congruence A s B₀ B hunit hexact e] have hentry : (Q * diagonal (s e) * Q.transpose) i j = ∑ k, Q i k * s e k * Q j k := by simp [Matrix.mul_apply, Matrix.diagonal_apply] change (Q * diagonal (s e) * Q.transpose) i j = _ rw [hentry, hQR] simp only [Matrix.add_apply, Matrix.one_apply] ring_nf repeat rw [Finset.sum_add_distrib] simp only [ite_mul, one_mul, zero_mul, mul_ite, mul_one, mul_zero, Finset.sum_ite_eq, Finset.mem_univ, ↓reduceIte] rw [if_neg hij] have hsum : (∑ k, R i k * s e k * R j k) = ∑ k, R i k * R j k * s e k := by apply Finset.sum_congr rfl intro k hk ring rw [hsum] ring have hlinear (e' e : E) : (s e' j - s e j) * R i j + (s e' i - s e i) * R j i = ((B * A e' * B.transpose) i j - (B * A e * B.transpose) i j) - ∑ k, R i k * R j k * (s e' k - s e k) := by rw [hformula e', hformula e] simp_rw [mul_sub] rw [Finset.sum_sub_distrib] ring let a := s e₁ j - s e₀ j let b := s e₁ i - s e₀ i let c := s e₂ j - s e₀ j let d := s e₂ i - s e₀ i let r₁ := ((B * A e₁ * B.transpose) i j - (B * A e₀ * B.transpose) i j) - ∑ k, R i k * R j k * (s e₁ k - s e₀ k) let r₂ := ((B * A e₂ * B.transpose) i j - (B * A e₀ * B.transpose) i j) - ∑ k, R i k * R j k * (s e₂ k - s e₀ k) have heq₁ : a * R i j + b * R j i = r₁ := by simpa [a, b, r₁] using hlinear e₁ e₀ have heq₂ : c * R i j + d * R j i = r₂ := by simpa [c, d, r₂] using hlinear e₂ e₀ have hcoeff : |a| ≤ 2 * M ∧ |b| ≤ 2 * M ∧ |c| ≤ 2 * M ∧ |d| ≤ 2 * M := by have hdiff (e' e : E) (k : Fin p) : |s e' k - s e k| ≤ 2 * M := by calc |s e' k - s e k| ≤ |s e' k| + |s e k| := abs_sub _ _ _ ≤ M + M := add_le_add (hscale _ _) (hscale _ _) _ = 2 * M := by ring exact ⟨hdiff e₁ e₀ j, hdiff e₁ e₀ i, hdiff e₂ e₀ j, hdiff e₂ e₀ i⟩ have hdet' : δ ≤ |a * d - c * b| := by have heqdet : a * d - c * b = -pairAffineDet s i j e₀ e₁ e₂ := by simp [a, b, c, d, pairAffineDet] ring rw [heqdet, abs_neg] exact hdet have houtput (e' e : E) : |(B * A e' * B.transpose) i j - (B * A e * B.transpose) i j| ≤ 2 * ε := by calc |_ - _| ≤ |(B * A e' * B.transpose) i j| + |(B * A e * B.transpose) i j| := abs_sub _ _ _ ≤ ε + ε := add_le_add (happrox e' i j hij) (happrox e i j hij) _ = 2 * ε := by ring have hr₁ : |r₁| ≤ 2 * M * entryL2 R ^ 2 + 2 * ε := by dsimp [r₁] calc |_ - _| ≤ |(B * A e₁ * B.transpose) i j - (B * A e₀ * B.transpose) i j| + |∑ k, R i k * R j k * (s e₁ k - s e₀ k)| := abs_sub _ _ _ ≤ 2 * ε + 2 * M * entryL2 R ^ 2 := add_le_add (houtput e₁ e₀) (coordinateProductRemainder_le s R hM hscale e₁ e₀ i j) _ = 2 * M * entryL2 R ^ 2 + 2 * ε := by ring have hr₂ : |r₂| ≤ 2 * M * entryL2 R ^ 2 + 2 * ε := by dsimp [r₂] calc |_ - _| ≤ |(B * A e₂ * B.transpose) i j - (B * A e₀ * B.transpose) i j| + |∑ k, R i k * R j k * (s e₂ k - s e₀ k)| := abs_sub _ _ _ ≤ 2 * ε + 2 * M * entryL2 R ^ 2 := add_le_add (houtput e₂ e₀) (coordinateProductRemainder_le s R hM hscale e₂ e₀ i j) _ = 2 * M * entryL2 R ^ 2 + 2 * ε := by ring have hη : 0 ≤ 2 * M * entryL2 R ^ 2 + 2 * ε := by positivity change |R i j| ≤ _ ∧ |R j i| ≤ _ exact pair_cramer_control hM hδ hη hcoeff hdet' heq₁ heq₂ hr₁ hr₂
    Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.selectedTriple_offDiagonal_control · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/PairwiseControl.lean:129
  • diagonalBranch_control theorem — For an invertible reference, unit-diagonal reference and candidate matrices, a nonnegative entry bound, and an off-diagonal transition-entry bound, each diagonal transition error is controlled by the same row's off-diagonal entries and the corresponding reference column.
    p :
    B₀ B :
    c :
    hunit :
    IsUnit B₀.det
    hdiag₀ :
    hdiag :
    hc :
    0 ≤ c
    hoff :
    ∀ i j
    if
    i ≠ j
    then
    |transitionError B₀ B i j| ≤ c
    i :
    |transitionError B₀ B i i| ^ 2
    ≤ ‖B₀‖ ^ 2 * ∑ k ∈ (Finset.univ.erase i), |transitionError B₀ B i k| ^ 2
    Proof (Lean source)
    -- Proof route: `B = (I+R)B₀`; comparing diagonal entries gives -- `R i i = -∑_{k≠i} R i k B₀ k i`, then apply Cauchy--Schwarz. theorem diagonalBranch_control {p : ℕ} (B₀ B : SqMatrix p) {c : ℝ} (hunit : IsUnit B₀.det) (hdiag₀ : UnitDiagonal B₀) (hdiag : UnitDiagonal B) (hc : 0 ≤ c) (hoff : ∀ i j, i ≠ j → |transitionError B₀ B i j| ≤ c) : ∀ i, |transitionError B₀ B i i| ^ 2 ≤ ‖B₀‖ ^ 2 * ∑ k ∈ (Finset.univ.erase i), |transitionError B₀ B i k| ^ 2 := by classical let R := transitionError B₀ B have hRB : R * B₀ = B - B₀ := by dsimp [R, transitionError, transition] rw [Matrix.sub_mul, Matrix.one_mul] simpa only [Matrix.mul_assoc] using congrArg (fun X : SqMatrix p => X - B₀) (Matrix.nonsing_inv_mul_cancel_right B₀ B hunit) intro i have hentry := congrArg (fun X : SqMatrix p => X i i) hRB simp only [Matrix.mul_apply, Matrix.sub_apply, hdiag i, hdiag₀ i, sub_self] at hentry have hsplit := Finset.sum_erase_add (Finset.univ : Finset (Fin p)) (fun k => R i k * B₀ k i) (Finset.mem_univ i) have heq : R i i = -∑ k ∈ Finset.univ.erase i, R i k * B₀ k i := by rw [← hsplit, hdiag₀ i, mul_one] at hentry linarith have hcolumn : ∑ k ∈ Finset.univ.erase i, |B₀ k i| ^ 2 ≤ ‖B₀‖ ^ 2 := by let e : EuclideanSpace ℝ (Fin p) := toLp 2 (single i 1) have he : ‖e‖ = 1 := by simp [e] have hmul := Matrix.l2_opNorm_mulVec B₀ e rw [he, mul_one] at hmul have hfull : ∑ k, |B₀ k i| ^ 2 ≤ ‖B₀‖ ^ 2 := by have hsquare := (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr hmul rw [EuclideanSpace.norm_sq_eq] at hsquare simpa [e, mulVec, dotProduct, sq_abs] using hsquare exact (Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) (fun _ _ _ => sq_nonneg _)).trans hfull change |R i i| ^ 2 ≤ ‖B₀‖ ^ 2 * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 rw [heq, abs_neg, sq_abs] calc (∑ k ∈ Finset.univ.erase i, R i k * B₀ k i) ^ 2 ≤ (∑ k ∈ Finset.univ.erase i, (R i k) ^ 2) * ∑ k ∈ Finset.univ.erase i, (B₀ k i) ^ 2 := Finset.sum_mul_sq_le_sq_mul_sq _ _ _ _ = (∑ k ∈ Finset.univ.erase i, |R i k| ^ 2) * ∑ k ∈ Finset.univ.erase i, |B₀ k i| ^ 2 := by simp only [sq_abs] _ ≤ (∑ k ∈ Finset.univ.erase i, |R i k| ^ 2) * ‖B₀‖ ^ 2 := by exact mul_le_mul_of_nonneg_left hcolumn (sum_nonneg fun _ _ => sq_nonneg _) _ = ‖B₀‖ ^ 2 * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by ring
    Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.diagonalBranch_control · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/PairwiseControl.lean:268
  • entryL2_transitionError_le theorem — For positive dimension and nonnegative matrix and entry bounds, an invertible unit-diagonal reference and a unit-diagonal candidate, a reference norm bound, and a common off-diagonal transition-entry bound, the full transition error's entrywise L² size is bounded by the ordered-pair aggregation factor.
    p :
    B₀ B :
    L c :
    hp :
    0 < p
    hL :
    0 ≤ L
    hc :
    0 ≤ c
    hunit :
    IsUnit B₀.det
    hdiag₀ :
    hdiag :
    hB₀ :
    ‖B₀‖ ≤ L
    hoff :
    ∀ i j
    if
    i ≠ j
    then
    |transitionError B₀ B i j| ≤ c
    entryL2 (transitionError B₀ B) ≤ c * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2))
    Proof (Lean source)
    theorem entryL2_transitionError_le {p : ℕ} (B₀ B : SqMatrix p) {L c : ℝ} (hp : 0 < p) (hL : 0 ≤ L) (hc : 0 ≤ c) (hunit : IsUnit B₀.det) (hdiag₀ : UnitDiagonal B₀) (hdiag : UnitDiagonal B) (hB₀ : ‖B₀‖ ≤ L) (hoff : ∀ i j, i ≠ j → |transitionError B₀ B i j| ≤ c) : entryL2 (transitionError B₀ B) ≤ c * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2)) := by classical let R := transitionError B₀ B have hdiagControl := diagonalBranch_control B₀ B hunit hdiag₀ hdiag hc hoff have hnormsq : ‖B₀‖ ^ 2 ≤ L ^ 2 := (sq_le_sq₀ (norm_nonneg _) hL).mpr hB₀ have hoffSq (i k : Fin p) (hik : i ≠ k) : |R i k| ^ 2 ≤ c ^ 2 := by exact (sq_le_sq₀ (abs_nonneg _) hc).mpr (by simpa [R] using hoff i k hik) have herase (i : Fin p) : ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 ≤ (p - 1 : ℕ) * c ^ 2 := by calc ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 ≤ (Finset.univ.erase i).card • c ^ 2 := Finset.sum_le_card_nsmul _ _ _ (fun k hk => hoffSq i k (by simpa [ne_comm] using (Finset.mem_erase.mp hk).1)) _ = (p - 1 : ℕ) * c ^ 2 := by rw [Finset.card_erase_of_mem (Finset.mem_univ i), Finset.card_univ, Fintype.card_fin] norm_num have hrow (i : Fin p) : ∑ k, |R i k| ^ 2 ≤ (1 + L ^ 2) * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by have hsplit := Finset.sum_erase_add (Finset.univ : Finset (Fin p)) (fun k => |R i k| ^ 2) (Finset.mem_univ i) rw [← hsplit] calc (∑ k ∈ Finset.univ.erase i, |R i k| ^ 2) + |R i i| ^ 2 ≤ (∑ k ∈ Finset.univ.erase i, |R i k| ^ 2) + ‖B₀‖ ^ 2 * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by gcongr simpa [R] using hdiagControl i _ ≤ (∑ k ∈ Finset.univ.erase i, |R i k| ^ 2) + L ^ 2 * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by gcongr _ = (1 + L ^ 2) * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by ring have hsum : ∑ i, ∑ k, |R i k| ^ 2 ≤ (p : ℝ) * (p - 1 : ℕ) * c ^ 2 * (1 + L ^ 2) := by calc ∑ i, ∑ k, |R i k| ^ 2 ≤ ∑ i, (1 + L ^ 2) * ∑ k ∈ Finset.univ.erase i, |R i k| ^ 2 := by gcongr with i exact hrow i _ ≤ ∑ _i : Fin p, (1 + L ^ 2) * ((p - 1 : ℕ) * c ^ 2) := by gcongr with i exact herase i _ = (p : ℝ) * (p - 1 : ℕ) * c ^ 2 * (1 + L ^ 2) := by simp [Finset.card_univ, Fintype.card_fin] ring rw [entryL2_eq_sqrt, Real.sqrt_le_iff] constructor · positivity · calc ∑ i, ∑ j, |R i j| ^ 2 ≤ (p : ℝ) * (p - 1 : ℕ) * c ^ 2 * (1 + L ^ 2) := hsum _ = (c * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + L ^ 2))) ^ 2 := by rw [mul_pow, Real.sq_sqrt] · ring · positivity
    Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine.entryL2_transitionError_le · Causalean/Discovery/LinearDisentanglement/Quantitative/PairwiseAffine/PairwiseControl.lean:325
Stability 1 core · 4 supporting This module aggregates the pair-dependent two-coordinate estimates, uses an explicit small-residual threshold and ordinary local neighborhood to select the identity branch, converts entrywise L² control to Euclidean oper ★ opNorm_sub_le_condition_specialization

Local operator-norm stability from pairwise affine separation

This module aggregates the pair-dependent two-coordinate estimates, uses an explicit small-residual threshold and ordinary local neighborhood to select the identity branch, converts entrywise L² control to Euclidean operator norm, and specializes the result to a determinant/condition-number envelope.

theorem opNorm_sub_le_condition_specialization reviewed
Causalean.Discovery.LinearDisentanglement.Quantitative.PairwiseAffine

Under positive dimension, positive shift scale and pairwise margin, condition envelope at least one, bounded pairwise-separated shifts, exact and approximate unit-diagonal feasibility, a nonnegative residual tolerance, the determinant/condition envelope of the reference, and the explicit residual threshold and ordinary local reference neighborhood, the operator error is bounded by the requested displayed constant with L = ((p!) κ^(p-1))^(1/p).

Formal statement
p :
E :
Type*
Nonempty E
A :
E → SqMatrix p
s :
E → Fin p → ℝ
B₀ B :
M γ κ ε :
hp :
0 < p
hM :
0 < M
:
0 < γ
:
1 ≤ κ
hscale :
hdiag₀ :
hdiag :
hcond :
hexact :
:
0 ≤ ε
hsmall :
hlocal :
‖B - B₀‖
≤ 16 * (6 * M / γ) * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + conditionRoot p κ ^ 2)) * conditionRoot p κ ^ 3 * ε
Proof (Lean source)
theorem opNorm_sub_le_condition_specialization {p : ℕ} {E : Type*} [Fintype E] [Nonempty E] (A : E → SqMatrix p) (s : E → Fin p → ℝ) (B₀ B : SqMatrix p) {M γ κ ε : ℝ} (hp : 0 < p) (hM : 0 < M) (hγ : 0 < γ) (hκ : 1 ≤ κ) (hscale : ShiftScaleBound s M) (hsep : PairwiseAffineSeparated s γ) (hdiag₀ : UnitDiagonal B₀) (hdiag : UnitDiagonal B) (hcond : DetConditionEnvelope κ B₀) (hexact : ExactCongruence A s B₀) (hε : 0 ≤ ε) (happrox : OffDiagonalApproximateCongruence A B ε) (hsmall : ε ≤ pairwiseResidualRadius p M γ (conditionRoot p κ)) (hlocal : InReferenceNeighborhood (pairwiseLocalRadius p M γ (conditionRoot p κ) κ) B₀ B) : ‖B - B₀‖ ≤ 16 * (6 * M / γ) * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + conditionRoot p κ ^ 2)) * conditionRoot p κ ^ 3 * ε := by have hL : 1 ≤ conditionRoot p κ := one_le_conditionRoot hp hκ have hB₀ : ‖B₀‖ ≤ conditionRoot p κ := opNorm_le_conditionRoot B₀ hp hκ hcond have hinv : ‖B₀⁻¹‖ ≤ κ := invOpNorm_le_conditionEnvelope B₀ hp hdiag₀ hcond have hJ : 0 < κ := lt_of_lt_of_le zero_lt_one hκ have h := opNorm_sub_le_of_pairwise_affine (J := κ) A s B₀ B hp hM hγ hL hJ hscale hsep hcond.1 hexact hdiag₀ hdiag hB₀ hinv hε hsmall happrox hlocal calc ‖B - B₀‖ ≤ pairwiseStabilityConstant p M γ (conditionRoot p κ) * ε := h _ = 16 * (6 * M / γ) * sqrt ((p : ℝ) * (p - 1 : ℕ) * (1 + conditionRoot p κ ^ 2)) * conditionRoot p κ ^ 3 * ε := by unfold pairwiseStabilityConstant pairwiseAggregateFactor pairwiseSolveFactor ring
4 supporting declarations (lemmas, instances)