Download data/lean/OAI/Combinatorics/GotsmanLinial/CubeOperators.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.79 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/CubeOperators.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GotsmanLinial/CubeOperators.lean
-
curl -L -o CubeOperators.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/CubeOperators.lean
4.79 kB
| import OAI.Combinatorics.GotsmanLinial.CoordinateMultipliers | |
| import OAI.Combinatorics.GotsmanLinial.HilbertSchmidt | |
| import Mathlib.InformationTheory.Hamming | |
| import Mathlib.Tactic | |
| namespace OAI | |
| /-! | |
| # Coordinate commutators and Hamming-distance energy | |
| The coordinate sign matrices are the actual diagonal operators of the Boolean | |
| cube. The identities here turn their Hilbert--Schmidt and entry estimates into | |
| the energy estimates used by the edge-recovery argument. | |
| -/ | |
| open scoped BigOperators | |
| namespace LeanBlast.GotsmanLinial | |
| variable {n : β} | |
| /-- In the point basis, a coordinate commutator records the difference of the | |
| two endpoint signs. -/ | |
| theorem coordinate_commutator_apply | |
| (M : Matrix (Cube n) (Cube n) β) (i : Fin n) (x y : Cube n) : | |
| (M * coordinateSignMatrix i - coordinateSignMatrix i * M) x y = | |
| (((cubeCoord y i - cubeCoord x i : β) : β)) * M x y := by | |
| simp only [coordinateSignMatrix, signMatrix, Matrix.sub_apply, | |
| Matrix.mul_diagonal, Matrix.diagonal_mul, Complex.ofReal_sub] | |
| ring | |
| /-- Squaring a coordinate difference gives four exactly on the coordinates | |
| where the Boolean endpoints differ. -/ | |
| theorem coordinate_commutator_sq_norm | |
| (M : Matrix (Cube n) (Cube n) β) (i : Fin n) (x y : Cube n) : | |
| β(M * coordinateSignMatrix i - coordinateSignMatrix i * M) x yβ ^ 2 = | |
| (if x i β y i then (4 : β) else 0) * βM x yβ ^ 2 := by | |
| rw [coordinate_commutator_apply, norm_mul, mul_pow] | |
| congr 1 | |
| cases hx : x i <;> cases hy : y i <;> norm_num [cubeCoord, hx, hy] | |
| /-- Summing the squared entries over coordinates counts Hamming distance. -/ | |
| theorem sum_coordinate_commutator_sq_norm | |
| (M : Matrix (Cube n) (Cube n) β) (x y : Cube n) : | |
| (β i : Fin n, | |
| β(M * coordinateSignMatrix i - coordinateSignMatrix i * M) x yβ ^ 2) = | |
| 4 * (hammingDist x y : β) * βM x yβ ^ 2 := by | |
| classical | |
| simp_rw [coordinate_commutator_sq_norm, ite_mul, zero_mul] | |
| calc | |
| (β i : Fin n, if x i β y i then 4 * βM x yβ ^ 2 else 0) = | |
| β i β Finset.univ.filter (fun i => x i β y i), 4 * βM x yβ ^ 2 := by | |
| rw [Finset.sum_filter] | |
| _ = (hammingDist x y : β) * (4 * βM x yβ ^ 2) := by | |
| simp [hammingDist, nsmul_eq_mul] | |
| _ = 4 * (hammingDist x y : β) * βM x yβ ^ 2 := by ring | |
| /-- The total coordinate-commutator energy is four times the distance-weighted | |
| entry energy. -/ | |
| theorem sum_hsNormSq_coordinate_commutator | |
| (M : Matrix (Cube n) (Cube n) β) : | |
| (β i : Fin n, hsNormSq (M * coordinateSignMatrix i - coordinateSignMatrix i * M)) = | |
| 4 * β x : Cube n, β y : Cube n, (hammingDist x y : β) * βM x yβ ^ 2 := by | |
| classical | |
| simp only [hsNormSq] | |
| calc | |
| (β i : Fin n, β x : Cube n, β y : Cube n, | |
| β(M * coordinateSignMatrix i - coordinateSignMatrix i * M) x yβ ^ 2) = | |
| β x : Cube n, β y : Cube n, β i : Fin n, | |
| β(M * coordinateSignMatrix i - coordinateSignMatrix i * M) x yβ ^ 2 := by | |
| rw [Finset.sum_comm] | |
| exact Finset.sum_congr rfl fun _ _ => Finset.sum_comm | |
| _ = β x : Cube n, β y : Cube n, | |
| 4 * (hammingDist x y : β) * βM x yβ ^ 2 := by | |
| simp_rw [sum_coordinate_commutator_sq_norm] | |
| _ = 4 * β x : Cube n, β y : Cube n, | |
| (hammingDist x y : β) * βM x yβ ^ 2 := by | |
| simp only [Finset.mul_sum, mul_assoc] | |
| /-- A uniform coordinate-commutator Hilbert--Schmidt bound gives the distance | |
| energy inequality for the actual cube matrix. -/ | |
| theorem distance_energy_le_of_coordinate_commutator_bound | |
| (M : Matrix (Cube n) (Cube n) β) | |
| (hbound : β i : Fin n, | |
| hsNormSq (M * coordinateSignMatrix i - coordinateSignMatrix i * M) β€ (2 : β) ^ n) : | |
| (β x : Cube n, β y : Cube n, (hammingDist x y : β) * βM x yβ ^ 2) β€ | |
| (n : β) * (2 : β) ^ n / 4 := by | |
| have h := Finset.sum_le_sum (fun i (_ : i β (Finset.univ : Finset (Fin n))) => hbound i) | |
| rw [sum_hsNormSq_coordinate_commutator] at h | |
| simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at h | |
| linarith | |
| /-- A coordinate at which distinct endpoints differ turns an entrywise | |
| commutator estimate into the edge-entry cap `1/4`. -/ | |
| theorem off_diagonal_sq_norm_le_quarter_of_commutator_bound | |
| (M : Matrix (Cube n) (Cube n) β) | |
| (hbound : β (i : Fin n) (x y : Cube n), | |
| β(M * coordinateSignMatrix i - coordinateSignMatrix i * M) x yβ ^ 2 β€ 1) | |
| (x y : Cube n) (hxy : x β y) : βM x yβ ^ 2 β€ (1 : β) / 4 := by | |
| classical | |
| obtain β¨i, hiβ© : β i : Fin n, x i β y i := by | |
| by_contra h | |
| apply hxy | |
| funext i | |
| exact not_not.mp (not_exists.mp h i) | |
| have h := hbound i x y | |
| rw [coordinate_commutator_sq_norm, ite_eq_left hi] at h | |
| linarith | |
| end LeanBlast.GotsmanLinial | |
| end OAI | |