Download data/lean/OAI/Computability/UniqueGames/Analysis/DerivativeInduction.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 15.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Analysis/DerivativeInduction.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Analysis/DerivativeInduction.lean
-
curl -L -o DerivativeInduction.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Analysis/DerivativeInduction.lean
15.1 kB
| import Mathlib.FieldTheory.Finiteness | |
| import Mathlib.LinearAlgebra.Isomorphisms | |
| import Mathlib.LinearAlgebra.Projection | |
| import OAI.Computability.UniqueGames.Analysis.CompressionCountLemmas | |
| import OAI.Computability.UniqueGames.Reduction.BinaryLinear | |
| namespace OAI | |
| section | |
| namespace UniqueGamesTheorem.Appendix.DerivativeInduction | |
| open UniqueGamesTheorem.Integration.BinaryLinear | |
| open LinearMap | |
| variable {B U A C : Type*} | |
| variable [AddCommGroup B] [Module F2 B] [AddCommGroup U] [Module F2 U] | |
| variable [AddCommGroup A] [Module F2 A] [AddCommGroup C] [Module F2 C] | |
| /-- The actual complement conditions after choosing domain/codomain splittings. -/ | |
| def IsAntecedent (Z : B ββ[F2] C) (X : (B Γ U) ββ[F2] (A Γ C)) : Prop := | |
| (β b, (X (b, 0)).2 = Z b) β§ | |
| Disjoint X.range (LinearMap.inl F2 A C).range β§ | |
| (LinearMap.inl F2 B U).range β X.ker = β€ | |
| abbrev Antecedent (Z : B ββ[F2] C) := | |
| { X : (B Γ U) ββ[F2] (A Γ C) // IsAntecedent Z X } | |
| theorem antecedent_image_from_left (Z : B ββ[F2] C) | |
| (X : (B Γ U) ββ[F2] (A Γ C)) (hX : IsAntecedent Z X) (p : B Γ U) : | |
| β b : B, X p = X (b, 0) := by | |
| have hp : p β (LinearMap.inl F2 B U).range β X.ker := by | |
| rw [hX.2.2] | |
| trivial | |
| obtain β¨q, hq, r, hr, heβ© := Submodule.mem_sup.mp hp | |
| obtain β¨b, rflβ© := hq | |
| refine β¨b, ?_β© | |
| rw [β he, map_add] | |
| have hz : X r = 0 := hr | |
| simp only [hz, add_zero, LinearMap.inl_apply] | |
| theorem antecedent_bottom_mem_range (Z : B ββ[F2] C) | |
| (X : (B Γ U) ββ[F2] (A Γ C)) (hX : IsAntecedent Z X) (p : B Γ U) : | |
| (X p).2 β Z.range := by | |
| obtain β¨b, hbβ© := antecedent_image_from_left Z X hX p | |
| exact β¨b, (hX.1 b).symm.trans (congrArg Prod.snd hb).symmβ© | |
| theorem antecedent_vertical_zero (Z : B ββ[F2] C) | |
| (X : (B Γ U) ββ[F2] (A Γ C)) (hX : IsAntecedent Z X) | |
| (p : B Γ U) (hp : (X p).2 = 0) : X p = 0 := by | |
| apply Submodule.disjoint_def.mp hX.2.1 (X p) (LinearMap.mem_range_self X p) | |
| exact β¨(X p).1, Prod.ext rfl hp.symmβ© | |
| private theorem antecedent_kernel_le (Z : B ββ[F2] C) | |
| (X : (B Γ U) ββ[F2] (A Γ C)) (hX : IsAntecedent Z X) : | |
| Z.ker β€ ((LinearMap.fst F2 A C).comp (X.comp (LinearMap.inl F2 B U))).ker := by | |
| intro b hb | |
| have hz : Z b = 0 := hb | |
| have hx := antecedent_vertical_zero Z X hX (b, 0) ((hX.1 b).trans hz) | |
| exact congrArg Prod.fst hx | |
| /-- The graph map from the fixed compressed image into the removed summand. -/ | |
| noncomputable def graphParameter (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) : Z.range ββ[F2] A := | |
| (Z.ker.liftQ ((LinearMap.fst F2 A C).comp | |
| (X.val.comp (LinearMap.inl F2 B U))) (antecedent_kernel_le Z X.val X.property)).comp | |
| Z.quotKerEquivRange.symm.toLinearMap | |
| theorem graphParameter_apply (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) (b : B) : | |
| graphParameter Z X (Z.rangeRestrict b) = (X.val (b, 0)).1 := by | |
| rw [show Z.rangeRestrict b = β¨Z b, LinearMap.mem_range_self Z bβ© from rfl] | |
| simp [graphParameter, LinearMap.quotKerEquivRange_symm_apply_image] | |
| /-- Values on the omitted domain complement, compressed into `range Z`. -/ | |
| noncomputable def complementParameter (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) : U ββ[F2] Z.range := | |
| ((LinearMap.snd F2 A C).comp (X.val.comp (LinearMap.inr F2 B U))).codRestrict | |
| Z.range (fun u => antecedent_bottom_mem_range Z X.val X.property (0, u)) | |
| @[simp] theorem complementParameter_val (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) (u : U) : | |
| (complementParameter Z X u : C) = (X.val (0, u)).2 := rfl | |
| /-- The block matrix `[F Z, F H; Z, H]`. -/ | |
| def lift (Z : B ββ[F2] C) (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| (B Γ U) ββ[F2] (A Γ C) := | |
| (F.comp (Z.rangeRestrict.coprod H)).prod | |
| (Z.range.subtype.comp (Z.rangeRestrict.coprod H)) | |
| @[simp] theorem lift_apply (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) (p : B Γ U) : | |
| lift Z F H p = (F (Z.rangeRestrict p.1 + H p.2), | |
| ((Z.rangeRestrict p.1 + H p.2 : Z.range) : C)) := rfl | |
| theorem lift_isAntecedent (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| IsAntecedent Z (lift Z F H) := by | |
| refine β¨?_, ?_, ?_β© | |
| Β· intro b | |
| simp | |
| Β· apply Submodule.disjoint_def.mpr | |
| intro v hv hw | |
| obtain β¨p, rflβ© := hv | |
| obtain β¨a, haβ© := hw | |
| have hz : Z.rangeRestrict p.1 + H p.2 = 0 := by | |
| apply Subtype.ext | |
| exact (congrArg Prod.snd ha).symm | |
| simp [hz] | |
| Β· apply top_unique | |
| intro p _ | |
| obtain β¨b, hbβ© := Z.surjective_rangeRestrict (Z.rangeRestrict p.1 + H p.2) | |
| have he : lift Z F H p = lift Z F H (b, 0) := by | |
| simp [hb] | |
| apply Submodule.mem_sup.mpr | |
| refine β¨(b, 0), β¨b, rflβ©, p - (b, 0), ?_, ?_β© | |
| Β· change lift Z F H (p - (b, 0)) = 0 | |
| rw [map_sub, he, sub_self] | |
| Β· simpa only [β add_sub_assoc] using add_sub_cancel_left (b, 0) p | |
| def intoAntecedent (Z : B ββ[F2] C) | |
| (p : (Z.range ββ[F2] A) Γ (U ββ[F2] Z.range)) : | |
| Antecedent (U := U) (A := A) Z := | |
| β¨lift Z p.1 p.2, lift_isAntecedent Z p.1 p.2β© | |
| theorem graphParameter_lift (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| graphParameter Z (intoAntecedent Z (F, H)) = F := by | |
| ext c | |
| obtain β¨b, rflβ© := Z.surjective_rangeRestrict c | |
| rw [graphParameter_apply] | |
| simp [intoAntecedent] | |
| theorem complementParameter_lift (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| complementParameter Z (intoAntecedent Z (F, H)) = H := by | |
| ext u | |
| simp [intoAntecedent] | |
| theorem lift_parameters (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) : | |
| lift Z (graphParameter Z X) (complementParameter Z X) = X.val := by | |
| apply LinearMap.ext | |
| intro p | |
| have hb : (Z.rangeRestrict p.1 + complementParameter Z X p.2 : C) = (X.val p).2 := by | |
| have hp : p = (p.1, 0) + (0, p.2) := by simp | |
| conv_rhs => rw [hp, map_add] | |
| simp [X.property.1] | |
| obtain β¨b, heβ© := antecedent_image_from_left Z X.val X.property p | |
| have hr : Z.rangeRestrict p.1 + complementParameter Z X p.2 = Z.rangeRestrict b := by | |
| apply Subtype.ext | |
| exact hb.trans ((congrArg Prod.snd he).trans (X.property.1 b)) | |
| apply Prod.ext | |
| Β· change graphParameter Z X (Z.rangeRestrict p.1 + complementParameter Z X p.2) = _ | |
| rw [hr, graphParameter_apply] | |
| exact (congrArg Prod.fst he).symm | |
| Β· exact hb | |
| /-- Exact antecedent bijection; neither direction assumes the desired count. -/ | |
| noncomputable def antecedentEquiv (Z : B ββ[F2] C) : | |
| Antecedent (U := U) (A := A) Z β | |
| (Z.range ββ[F2] A) Γ (U ββ[F2] Z.range) where | |
| toFun X := (graphParameter Z X, complementParameter Z X) | |
| invFun := intoAntecedent Z | |
| left_inv X := Subtype.ext (lift_parameters Z X) | |
| right_inv p := Prod.ext (graphParameter_lift Z p.1 p.2) | |
| (complementParameter_lift Z p.1 p.2) | |
| /-- The graph of the reconstruction parameter as an injective linear map. -/ | |
| def graphEmbedding (Z : B ββ[F2] C) (F : Z.range ββ[F2] A) : | |
| Z.range ββ[F2] (A Γ C) := F.prod Z.range.subtype | |
| theorem graphEmbedding_injective (Z : B ββ[F2] C) (F : Z.range ββ[F2] A) : | |
| Function.Injective (graphEmbedding Z F) := by | |
| intro c d h | |
| exact Subtype.ext (congrArg Prod.snd h) | |
| theorem range_lift (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| (lift Z F H).range = (graphEmbedding Z F).range := by | |
| ext v | |
| constructor | |
| Β· rintro β¨p, rflβ© | |
| exact β¨Z.rangeRestrict p.1 + H p.2, rflβ© | |
| Β· rintro β¨c, rflβ© | |
| obtain β¨b, hbβ© := Z.surjective_rangeRestrict c | |
| refine β¨(b, 0), ?_β© | |
| simp [graphEmbedding, hb] | |
| /-- The reconstructed map has exactly the rank of the fixed compression. -/ | |
| theorem finrank_range_lift (Z : B ββ[F2] C) | |
| (F : Z.range ββ[F2] A) (H : U ββ[F2] Z.range) : | |
| Module.finrank F2 (lift Z F H).range = Module.finrank F2 Z.range := by | |
| rw [range_lift] | |
| exact LinearMap.finrank_range_of_inj (graphEmbedding_injective Z F) | |
| /-- The map rank is preserved for every antecedent, without a rank hypothesis. -/ | |
| theorem finrank_range_antecedent (Z : B ββ[F2] C) | |
| (X : Antecedent (U := U) (A := A) Z) : | |
| Module.finrank F2 X.val.range = Module.finrank F2 Z.range := by | |
| rw [β lift_parameters Z X] | |
| exact finrank_range_lift Z (graphParameter Z X) (complementParameter Z X) | |
| /-- The sharp cardinality of the antecedents after the outer subspaces are fixed. -/ | |
| theorem card_antecedent (Z : B ββ[F2] C) | |
| [Module.Finite F2 A] [Module.Finite F2 U] [Module.Finite F2 C] : | |
| Nat.card (Antecedent (U := U) (A := A) Z) = | |
| 2 ^ (Module.finrank F2 Z.range * | |
| (Module.finrank F2 A + Module.finrank F2 U)) := by | |
| rw [Nat.card_congr (antecedentEquiv (U := U) (A := A) Z), Nat.card_prod, | |
| CompressionCount.natCard_linearMap, CompressionCount.natCard_linearMap, β pow_add] | |
| congr 1 | |
| ring | |
| theorem isAntecedent_iff_pointwise (Z : B ββ[F2] C) | |
| (X : (B Γ U) ββ[F2] (A Γ C)) : | |
| IsAntecedent Z X β | |
| (β b, (X (b, 0)).2 = Z b) β§ | |
| (β p, (X p).2 = 0 β X p = 0) β§ | |
| (β p, β b, X p = X (b, 0)) := by | |
| constructor | |
| Β· intro h | |
| exact β¨h.1, antecedent_vertical_zero Z X h, antecedent_image_from_left Z X hβ© | |
| Β· rintro β¨hc, hv, hsβ© | |
| refine β¨hc, Submodule.disjoint_def.mpr ?_, top_unique ?_β© | |
| Β· rintro v β¨p, rflβ© β¨a, haβ© | |
| exact hv p (congrArg Prod.snd ha).symm | |
| Β· intro p _ | |
| obtain β¨b, hbβ© := hs p | |
| apply Submodule.mem_sup.mpr | |
| refine β¨(b, 0), β¨b, rflβ©, p - (b, 0), ?_, ?_β© | |
| Β· change X (p - (b, 0)) = 0 | |
| rw [map_sub, hb, sub_self] | |
| Β· simpa only [β add_sub_assoc] using add_sub_cancel_left (b, 0) p | |
| section Subspaces | |
| variable {W V : Type*} [AddCommGroup W] [Module F2 W] | |
| [AddCommGroup V] [Module F2 V] | |
| theorem disjoint_range_iff_zero (X : W ββ[F2] V) (Q : Submodule F2 V) : | |
| Disjoint X.range Q β β w, X w β Q β X w = 0 := by | |
| constructor | |
| Β· intro h w hw | |
| exact Submodule.disjoint_def.mp h (X w) (LinearMap.mem_range_self X w) hw | |
| Β· intro h | |
| apply Submodule.disjoint_def.mpr | |
| rintro v β¨w, rflβ© hw | |
| exact h w hw | |
| theorem sup_kernel_iff_image (X : W ββ[F2] V) (P : Submodule F2 W) : | |
| P β X.ker = β€ β β w, β p : P, X w = X p := by | |
| constructor | |
| Β· intro h w | |
| have hw : w β P β X.ker := by rw [h]; trivial | |
| obtain β¨p, hp, r, hr, heβ© := Submodule.mem_sup.mp hw | |
| refine β¨β¨p, hpβ©, ?_β© | |
| rw [β he, map_add] | |
| have hz : X r = 0 := hr | |
| simp [hz] | |
| Β· intro h | |
| apply top_unique | |
| intro w _ | |
| obtain β¨p, hpβ© := h w | |
| apply Submodule.mem_sup.mpr | |
| refine β¨p, p.property, w - p, ?_, ?_β© | |
| Β· change X (w - p) = 0 | |
| rw [map_sub, hp, sub_self] | |
| Β· simpa only [β add_sub_assoc] using add_sub_cancel_left (p : W) w | |
| /-- Antecedents on arbitrary subspaces. Projection onto the chosen complement | |
| is the quotient compression expressed through `quotientEquivOfIsCompl`. -/ | |
| def IsSubspaceAntecedent (P : Submodule F2 W) (Q D : Submodule F2 V) | |
| (hQ : IsCompl Q D) (Z : P ββ[F2] D) (X : W ββ[F2] V) : Prop := | |
| (β p : P, D.projectionOnto Q hQ.symm (X p) = Z p) β§ | |
| Disjoint X.range Q β§ P β X.ker = β€ | |
| abbrev SubspaceAntecedent (P : Submodule F2 W) (Q D : Submodule F2 V) | |
| (hQ : IsCompl Q D) (Z : P ββ[F2] D) := | |
| { X : W ββ[F2] V // IsSubspaceAntecedent P Q D hQ Z X } | |
| noncomputable def coordinateEquiv (P E : Submodule F2 W) (Q D : Submodule F2 V) | |
| (hP : IsCompl P E) (hQ : IsCompl Q D) : | |
| (W ββ[F2] V) ββ[F2] ((P Γ E) ββ[F2] (Q Γ D)) := | |
| LinearEquiv.arrowCongr (P.prodEquivOfIsCompl E hP).symm | |
| (Q.prodEquivOfIsCompl D hQ).symm | |
| @[simp] theorem coordinateEquiv_apply (P E : Submodule F2 W) | |
| (Q D : Submodule F2 V) (hP : IsCompl P E) (hQ : IsCompl Q D) | |
| (X : W ββ[F2] V) (p : P Γ E) : | |
| coordinateEquiv P E Q D hP hQ X p = | |
| (Q.prodEquivOfIsCompl D hQ).symm (X ((p.1 : W) + p.2)) := rfl | |
| theorem coordinate_antecedent_iff (P E : Submodule F2 W) | |
| (Q D : Submodule F2 V) (hP : IsCompl P E) (hQ : IsCompl Q D) | |
| (Z : P ββ[F2] D) (X : W ββ[F2] V) : | |
| IsAntecedent Z (coordinateEquiv P E Q D hP hQ X) β | |
| IsSubspaceAntecedent P Q D hQ Z X := by | |
| rw [isAntecedent_iff_pointwise] | |
| unfold IsSubspaceAntecedent | |
| rw [disjoint_range_iff_zero, sup_kernel_iff_image] | |
| constructor | |
| Β· rintro β¨hc, hv, hsβ© | |
| refine β¨?_, ?_, ?_β© | |
| Β· intro p | |
| simpa using hc p | |
| Β· intro w hw | |
| let p := (P.prodEquivOfIsCompl E hP).symm w | |
| have hp : (p.1 : W) + p.2 = w := | |
| (P.prodEquivOfIsCompl E hP).apply_symm_apply w | |
| have hz : (coordinateEquiv P E Q D hP hQ X p).2 = 0 := by | |
| rw [coordinateEquiv_apply, hp] | |
| exact (Submodule.prodEquivOfIsCompl_symm_apply_snd_eq_zero Q D hQ).mpr hw | |
| have hh := congrArg (Q.prodEquivOfIsCompl D hQ) (hv p hz) | |
| simpa only [coordinateEquiv_apply, hp, LinearEquiv.apply_symm_apply, map_zero] using hh | |
| Β· intro w | |
| let p := (P.prodEquivOfIsCompl E hP).symm w | |
| have hp : (p.1 : W) + p.2 = w := | |
| (P.prodEquivOfIsCompl E hP).apply_symm_apply w | |
| obtain β¨b, hbβ© := hs p | |
| refine β¨b, ?_β© | |
| have hh := congrArg (Q.prodEquivOfIsCompl D hQ) hb | |
| simpa only [coordinateEquiv_apply, hp, Submodule.coe_zero, add_zero, | |
| LinearEquiv.apply_symm_apply] using hh | |
| Β· rintro β¨hc, hv, hsβ© | |
| refine β¨?_, ?_, ?_β© | |
| Β· intro p | |
| simpa using hc p | |
| Β· intro p hp | |
| have hm : X ((p.1 : W) + p.2) β Q := | |
| (Submodule.prodEquivOfIsCompl_symm_apply_snd_eq_zero Q D hQ).mp hp | |
| have hz := hv ((p.1 : W) + p.2) hm | |
| simp [hz] | |
| Β· intro p | |
| obtain β¨b, hbβ© := hs ((p.1 : W) + p.2) | |
| refine β¨b, ?_β© | |
| simpa only [coordinateEquiv_apply, Submodule.coe_zero, add_zero] using | |
| congrArg (Q.prodEquivOfIsCompl D hQ).symm hb | |
| /-- Transport the canonical antecedent count to arbitrary complementary subspaces. -/ | |
| noncomputable def subspaceAntecedentEquiv (P E : Submodule F2 W) | |
| (Q D : Submodule F2 V) (hP : IsCompl P E) (hQ : IsCompl Q D) | |
| (Z : P ββ[F2] D) : | |
| SubspaceAntecedent P Q D hQ Z β | |
| (Z.range ββ[F2] Q) Γ (E ββ[F2] Z.range) := | |
| (Equiv.subtypeEquiv (coordinateEquiv P E Q D hP hQ).toEquiv | |
| (fun X => (coordinate_antecedent_iff P E Q D hP hQ Z X).symm)).trans | |
| (antecedentEquiv Z) | |
| /-- Exact antecedent cardinality in arbitrary complementary subspaces. -/ | |
| theorem card_subspaceAntecedent (P E : Submodule F2 W) | |
| (Q D : Submodule F2 V) (hP : IsCompl P E) (hQ : IsCompl Q D) | |
| (Z : P ββ[F2] D) [Module.Finite F2 W] [Module.Finite F2 V] : | |
| Nat.card (SubspaceAntecedent P Q D hQ Z) = | |
| 2 ^ (Module.finrank F2 Z.range * | |
| (Module.finrank F2 Q + Module.finrank F2 E)) := by | |
| rw [Nat.card_congr (subspaceAntecedentEquiv P E Q D hP hQ Z), Nat.card_prod, | |
| CompressionCount.natCard_linearMap, CompressionCount.natCard_linearMap, β pow_add] | |
| congr 1 | |
| ring | |
| end Subspaces | |
| end UniqueGamesTheorem.Appendix.DerivativeInduction | |
| end | |
| end OAI | |