Download data/lean/OAI/Computability/UniqueGames/Inverse/AffineWitnessNormalizationLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.08 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Inverse/AffineWitnessNormalizationLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Inverse/AffineWitnessNormalizationLemmas.lean
-
curl -L -o AffineWitnessNormalizationLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Inverse/AffineWitnessNormalizationLemmas.lean
7.08 kB
| import Mathlib.Data.Fintype.Pi | |
| import Mathlib.Basic.Real.Basic | |
| import Mathlib.SetTheory.Cardinal.Finite | |
| import Mathlib.Tactic.Linarith | |
| import Mathlib.Tactic.NormNum | |
| import OAI.Computability.UniqueGames.Inverse.AffineWitnessLemmas | |
| namespace OAI | |
| section | |
| /-! | |
| The finite orbit count completing the first-bit witness normalization. | |
| The assumption in `normalize_of_good_count` is precisely that agreement is | |
| strictly greater than the reciprocal of the row-kernel cardinality, expressed | |
| without division. It is a quantitative goodness hypothesis, not an inverse | |
| theorem or a nonlinear rank premise. | |
| -/ | |
| namespace UniqueGamesTheorem.Inverse.AffineWitness | |
| variable {D C R : Type*} | |
| [AddCommGroup D] [Module F2 D] | |
| [AddCommGroup C] [Module F2 C] | |
| [AddCommGroup R] [Module F2 R] | |
| /-- The actual simultaneous row/column slice, including its affine offsets. -/ | |
| abbrev Slice (A : C ββ[F2] R) (Z : Submodule F2 D) (Mβ : D ββ[F2] C) := | |
| {M : D ββ[F2] C // InSlice A Z Mβ M} | |
| def sliceShift (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) | |
| (heZ : β w β Z, e w = 0) (h : A.ker) (M : Slice A Z Mβ) : | |
| Slice A Z Mβ := | |
| β¨shift e h M, shift_preserves_slice e A Z Mβ M heZ h M.propertyβ© | |
| theorem sliceShift_zero (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) | |
| (heZ : β w β Z, e w = 0) (M : Slice A Z Mβ) : | |
| sliceShift e A Z Mβ heZ 0 M = M := by | |
| apply Subtype.ext | |
| exact shift_zero e M.val | |
| theorem sliceShift_add (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) | |
| (heZ : β w β Z, e w = 0) (h k : A.ker) (M : Slice A Z Mβ) : | |
| sliceShift e A Z Mβ heZ (h + k) M = | |
| sliceShift e A Z Mβ heZ h (sliceShift e A Z Mβ heZ k M) := by | |
| apply Subtype.ext | |
| exact shift_add e (h : C) (k : C) M.val | |
| /-- If the affine coset misses first bit one, folding limits agreement to one | |
| point per row-kernel orbit. No rank-level inequality is used. -/ | |
| theorem agreement_count_le [Finite D] [Finite C] | |
| (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) (z : D) (u : C) | |
| (F : (D ββ[F2] C) β C) | |
| (hfold : β (h : A.ker) M, F (shift e h M) = F M + h) | |
| (hno : Β¬ β w β Z, e (z + w) = 1) : | |
| Nat.card A.ker * Nat.card {M : Slice A Z Mβ // F M = M.val z + u} β€ | |
| Nat.card (Slice A Z Mβ) := by | |
| classical | |
| let : Fintype D := Fintype.ofFinite D | |
| let : Fintype C := Fintype.ofFinite C | |
| let : Fintype (D ββ[F2] C) := Fintype.ofInjective DFunLike.coe DFunLike.coe_injective | |
| obtain β¨hz, heZβ© := no_affine_representative e Z z hno | |
| have hcount := folded_action_card_mul_agreement_le | |
| (sliceShift e A Z Mβ heZ) | |
| (sliceShift_zero e A Z Mβ heZ) | |
| (sliceShift_add e A Z Mβ heZ) | |
| (fun h : A.ker => (h : C)) Subtype.val_injective | |
| (fun M : Slice A Z Mβ => F M) | |
| (fun M : Slice A Z Mβ => M.val z + u) | |
| (fun h M => hfold h M) | |
| (fun h M => shift_preserves_target e z hz u h M) | |
| simpa only [Nat.card_eq_fintype_card] using hcount | |
| /-- A good affine witness has a first-bit-one representative with an adjusted | |
| intercept, agreeing with the original target on every matrix of its slice. -/ | |
| theorem normalize_of_good_count [Finite D] [Finite C] | |
| (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) (z : D) (u : C) | |
| (F : (D ββ[F2] C) β C) | |
| (hfold : β (h : A.ker) M, F (shift e h M) = F M + h) | |
| (hgood : Nat.card (Slice A Z Mβ) < | |
| Nat.card A.ker * Nat.card {M : Slice A Z Mβ // F M = M.val z + u}) : | |
| β z' : D, β u' : C, e z' = 1 β§ | |
| β M, InSlice A Z Mβ M β M z' + u' = M z + u := by | |
| apply normalize e A Z Mβ z u | |
| by_contra hno | |
| exact (not_lt_of_ge (agreement_count_le e A Z Mβ z u F hfold hno)) hgood | |
| end UniqueGamesTheorem.Inverse.AffineWitness | |
| end | |
| section | |
| /-! The probability form of first-bit witness normalization. -/ | |
| namespace UniqueGamesTheorem.Inverse.AffineWitness | |
| variable {D C R : Type*} | |
| [AddCommGroup D] [Module F2 D] | |
| [AddCommGroup C] [Module F2 C] | |
| [AddCommGroup R] [Module F2 R] | |
| /-- An agreement lower bound above the inverse row-kernel size produces a | |
| first-bit-one representative while preserving the entire affine target. -/ | |
| theorem normalize_of_density [Finite D] [Finite C] | |
| (e : D ββ[F2] F2) (A : C ββ[F2] R) | |
| (Z : Submodule F2 D) (Mβ : D ββ[F2] C) (z : D) (u : C) | |
| (F : (D ββ[F2] C) β C) | |
| (hfold : β (h : A.ker) M, F (shift e h M) = F M + h) | |
| (Ξ· : β) | |
| (hgood : Ξ· β€ | |
| (Nat.card {M : Slice A Z Mβ // F M = M.val z + u} : β) / | |
| (Nat.card (Slice A Z Mβ) : β)) | |
| (hsize : 1 < Ξ· * (Nat.card A.ker : β)) : | |
| β z' : D, β u' : C, e z' = 1 β§ | |
| β M, InSlice A Z Mβ M β M z' + u' = M z + u := by | |
| classical | |
| let : Fintype D := Fintype.ofFinite D | |
| let : Fintype C := Fintype.ofFinite C | |
| let : Fintype (D ββ[F2] C) := Fintype.ofInjective DFunLike.coe DFunLike.coe_injective | |
| let : Nonempty (Slice A Z Mβ) := β¨β¨Mβ, rfl, fun _ _ => rflβ©β© | |
| have hpos : (0 : β) < (Nat.card (Slice A Z Mβ) : β) := by | |
| exact_mod_cast Nat.card_pos (Ξ± := Slice A Z Mβ) | |
| have hmass := (le_div_iffβ hpos).mp hgood | |
| have hmul := mul_le_mul_of_nonneg_right hmass | |
| (Nat.cast_nonneg (Ξ± := β) (Nat.card A.ker)) | |
| have hstrict := mul_lt_mul_of_pos_right hsize hpos | |
| apply normalize_of_good_count e A Z Mβ z u F hfold | |
| have hreal : (Nat.card (Slice A Z Mβ) : β) < | |
| (Nat.card A.ker : β) * | |
| (Nat.card {M : Slice A Z Mβ // F M = M.val z + u} : β) := by | |
| nlinarith only [hmul, hstrict] | |
| exact_mod_cast hreal | |
| end UniqueGamesTheorem.Inverse.AffineWitness | |
| end | |
| section | |
| namespace UniqueGamesTheorem.Inverse.AffineWitness | |
| theorem first_bit_witness {m β r : β} | |
| (e : (Fin m β F2) ββ[F2] F2) | |
| (A : (Fin β β F2) ββ[F2] (Fin r β F2)) | |
| (Z : Submodule F2 (Fin m β F2)) | |
| (Mβ : (Fin m β F2) ββ[F2] (Fin β β F2)) | |
| (z : Fin m β F2) (u : Fin β β F2) | |
| (F : ((Fin m β F2) ββ[F2] (Fin β β F2)) β (Fin β β F2)) | |
| (hfold : β (h : A.ker) M, F (shift e h M) = F M + h) | |
| (Ξ± : β) (hΞ± : 0 < Ξ±) | |
| (hgood : Ξ± / 2 β€ | |
| (Nat.card {M : Slice A Z Mβ // F M = M.val z + u} : β) / | |
| (Nat.card (Slice A Z Mβ) : β)) | |
| (hsmall : 1 / (2 : β) ^ (β - r) < Ξ± / 8) : | |
| β z' : Fin m β F2, β u' : Fin β β F2, e z' = 1 β§ | |
| β M, InSlice A Z Mβ M β M z' + u' = M z + u := by | |
| have hpow : (0 : β) < 2 ^ (β - r) := pow_pos (by norm_num) _ | |
| have hsep := (div_lt_iffβ hpow).mp hsmall | |
| have hk : (2 : β) ^ (β - r) β€ (Nat.card A.ker : β) := by | |
| exact_mod_cast binary_kernel_card_lower A | |
| have hscale := mul_le_mul_of_nonneg_left hk hΞ±.le | |
| have hsize : 1 < (Ξ± / 2) * (Nat.card A.ker : β) := by | |
| nlinarith only [hsep, hscale] | |
| exact normalize_of_density e A Z Mβ z u F hfold (Ξ± / 2) hgood hsize | |
| end UniqueGamesTheorem.Inverse.AffineWitness | |
| end | |
| end OAI | |