Download data/lean/OAI/Combinatorics/GotsmanLinial/BlockCoupling.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 11 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/BlockCoupling.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GotsmanLinial/BlockCoupling.lean
-
curl -L -o BlockCoupling.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/BlockCoupling.lean
11 kB
| import OAI.Combinatorics.GotsmanLinial.BinomialMoments | |
| import OAI.Combinatorics.GotsmanLinial.FiniteCoupling | |
| import OAI.Combinatorics.GotsmanLinial.ProjectionBlocks | |
| import Mathlib.Data.Fintype.BigOperators | |
| namespace OAI | |
| /-! | |
| # The finite block coupling | |
| Normalize a nonnegative matrix of block masses, identify its two binomial | |
| marginals, and reflect its first index. The low-degree block vanishing gives | |
| the one-sided displacement bound required by the finite coupling lemma. | |
| -/ | |
| open scoped BigOperators | |
| namespace LeanBlast.GotsmanLinial | |
| /-- Normalize finite two-index masses by their total mass. -/ | |
| noncomputable def normalizedPairWeight {Ξ± Ξ² : Type*} | |
| (B : Ξ± β Ξ² β β) (Z : β) (t : Ξ± Γ Ξ²) : β := | |
| B t.1 t.2 / Z | |
| theorem normalizedPairWeight_nonneg {Ξ± Ξ² : Type*} | |
| (B : Ξ± β Ξ² β β) (Z : β) (hB : β r s, 0 β€ B r s) (hZ : 0 β€ Z) | |
| (t : Ξ± Γ Ξ²) : 0 β€ normalizedPairWeight B Z t := | |
| div_nonneg (hB t.1 t.2) hZ | |
| theorem normalizedPairWeight_row {Ξ± Ξ² : Type*} [Fintype Ξ²] | |
| (B : Ξ± β Ξ² β β) (Z : β) (r : Ξ±) : | |
| (β s : Ξ², normalizedPairWeight B Z (r, s)) = (β s : Ξ², B r s) / Z := by | |
| simp only [normalizedPairWeight, β Finset.sum_div] | |
| theorem normalizedPairWeight_column {Ξ± Ξ² : Type*} [Fintype Ξ±] | |
| (B : Ξ± β Ξ² β β) (Z : β) (s : Ξ²) : | |
| (β r : Ξ±, normalizedPairWeight B Z (r, s)) = (β r : Ξ±, B r s) / Z := by | |
| simp only [normalizedPairWeight, β Finset.sum_div] | |
| /-- First-coordinate expectations are computed from the row sums. -/ | |
| theorem normalizedPairWeight_expect_fst {Ξ± Ξ² : Type*} [Fintype Ξ±] [Fintype Ξ²] | |
| (B : Ξ± β Ξ² β β) (Z : β) (Ο : Ξ± β β) : | |
| (β t : Ξ± Γ Ξ², normalizedPairWeight B Z t * Ο t.1) = | |
| β r : Ξ±, ((β s : Ξ², B r s) / Z) * Ο r := by | |
| rw [Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro r _ | |
| simp only [normalizedPairWeight] | |
| rw [β Finset.sum_mul, β Finset.sum_div] | |
| /-- Second-coordinate expectations are computed from the column sums. -/ | |
| theorem normalizedPairWeight_expect_snd {Ξ± Ξ² : Type*} [Fintype Ξ±] [Fintype Ξ²] | |
| (B : Ξ± β Ξ² β β) (Z : β) (Ο : Ξ² β β) : | |
| (β t : Ξ± Γ Ξ², normalizedPairWeight B Z t * Ο t.2) = | |
| β s : Ξ², ((β r : Ξ±, B r s) / Z) * Ο s := by | |
| rw [Fintype.sum_prod_type_right] | |
| apply Finset.sum_congr rfl | |
| intro s _ | |
| simp only [normalizedPairWeight] | |
| rw [β Finset.sum_mul, β Finset.sum_div] | |
| /-- Finite masses with binomial row and column sums, supported above the | |
| anti-diagonal `r+s=n-d`, have the required centered quadratic bound. -/ | |
| theorem binomial_block_coupling_bound | |
| (n d : β) (B : Fin (n + 1) β Fin (n + 1) β β) | |
| (hB : β r s, 0 β€ B r s) | |
| (hrow : β r, (β s : Fin (n + 1), B r s) = (n.choose r.val : β)) | |
| (hcol : β s, (β r : Fin (n + 1), B r s) = (n.choose s.val : β)) | |
| (hvanish : β r s, r.val + s.val < n - d β B r s = 0) : | |
| (β r : Fin (n + 1), β s : Fin (n + 1), | |
| ((s.val : β) + (r.val : β) - (n : β)) ^ 2 * B r s) β€ | |
| 4 * (d : β) * Real.sqrt (n : β) * (2 : β) ^ n := by | |
| let w : Fin (n + 1) Γ Fin (n + 1) β β := | |
| normalizedPairWeight B ((2 : β) ^ n) | |
| let U : Fin (n + 1) Γ Fin (n + 1) β β := fun t => (t.2.val : β) | |
| let V : Fin (n + 1) Γ Fin (n + 1) β β := | |
| fun t => (n : β) - (t.1.val : β) | |
| have hU (Ο : β β β) : | |
| (β t : Fin (n + 1) Γ Fin (n + 1), w t * Ο (U t)) = | |
| β s : Fin (n + 1), binomialWeight n s * Ο (s.val : β) := by | |
| simpa only [w, U, hcol, binomialWeight] using | |
| normalizedPairWeight_expect_snd B ((2 : β) ^ n) | |
| (fun s => Ο (s.val : β)) | |
| have hV (Ο : β β β) : | |
| (β t : Fin (n + 1) Γ Fin (n + 1), w t * Ο (V t)) = | |
| β r : Fin (n + 1), | |
| binomialWeight n r * Ο ((n : β) - (r.val : β)) := by | |
| simpa only [w, V, hrow, binomialWeight] using | |
| normalizedPairWeight_expect_fst B ((2 : β) ^ n) | |
| (fun r => Ο ((n : β) - (r.val : β))) | |
| have hw : β t, 0 β€ w t := | |
| normalizedPairWeight_nonneg B _ hB (binomialDenominator_pos n).le | |
| have hprob : (β t, w t) = 1 := by | |
| have h := hU (fun _ => 1) | |
| simpa only [mul_one, sum_binomialWeight] using h | |
| have hsame : β Ο : β β β, | |
| (β t, w t * Ο (U t)) = β t, w t * Ο (V t) := by | |
| intro Ο | |
| rw [hU, hV, binomialWeight_reflect] | |
| have hvariance : | |
| (β t, w t * (U t - (n : β) / 2) ^ 2) = | |
| (Real.sqrt (n : β) / 2) ^ 2 := by | |
| rw [hU (fun z => (z - (n : β) / 2) ^ 2)] | |
| rw [binomialWeight_variance, binomialSigma_sq] | |
| have hstep : β t, w t β 0 β V t - U t β€ (d : β) := by | |
| rintro β¨r, sβ© ht | |
| have hnonzero : B r s β 0 := by | |
| intro hz | |
| exact ht (by simp only [w, normalizedPairWeight, hz, zero_div]) | |
| have hnat : n - d β€ r.val + s.val := | |
| Nat.le_of_not_gt (fun hlt => hnonzero (hvanish r s hlt)) | |
| have hnat' : n β€ r.val + s.val + d := by omega | |
| have hreal : (n : β) β€ (r.val : β) + (s.val : β) + (d : β) := by | |
| exact_mod_cast hnat' | |
| dsimp only [U, V] | |
| linarith | |
| have hbound := finite_one_sided_coupling_bound w U V | |
| ((n : β) / 2) (Real.sqrt (n : β) / 2) (d : β) | |
| hw hprob hsame (binomialSigma_nonneg n) (Nat.cast_nonneg d) hvariance hstep | |
| calc | |
| _ = (2 : β) ^ n * (β t, w t * (U t - V t) ^ 2) := by | |
| rw [Fintype.sum_prod_type, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro r _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro s _ | |
| dsimp only [w, U, V, normalizedPairWeight] | |
| field_simp [binomialDenominator_ne_zero n] | |
| ring | |
| _ β€ (2 : β) ^ n * (8 * (d : β) * (Real.sqrt (n : β) / 2)) := | |
| mul_le_mul_of_nonneg_left hbound (binomialDenominator_pos n).le | |
| _ = 4 * (d : β) * Real.sqrt (n : β) * (2 : β) ^ n := by ring | |
| /-- The actual finite probability weights supplied by the Hilbert--Schmidt | |
| blocks of an operator in a binomial orthogonal grading. -/ | |
| noncomputable def blockCouplingWeight {n : β} {ΞΉ : Type*} [Fintype ΞΉ] | |
| (P : Fin (n + 1) β Matrix ΞΉ ΞΉ β) (H : Matrix ΞΉ ΞΉ β) | |
| (t : Fin (n + 1) Γ Fin (n + 1)) : β := | |
| normalizedPairWeight (fun r s => hsNormSq (P s * H * P r)) ((2 : β) ^ n) t | |
| theorem blockCouplingWeight_nonneg {n : β} {ΞΉ : Type*} [Fintype ΞΉ] | |
| (P : Fin (n + 1) β Matrix ΞΉ ΞΉ β) (H : Matrix ΞΉ ΞΉ β) | |
| (t : Fin (n + 1) Γ Fin (n + 1)) : 0 β€ blockCouplingWeight P H t := | |
| normalizedPairWeight_nonneg _ _ (fun _ _ => hsNormSq_nonneg _) | |
| (binomialDenominator_pos n).le t | |
| /-- The first block index has the binomial distribution. -/ | |
| theorem blockCouplingWeight_fst_marginal {n : β} {ΞΉ : Type*} | |
| [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| {P : Fin (n + 1) β Matrix ΞΉ ΞΉ β} (hP : OrthogonalProjectionFamily P) | |
| (H : Matrix ΞΉ ΞΉ β) (hH : H.conjTranspose * H = 1) | |
| (hmult : β k, hsNormSq (P k) = (n.choose k.val : β)) | |
| (r : Fin (n + 1)) : | |
| (β s : Fin (n + 1), blockCouplingWeight P H (r, s)) = binomialWeight n r := by | |
| unfold blockCouplingWeight | |
| rw [normalizedPairWeight_row, sum_hsNormSq_blocks_column hP H r hH, hmult] | |
| rfl | |
| /-- The second block index has the same binomial distribution. -/ | |
| theorem blockCouplingWeight_snd_marginal {n : β} {ΞΉ : Type*} | |
| [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| {P : Fin (n + 1) β Matrix ΞΉ ΞΉ β} (hP : OrthogonalProjectionFamily P) | |
| (H : Matrix ΞΉ ΞΉ β) (hH : H * H.conjTranspose = 1) | |
| (hmult : β k, hsNormSq (P k) = (n.choose k.val : β)) | |
| (s : Fin (n + 1)) : | |
| (β r : Fin (n + 1), blockCouplingWeight P H (r, s)) = binomialWeight n s := by | |
| unfold blockCouplingWeight | |
| rw [normalizedPairWeight_column, sum_hsNormSq_blocks_row hP H s hH, hmult] | |
| rfl | |
| /-- Unitarity and the grading multiplicities make the block weights a | |
| probability distribution without any additional normalization assumption. -/ | |
| theorem sum_blockCouplingWeight {n : β} {ΞΉ : Type*} | |
| [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| {P : Fin (n + 1) β Matrix ΞΉ ΞΉ β} (hP : OrthogonalProjectionFamily P) | |
| (H : Matrix ΞΉ ΞΉ β) (hH : H.conjTranspose * H = 1) | |
| (hmult : β k, hsNormSq (P k) = (n.choose k.val : β)) : | |
| (β t : Fin (n + 1) Γ Fin (n + 1), blockCouplingWeight P H t) = 1 := by | |
| rw [Fintype.sum_prod_type] | |
| simp_rw [blockCouplingWeight_fst_marginal hP H hH hmult] | |
| exact sum_binomialWeight n | |
| /-- A nonzero block probability lies on or above the required anti-diagonal. -/ | |
| theorem blockCouplingWeight_support {n d : β} {ΞΉ : Type*} [Fintype ΞΉ] | |
| (P : Fin (n + 1) β Matrix ΞΉ ΞΉ β) (H : Matrix ΞΉ ΞΉ β) | |
| (hvanish : β r s, r.val + s.val < n - d β P s * H * P r = 0) | |
| (r s : Fin (n + 1)) (ht : blockCouplingWeight P H (r, s) β 0) : | |
| n - d β€ r.val + s.val := by | |
| apply Nat.le_of_not_gt | |
| intro hlt | |
| apply ht | |
| simp only [blockCouplingWeight, normalizedPairWeight, hvanish r s hlt, | |
| hsNormSq_zero, zero_div] | |
| /-- The spectral block coupling bounds the actual centered grading | |
| anticommutator. Its hypotheses are the orthogonal grading, its binomial | |
| multiplicities, unitarity, and the separately proved low-degree vanishing. -/ | |
| theorem hsNormSq_centeredGrading_anticommutator_le {ΞΉ : Type*} | |
| [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| (n d : β) (P : Fin (n + 1) β Matrix ΞΉ ΞΉ β) | |
| (hP : OrthogonalProjectionFamily P) (H : Matrix ΞΉ ΞΉ β) | |
| (hleft : H.conjTranspose * H = 1) (hright : H * H.conjTranspose = 1) | |
| (hmult : β k, hsNormSq (P k) = (n.choose k.val : β)) | |
| (hvanish : β r s, r.val + s.val < n - d β P s * H * P r = 0) : | |
| hsNormSq (centeredGrading P * H + H * centeredGrading P) β€ | |
| 4 * (d : β) * Real.sqrt (n : β) * (2 : β) ^ n := by | |
| rw [hsNormSq_centered_anticommutator hP H] | |
| apply binomial_block_coupling_bound n d (fun r s => hsNormSq (P s * H * P r)) | |
| Β· intro r s | |
| exact hsNormSq_nonneg _ | |
| Β· intro r | |
| rw [sum_hsNormSq_blocks_column hP H r hleft, hmult] | |
| Β· intro s | |
| rw [sum_hsNormSq_blocks_row hP H s hright, hmult] | |
| Β· intro r s hrs | |
| rw [hvanish r s hrs, hsNormSq_zero] | |
| /-- Trace-multiplicity form, for direct use with finite-dimensional orthogonal | |
| projections whose ranks have already been computed. -/ | |
| theorem hsNormSq_centeredGrading_anticommutator_le_of_trace {ΞΉ : Type*} | |
| [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| (n d : β) (P : Fin (n + 1) β Matrix ΞΉ ΞΉ β) | |
| (hP : OrthogonalProjectionFamily P) (H : Matrix ΞΉ ΞΉ β) | |
| (hleft : H.conjTranspose * H = 1) (hright : H * H.conjTranspose = 1) | |
| (htrace : β k, (Matrix.trace (P k)).re = (n.choose k.val : β)) | |
| (hvanish : β r s, r.val + s.val < n - d β P s * H * P r = 0) : | |
| hsNormSq (centeredGrading P * H + H * centeredGrading P) β€ | |
| 4 * (d : β) * Real.sqrt (n : β) * (2 : β) ^ n := by | |
| apply hsNormSq_centeredGrading_anticommutator_le n d P hP H hleft hright _ hvanish | |
| intro k | |
| rw [hsNormSq_projection (P k) (hP.conjTranspose_eq k) (hP.idempotent k), htrace] | |
| end LeanBlast.GotsmanLinial | |
| end OAI | |