Download data/lean/OAI/Computability/PerfectCompleteness/Algebra/MatrixRowQuotientLaw.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.94 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Algebra/MatrixRowQuotientLaw.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/PerfectCompleteness/Algebra/MatrixRowQuotientLaw.lean
-
curl -L -o MatrixRowQuotientLaw.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Algebra/MatrixRowQuotientLaw.lean
5.94 kB
| import Mathlib.Algebra.BigOperators.Expect | |
| import Mathlib.LinearAlgebra.Prod | |
| import OAI.Computability.PerfectCompleteness.Algebra.BilinearGramCompressionLemmas | |
| import OAI.Computability.PerfectCompleteness.Algebra.UniformLinearImage | |
| import OAI.Computability.UniqueGames.Games.FinishBoundsLemmas | |
| namespace OAI | |
| section | |
| namespace PerfectCompleteness.MatrixRowQuotientLaw | |
| noncomputable section | |
| open scoped BigOperators | |
| open UniqueGamesTheorem.Foundations.Games | |
| open MatrixRowQuotient | |
| variable {π H K : Type*} [Field π] | |
| [AddCommGroup H] [Module π H] [AddCommGroup K] [Module π K] | |
| def projectMatrixLinear (W : Submodule π H) : | |
| (Module.Dual π H ββ[π] K) ββ[π] (Module.Dual π (H β§Έ W) ββ[π] K) where | |
| toFun := projectMatrix W | |
| map_add' X Y := by | |
| apply LinearMap.ext | |
| intro q | |
| rfl | |
| map_smul' a X := by | |
| apply LinearMap.ext | |
| intro q | |
| rfl | |
| @[simp] theorem projectMatrixLinear_apply (W : Submodule π H) | |
| (X : Module.Dual π H ββ[π] K) : | |
| projectMatrixLinear W X = projectMatrix W X := rfl | |
| def jointProjection (W : Submodule π H) : | |
| ((Module.Dual π H ββ[π] K) Γ H) ββ[π] | |
| ((Module.Dual π (H β§Έ W) ββ[π] K) Γ (H β§Έ W)) := | |
| (projectMatrixLinear W).prodMap W.mkQ | |
| @[simp] theorem jointProjection_apply (W : Submodule π H) | |
| (p : (Module.Dual π H ββ[π] K) Γ H) : | |
| jointProjection W p = (projectMatrix W p.1, W.mkQ p.2) := rfl | |
| theorem jointProjection_surjective (W : Submodule π H) : | |
| Function.Surjective (jointProjection (K := K) W) := by | |
| rintro β¨X, hβ© | |
| obtain β¨Y, hYβ© := projectMatrix_surjective W X | |
| obtain β¨g, hgβ© := W.mkQ_surjective h | |
| exact β¨(Y, g), Prod.ext hY hgβ© | |
| theorem uniform_product {A B : Type*} [Fintype A] [Fintype B] | |
| [Nonempty A] [Nonempty B] : | |
| (FiniteDistribution.uniform A).product (FiniteDistribution.uniform B) = | |
| FiniteDistribution.uniform (A Γ B) := by | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro p | |
| change (1 / (Fintype.card A : β)) * (1 / (Fintype.card B : β)) = | |
| 1 / (Fintype.card (A Γ B) : β) | |
| simp only [Fintype.card_prod, Nat.cast_mul, one_div, mul_inv] | |
| variable (W : Submodule π H) | |
| [Fintype H] [Fintype (H β§Έ W)] | |
| [Fintype (Module.Dual π H ββ[π] K)] | |
| [Fintype (Module.Dual π (H β§Έ W) ββ[π] K)] | |
| theorem uniform_jointProjection : | |
| (FiniteDistribution.uniform ((Module.Dual π H ββ[π] K) Γ H)).pushforward | |
| (jointProjection W) = | |
| FiniteDistribution.uniform ((Module.Dual π (H β§Έ W) ββ[π] K) Γ (H β§Έ W)) := | |
| UniformLinearImage.uniform_pushforward_linearMap | |
| (jointProjection W) (jointProjection_surjective W) | |
| theorem independent_uniform_jointProjection : | |
| ((FiniteDistribution.uniform (Module.Dual π H ββ[π] K)).product | |
| (FiniteDistribution.uniform H)).pushforward (jointProjection W) = | |
| (FiniteDistribution.uniform (Module.Dual π (H β§Έ W) ββ[π] K)).product | |
| (FiniteDistribution.uniform (H β§Έ W)) := by | |
| rw [uniform_product, uniform_product] | |
| exact uniform_jointProjection W | |
| private theorem expect_prod {A B : Type*} [Fintype A] [Fintype B] | |
| (f : A Γ B β β) : | |
| (πΌ p : A Γ B, f p) = πΌ a : A, πΌ b : B, f (a, b) := by | |
| simpa only [Finset.univ_product_univ] using | |
| Finset.expect_product (Finset.univ : Finset A) (Finset.univ : Finset B) f | |
| theorem expect_project_matrix_increment | |
| (f : (Module.Dual π (H β§Έ W) ββ[π] K) β (H β§Έ W) β β) : | |
| (πΌ X : Module.Dual π H ββ[π] K, πΌ h : H, | |
| f (projectMatrix W X) (W.mkQ h)) = | |
| πΌ X : Module.Dual π (H β§Έ W) ββ[π] K, πΌ h : H β§Έ W, f X h := by | |
| have he := congrArg | |
| (fun ΞΌ : FiniteDistribution ((Module.Dual π (H β§Έ W) ββ[π] K) Γ (H β§Έ W)) => | |
| ΞΌ.expectation (fun p => f p.1 p.2)) (uniform_jointProjection W) | |
| rw [FiniteDistribution.expectation_pushforward, | |
| FiniteDistribution.expectation_uniform, FiniteDistribution.expectation_uniform] at he | |
| have he' : | |
| (πΌ p : (Module.Dual π H ββ[π] K) Γ H, | |
| f (projectMatrix W p.1) (W.mkQ p.2)) = | |
| πΌ p : (Module.Dual π (H β§Έ W) ββ[π] K) Γ (H β§Έ W), f p.1 p.2 := by | |
| simpa only [Fintype.expect_eq_sum_div_card, jointProjection_apply] using he | |
| simpa only [expect_prod] using he' | |
| theorem rankOne_pair_law (a : K) : | |
| ((FiniteDistribution.uniform (Module.Dual π H ββ[π] K)).product | |
| (FiniteDistribution.uniform H)).pushforward | |
| (fun p => (projectMatrix W p.1, | |
| projectMatrix W (p.1 + (Module.Dual.eval π H p.2).smulRight a))) = | |
| ((FiniteDistribution.uniform (Module.Dual π (H β§Έ W) ββ[π] K)).product | |
| (FiniteDistribution.uniform (H β§Έ W))).pushforward | |
| (fun p => (p.1, p.1 + (Module.Dual.eval π (H β§Έ W) p.2).smulRight a)) := by | |
| have he := congrArg | |
| (fun ΞΌ : FiniteDistribution ((Module.Dual π (H β§Έ W) ββ[π] K) Γ (H β§Έ W)) => | |
| ΞΌ.pushforward (fun p => | |
| (p.1, p.1 + (Module.Dual.eval π (H β§Έ W) p.2).smulRight a))) | |
| (independent_uniform_jointProjection W) | |
| rw [FiniteDistribution.pushforward_comp] at he | |
| simpa only [jointProjection_apply, project_rankOne] using he | |
| theorem expect_project_rankOne_pair (a : K) | |
| (f : (Module.Dual π (H β§Έ W) ββ[π] K) β | |
| (Module.Dual π (H β§Έ W) ββ[π] K) β β) : | |
| (πΌ X : Module.Dual π H ββ[π] K, πΌ h : H, | |
| f (projectMatrix W X) | |
| (projectMatrix W (X + (Module.Dual.eval π H h).smulRight a))) = | |
| πΌ X : Module.Dual π (H β§Έ W) ββ[π] K, πΌ h : H β§Έ W, | |
| f X (X + (Module.Dual.eval π (H β§Έ W) h).smulRight a) := by | |
| simpa only [project_rankOne] using expect_project_matrix_increment W | |
| (fun X h => f X (X + (Module.Dual.eval π (H β§Έ W) h).smulRight a)) | |
| end | |
| end PerfectCompleteness.MatrixRowQuotientLaw | |
| end | |
| end OAI | |