math / data /lean /OAI /Computability /DirectedFeedback /Games /KMSAnalyticHybridEnergyImageSplit.lean
Download data/lean/OAI/Computability/DirectedFeedback/Games/KMSAnalyticHybridEnergyImageSplit.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DirectedFeedback/Games/KMSAnalyticHybridEnergyImageSplit.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DirectedFeedback/Games/KMSAnalyticHybridEnergyImageSplit.lean
-
curl -L -o KMSAnalyticHybridEnergyImageSplit.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DirectedFeedback/Games/KMSAnalyticHybridEnergyImageSplit.lean
29 kB
Lean 4 Β· 68
declarations fullstatements
| import Mathlib | |
| import OAI.Computability.DirectedFeedback.Games.Derivatives | |
| namespace OAI | |
| noncomputable section | |
| namespace DFVSGames.Inverse.KMSAnalyticHybridEnergy | |
| open scoped BigOperators Classical | |
| variable {R B U : Type*} [Ring R] | |
| [AddCommGroup B] [Module R B] [AddCommGroup U] [Module R U] | |
| theorem range_subtype_comp_of_surjective (W : Submodule R U) | |
| (z : B ββ[R] W) (hz : Function.Surjective z) : | |
| (W.subtype.comp z).range = W := by | |
| ext u | |
| constructor | |
| Β· rintro β¨b, rflβ© | |
| exact (z b).property | |
| Β· intro hu | |
| obtain β¨b, hbβ© := hz β¨u, huβ© | |
| exact β¨b, congrArg Subtype.val hbβ© | |
| def fixedImageEquivSurjection (W : Submodule R U) : | |
| {z : B ββ[R] U // z.range = W} β | |
| {z : B ββ[R] W // Function.Surjective z} where | |
| toFun z := β¨z.val.codRestrict W (fun b => z.property.le (LinearMap.mem_range_self z.val b)), by | |
| intro w | |
| have hw : w.val β z.val.range := z.property.symm βΈ w.property | |
| obtain β¨b, hbβ© := hw | |
| exact β¨b, Subtype.ext hbβ©β© | |
| invFun z := β¨W.subtype.comp z.val, range_subtype_comp_of_surjective W z.val z.propertyβ© | |
| left_inv z := by | |
| apply Subtype.ext | |
| apply LinearMap.ext | |
| intro b | |
| rfl | |
| right_inv z := by | |
| apply Subtype.ext | |
| apply LinearMap.ext | |
| intro b | |
| apply Subtype.ext | |
| rfl | |
| theorem fixedImageEquivSurjection_symm_val (W : Submodule R U) | |
| (z : {z : B ββ[R] W // Function.Surjective z}) : | |
| ((fixedImageEquivSurjection W).symm z).val = W.subtype.comp z.val := rfl | |
| theorem fixedImageEquivSurjection_apply_coe (W : Submodule R U) | |
| (z : {z : B ββ[R] U // z.range = W}) (b : B) : | |
| ((fixedImageEquivSurjection W z).val b : U) = z.val b := rfl | |
| abbrev ImageRankFrequency (q : β) := | |
| {z : B ββ[R] U // Module.finrank R z.range = q} | |
| abbrev RankImage (R U : Type*) [Ring R] [AddCommGroup U] [Module R U] (q : β) := | |
| {W : Submodule R U // Module.finrank R W = q} | |
| def frequencyImage (q : β) (z : ImageRankFrequency (R := R) (B := B) (U := U) q) : | |
| RankImage R U q := β¨z.val.range, z.propertyβ© | |
| def frequencyImageFiberEquiv (q : β) (W : RankImage R U q) : | |
| {z : ImageRankFrequency (R := R) (B := B) (U := U) q // frequencyImage q z = W} β | |
| {z : B ββ[R] U // z.range = W.val} where | |
| toFun z := β¨z.val.val, congrArg Subtype.val z.propertyβ© | |
| invFun z := β¨β¨z.val, by rw [z.property]; exact W.propertyβ©, Subtype.ext z.propertyβ© | |
| left_inv z := by apply Subtype.ext; apply Subtype.ext; rfl | |
| right_inv z := by apply Subtype.ext; rfl | |
| def rankFrequencyImageEquiv (q : β) : | |
| ImageRankFrequency (R := R) (B := B) (U := U) q β | |
| Ξ£ W : RankImage R U q, {z : B ββ[R] W.val // Function.Surjective z} := | |
| (Equiv.sigmaFiberEquiv (frequencyImage (R := R) (B := B) (U := U) q)).symm.trans | |
| (Equiv.sigmaCongrRight fun W => | |
| (frequencyImageFiberEquiv q W).trans (fixedImageEquivSurjection W.val)) | |
| theorem rankFrequencyImageEquiv_symm_val (q : β) | |
| (p : Ξ£ W : RankImage R U q, {z : B ββ[R] W.val // Function.Surjective z}) : | |
| ((rankFrequencyImageEquiv q).symm p).val = p.1.val.subtype.comp p.2.val := rfl | |
| section Sums | |
| variable [Fintype (B ββ[R] U)] [Fintype (Submodule R U)] | |
| [β W : Submodule R U, Fintype (B ββ[R] W)] | |
| omit [Fintype (Submodule R U)] in | |
| theorem sum_fixedImage_eq_sum_surjection (W : Submodule R U) | |
| (weight : (B ββ[R] U) β β) : | |
| (β z : {z : B ββ[R] U // z.range = W}, weight z.val) = | |
| β z : {z : B ββ[R] W // Function.Surjective z}, weight (W.subtype.comp z.val) := by | |
| symm | |
| apply Fintype.sum_equiv (fixedImageEquivSurjection W).symm | |
| intro z | |
| rfl | |
| theorem sum_rankFrequency_eq_sum_image (q : β) (weight : (B ββ[R] U) β β) : | |
| (β z : ImageRankFrequency (R := R) (B := B) (U := U) q, weight z.val) = | |
| β W : RankImage R U q, | |
| β z : {z : B ββ[R] W.val // Function.Surjective z}, | |
| weight (W.val.subtype.comp z.val) := by | |
| calc | |
| _ = β p : Ξ£ W : RankImage R U q, | |
| {z : B ββ[R] W.val // Function.Surjective z}, | |
| weight (p.1.val.subtype.comp p.2.val) := by | |
| symm | |
| apply Fintype.sum_equiv (rankFrequencyImageEquiv q).symm | |
| intro p | |
| rfl | |
| _ = _ := Fintype.sum_sigma _ | |
| theorem sum_filter_rank_eq_sum_image (q : β) (weight : (B ββ[R] U) β β) : | |
| (β z : B ββ[R] U with Module.finrank R z.range = q, weight z) = | |
| β W : RankImage R U q, | |
| β z : {z : B ββ[R] W.val // Function.Surjective z}, | |
| weight (W.val.subtype.comp z.val) := by | |
| rw [Finset.sum_subtype (p := fun z : B ββ[R] U => Module.finrank R z.range = q) | |
| (Finset.univ.filter fun z : B ββ[R] U => | |
| Module.finrank R z.range = q) (by simp) weight] | |
| exact sum_rankFrequency_eq_sum_image q weight | |
| theorem sum_eq_sum_image_of_rank_support (q : β) (weight : (B ββ[R] U) β β) | |
| (hsupport : β z, Module.finrank R z.range β q β weight z = 0) : | |
| (β z : B ββ[R] U, weight z) = | |
| β W : RankImage R U q, | |
| β z : {z : B ββ[R] W.val // Function.Surjective z}, | |
| weight (W.val.subtype.comp z.val) := by | |
| rw [β sum_filter_rank_eq_sum_image, Finset.sum_filter] | |
| apply Finset.sum_congr rfl | |
| intro z _ | |
| by_cases hz : Module.finrank R z.range = q | |
| Β· simp [hz] | |
| Β· simp [hz, hsupport z hz] | |
| end Sums | |
| variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] | |
| def imageCoordinates (W D : Submodule K V) (h : IsCompl W D) : V ββ[K] (W Γ D) := | |
| (Submodule.prodEquivOfIsCompl W D h).symm | |
| theorem imageCoordinates_subtype (W D : Submodule K V) (h : IsCompl W D) | |
| (w : W) : imageCoordinates W D h (w : V) = (w, 0) := | |
| Submodule.prodEquivOfIsCompl_symm_apply_left W D h w | |
| theorem imageCoordinates_frequency {X : Type*} [AddCommGroup X] [Module K X] | |
| (W D : Submodule K V) (h : IsCompl W D) (z : X ββ[K] W) : | |
| (imageCoordinates W D h).toLinearMap.comp (W.subtype.comp z) = | |
| z.prod (0 : X ββ[K] D) := by | |
| apply LinearMap.ext | |
| intro x | |
| exact imageCoordinates_subtype W D h (z x) | |
| theorem imageCoordinates_finrank [FiniteDimensional K V] | |
| (W D : Submodule K V) (h : IsCompl W D) : | |
| Module.finrank K W + Module.finrank K D = Module.finrank K V := by | |
| simpa only [Module.finrank_prod] using (Submodule.prodEquivOfIsCompl W D h).finrank_eq | |
| theorem exists_imageCoordinates (W : Submodule K V) : | |
| β D : Submodule K V, β e : V ββ[K] (W Γ D), β w : W, e (w : V) = (w, 0) := by | |
| obtain β¨D, hβ© := W.exists_isCompl | |
| exact β¨D, imageCoordinates W D h, imageCoordinates_subtype W D hβ© | |
| end DFVSGames.Inverse.KMSAnalyticHybridEnergy | |
| end | |
| namespace DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| variable {R A W D B C : Type*} [Ring R] | |
| [AddCommGroup A] [Module R A] [AddCommGroup W] [Module R W] | |
| [AddCommGroup D] [Module R D] [AddCommGroup B] [Module R B] | |
| [AddCommGroup C] [Module R C] | |
| def compressBlock (S : (B Γ C) ββ[R] (A Γ (W Γ D))) : B ββ[R] (W Γ D) := | |
| (LinearMap.snd R A (W Γ D)).comp (S.comp (LinearMap.inl R B C)) | |
| theorem compressBlock_apply | |
| (S : (B Γ C) ββ[R] (A Γ (W Γ D))) (b : B) : | |
| compressBlock S b = (S (b, 0)).2 := rfl | |
| structure Coordinates (z : B ββ[R] W) where | |
| alpha : (B Γ C) ββ[R] A | |
| psi : (B Γ C) ββ[R] W | |
| psi_left : psi.comp (LinearMap.inl R B C) = z | |
| v : C ββ[R] D | |
| theorem Coordinates.ext {z : B ββ[R] W} {p q : Coordinates (A := A) (D := D) | |
| (C := C) z} (ha : p.alpha = q.alpha) (hp : p.psi = q.psi) (hv : p.v = q.v) : p = q := by | |
| cases p | |
| cases q | |
| cases ha | |
| cases hp | |
| cases hv | |
| rfl | |
| def assemble {z : B ββ[R] W} (p : Coordinates (A := A) (D := D) (C := C) z) : | |
| (B Γ C) ββ[R] (A Γ (W Γ D)) := | |
| p.alpha.prod (p.psi.prod (p.v.comp (LinearMap.snd R B C))) | |
| theorem assemble_apply {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) (x : B Γ C) : | |
| assemble p x = (p.alpha x, p.psi x, p.v x.2) := rfl | |
| theorem compressBlock_assemble {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) : | |
| compressBlock (assemble p) = z.prod (0 : B ββ[R] D) := by | |
| apply LinearMap.ext | |
| intro b | |
| have hp : p.psi (b, 0) = z b := | |
| congrArg (fun L : (B ββ[R] W) => L b) p.psi_left | |
| simp [compressBlock, assemble, hp] | |
| def extract (z : B ββ[R] W) | |
| (S : {S : (B Γ C) ββ[R] (A Γ (W Γ D)) // | |
| compressBlock S = z.prod (0 : B ββ[R] D)}) : | |
| Coordinates (A := A) (D := D) (C := C) z where | |
| alpha := (LinearMap.fst R A (W Γ D)).comp S.val | |
| psi := (LinearMap.fst R W D).comp ((LinearMap.snd R A (W Γ D)).comp S.val) | |
| psi_left := by | |
| apply LinearMap.ext | |
| intro b | |
| exact congrArg (fun L : B ββ[R] (W Γ D) => (L b).1) S.property | |
| v := (LinearMap.snd R W D).comp | |
| ((LinearMap.snd R A (W Γ D)).comp (S.val.comp (LinearMap.inr R B C))) | |
| theorem assemble_extract (z : B ββ[R] W) | |
| (S : {S : (B Γ C) ββ[R] (A Γ (W Γ D)) // | |
| compressBlock S = z.prod (0 : B ββ[R] D)}) : | |
| assemble (extract z S) = S.val := by | |
| apply LinearMap.ext | |
| rintro β¨b, cβ© | |
| have hzero : (S.val (b, 0)).2.2 = 0 := | |
| congrArg (fun L : B ββ[R] (W Γ D) => (L b).2) S.property | |
| have hlast : (S.val (b, c)).2.2 = (S.val (0, c)).2.2 := by | |
| calc | |
| _ = (S.val ((b, 0) + (0, c))).2.2 := by simp | |
| _ = (S.val (b, 0)).2.2 + (S.val (0, c)).2.2 := by rw [map_add]; rfl | |
| _ = _ := by rw [hzero, zero_add] | |
| apply Prod.ext | |
| Β· rfl | |
| Β· apply Prod.ext | |
| Β· rfl | |
| Β· exact hlast.symm | |
| theorem extract_assemble {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) : | |
| extract z β¨assemble p, compressBlock_assemble pβ© = p := by | |
| apply Coordinates.ext | |
| Β· apply LinearMap.ext | |
| intro x | |
| rfl | |
| Β· apply LinearMap.ext | |
| intro x | |
| rfl | |
| Β· apply LinearMap.ext | |
| intro c | |
| rfl | |
| def compressedFiberEquiv (z : B ββ[R] W) : | |
| {S : (B Γ C) ββ[R] (A Γ (W Γ D)) // | |
| compressBlock S = z.prod (0 : B ββ[R] D)} β | |
| Coordinates (A := A) (D := D) (C := C) z where | |
| toFun := extract z | |
| invFun p := β¨assemble p, compressBlock_assemble pβ© | |
| left_inv S := Subtype.ext (assemble_extract z S) | |
| right_inv := extract_assemble | |
| theorem assemble_injective (z : B ββ[R] W) : | |
| Function.Injective (assemble (R := R) (A := A) (D := D) (C := C) (z := z)) := by | |
| intro p q h | |
| have hh : (compressedFiberEquiv (A := A) (D := D) (C := C) z).symm p = | |
| (compressedFiberEquiv (A := A) (D := D) (C := C) z).symm q := Subtype.ext h | |
| exact (compressedFiberEquiv (A := A) (D := D) (C := C) z).symm.injective hh | |
| end DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| namespace DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| variable {R A W D B C : Type*} [Field R] | |
| [AddCommGroup A] [Module R A] [AddCommGroup W] [Module R W] | |
| [AddCommGroup D] [Module R D] [AddCommGroup B] [Module R B] | |
| [AddCommGroup C] [Module R C] | |
| open DFVSGames.Appendix | |
| private theorem psi_split_inline_KMSAnalyticHybridCoordinatesConditions {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) (b : B) (c : C) : | |
| p.psi (b, c) = z b + p.psi (0, c) := by | |
| have hleft : p.psi (b, 0) = z b := | |
| congrArg (fun L : B ββ[R] W => L b) p.psi_left | |
| calc | |
| p.psi (b, c) = p.psi ((b, 0) + (0, c)) := by simp | |
| _ = p.psi (b, 0) + p.psi (0, c) := p.psi.map_add _ _ | |
| _ = z b + p.psi (0, c) := by rw [hleft] | |
| theorem hybrid_assemble_iff {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) | |
| (hz : Function.Surjective z) : | |
| LinearIdentities.Hybrid (assemble p) | |
| (LinearMap.range (LinearMap.inl R A (W Γ D))) | |
| (LinearMap.range (LinearMap.inl R B C)) β | |
| Function.Injective p.v β§ | |
| Function.Surjective (p.alpha.prod (p.psi.prod (LinearMap.snd R B C))) := by | |
| constructor | |
| Β· intro h | |
| have hzero : β c : C, p.v c = 0 β c = 0 := by | |
| intro c hc | |
| obtain β¨b, hbβ© := hz (-p.psi (0, c)) | |
| have hpsi : p.psi (b, c) = 0 := by | |
| rw [psi_split_inline_KMSAnalyticHybridCoordinatesConditions, hb, neg_add_cancel] | |
| have hmem : (b, c) β LinearMap.range (LinearMap.inl R B C) := by | |
| apply h.2 | |
| change assemble p (b, c) β LinearMap.range (LinearMap.inl R A (W Γ D)) | |
| refine β¨p.alpha (b, c), ?_β© | |
| change (p.alpha (b, c), (0, 0)) = (p.alpha (b, c), p.psi (b, c), p.v c) | |
| rw [hpsi, hc] | |
| obtain β¨b', hb'β© := hmem | |
| exact (congrArg (fun x : B Γ C => x.2) hb').symm | |
| refine β¨?_, ?_β© | |
| Β· intro c d hcd | |
| apply sub_eq_zero.mp | |
| apply hzero | |
| rw [map_sub, hcd, sub_self] | |
| Β· rintro β¨a, w, cβ© | |
| obtain β¨b, hbβ© := hz (w - p.psi (0, c)) | |
| have hpsi : p.psi (b, c) = w := by | |
| rw [psi_split_inline_KMSAnalyticHybridCoordinatesConditions, hb, sub_add_cancel] | |
| have hmem : (a - p.alpha (b, c), (0, 0)) β LinearMap.range (assemble p) := by | |
| apply h.1 | |
| exact β¨a - p.alpha (b, c), rflβ© | |
| obtain β¨x, hxβ© := hmem | |
| have hxa : p.alpha x = a - p.alpha (b, c) := | |
| congrArg (fun y : A Γ (W Γ D) => y.1) hx | |
| have hxw : p.psi x = 0 := | |
| congrArg (fun y : A Γ (W Γ D) => y.2.1) hx | |
| have hxd : p.v x.2 = 0 := | |
| congrArg (fun y : A Γ (W Γ D) => y.2.2) hx | |
| have hxc : x.2 = 0 := hzero _ hxd | |
| refine β¨x + (b, c), ?_β© | |
| change (p.alpha (x + (b, c)), p.psi (x + (b, c)), (x + (b, c)).2) = | |
| (a, w, c) | |
| apply Prod.ext | |
| Β· rw [map_add, hxa, sub_add_cancel] | |
| Β· apply Prod.ext | |
| Β· change p.psi (x + (b, c)) = w | |
| rw [map_add, hxw, zero_add, hpsi] | |
| Β· change x.2 + c = c | |
| rw [hxc, zero_add] | |
| Β· rintro β¨hv, hthetaβ© | |
| constructor | |
| Β· rintro y β¨a, rflβ© | |
| obtain β¨x, hxβ© := htheta (a, 0, 0) | |
| change (p.alpha x, p.psi x, x.2) = (a, 0, 0) at hx | |
| have hxa : p.alpha x = a := congrArg (fun y : A Γ (W Γ C) => y.1) hx | |
| have hxw : p.psi x = 0 := congrArg (fun y : A Γ (W Γ C) => y.2.1) hx | |
| have hxc : x.2 = 0 := congrArg (fun y : A Γ (W Γ C) => y.2.2) hx | |
| refine β¨x, ?_β© | |
| change (p.alpha x, p.psi x, p.v x.2) = (a, 0, 0) | |
| rw [hxa, hxw, hxc, map_zero] | |
| Β· intro x hx | |
| change assemble p x β LinearMap.range (LinearMap.inl R A (W Γ D)) at hx | |
| obtain β¨a, haβ© := hx | |
| have hxd : p.v x.2 = 0 := | |
| (congrArg (fun y : A Γ (W Γ D) => y.2.2) ha).symm | |
| have hxc : x.2 = 0 := hv (by simpa only [map_zero] using hxd) | |
| exact β¨x.1, Prod.ext rfl hxc.symmβ© | |
| end DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| namespace DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| variable {R A W D B C : Type*} [Ring R] | |
| [AddCommGroup A] [Module R A] [AddCommGroup W] [Module R W] | |
| [AddCommGroup D] [Module R D] [AddCommGroup B] [Module R B] | |
| [AddCommGroup C] [Module R C] | |
| def fullCoordinates {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) : | |
| (B Γ C) ββ[R] (A Γ (W Γ C)) := | |
| p.alpha.prod (p.psi.prod (LinearMap.snd R B C)) | |
| def embedLast (v : C ββ[R] D) : (A Γ (W Γ C)) ββ[R] (A Γ (W Γ D)) := | |
| (LinearMap.id : A ββ[R] A).prodMap ((LinearMap.id : W ββ[R] W).prodMap v) | |
| theorem embedLast_apply (v : C ββ[R] D) (x : A Γ (W Γ C)) : | |
| embedLast v x = (x.1, x.2.1, v x.2.2) := rfl | |
| theorem embedLast_injective (v : C ββ[R] D) (hv : Function.Injective v) : | |
| Function.Injective (embedLast (A := A) (W := W) v) := by | |
| intro x y h | |
| apply Prod.ext | |
| Β· exact congrArg (fun u : A Γ (W Γ D) => u.1) h | |
| Β· apply Prod.ext | |
| Β· exact congrArg (fun u : A Γ (W Γ D) => u.2.1) h | |
| Β· apply hv | |
| exact congrArg (fun u : A Γ (W Γ D) => u.2.2) h | |
| theorem assemble_eq_embedLast_comp {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) : | |
| assemble p = (embedLast p.v).comp (fullCoordinates p) := by | |
| apply LinearMap.ext | |
| intro x | |
| rfl | |
| theorem range_assemble_of_fullCoordinates_surjective {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) | |
| (hp : Function.Surjective (fullCoordinates p)) : | |
| (assemble p).range = (embedLast (A := A) (W := W) p.v).range := by | |
| rw [assemble_eq_embedLast_comp, LinearMap.range_comp, | |
| LinearMap.range_eq_top.mpr hp, Submodule.map_top] | |
| theorem finrank_assemble {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) | |
| (hv : Function.Injective p.v) (hp : Function.Surjective (fullCoordinates p)) : | |
| Module.finrank R (assemble p).range = Module.finrank R (A Γ (W Γ C)) := by | |
| rw [range_assemble_of_fullCoordinates_surjective p hp] | |
| exact LinearMap.finrank_range_of_inj (embedLast_injective p.v hv) | |
| theorem ker_assemble {z : B ββ[R] W} | |
| (p : Coordinates (A := A) (D := D) (C := C) z) | |
| (hv : Function.Injective p.v) : | |
| (assemble p).ker = (fullCoordinates p).ker := by | |
| rw [assemble_eq_embedLast_comp] | |
| exact LinearMap.ker_comp_of_ker_eq_bot _ | |
| (LinearMap.ker_eq_bot.mpr (embedLast_injective p.v hv)) | |
| end DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| namespace DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| variable {R A W D B C : Type*} [Field R] | |
| [AddCommGroup A] [Module R A] [AddCommGroup W] [Module R W] | |
| [AddCommGroup D] [Module R D] [AddCommGroup B] [Module R B] | |
| [AddCommGroup C] [Module R C] | |
| open DFVSGames.Appendix | |
| def hybridFiberEquiv (z : B ββ[R] W) (hz : Function.Surjective z) : | |
| {S : (B Γ C) ββ[R] (A Γ (W Γ D)) // | |
| compressBlock S = z.prod (0 : B ββ[R] D) β§ | |
| LinearIdentities.Hybrid S | |
| (LinearMap.range (LinearMap.inl R A (W Γ D))) | |
| (LinearMap.range (LinearMap.inl R B C))} β | |
| {p : Coordinates (A := A) (D := D) (C := C) z // | |
| Function.Injective p.v β§ Function.Surjective (fullCoordinates p)} where | |
| toFun S := β¨extract z β¨S.val, S.property.1β©, by | |
| apply (hybrid_assemble_iff _ hz).mp | |
| rw [assemble_extract] | |
| exact S.property.2β© | |
| invFun p := β¨assemble p.val, compressBlock_assemble p.val, | |
| (hybrid_assemble_iff p.val hz).mpr p.propertyβ© | |
| left_inv S := by | |
| apply Subtype.ext | |
| exact assemble_extract z β¨S.val, S.property.1β© | |
| right_inv p := by | |
| apply Subtype.ext | |
| exact extract_assemble p.val | |
| theorem hybridFiber_finrank (z : B ββ[R] W) (hz : Function.Surjective z) | |
| (S : (B Γ C) ββ[R] (A Γ (W Γ D))) | |
| (hc : compressBlock S = z.prod (0 : B ββ[R] D)) | |
| (hh : LinearIdentities.Hybrid S | |
| (LinearMap.range (LinearMap.inl R A (W Γ D))) | |
| (LinearMap.range (LinearMap.inl R B C))) : | |
| Module.finrank R S.range = Module.finrank R (A Γ (W Γ C)) := by | |
| let p := (hybridFiberEquiv (A := A) (D := D) (C := C) z hz) β¨S, hc, hhβ© | |
| have he : assemble p.val = S := assemble_extract z β¨S, hcβ© | |
| rw [β he] | |
| exact finrank_assemble p.val p.property.1 p.property.2 | |
| end DFVSGames.Inverse.KMSAnalyticHybridCoordinates | |
| namespace DFVSGames.Inverse.KMSAnalytic | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| open DFVSGames.Integration.BinaryLinear (F2) | |
| open DFVSGames.Fourier.MatrixFourier | |
| variable {E F I : Type*} | |
| [AddCommGroup E] [Module F2 E] [AddCommGroup F] [Module F2 F] | |
| [AddCommGroup I] [Module F2 I] | |
| [FiniteDimensional F2 E] [FiniteDimensional F2 F] [FiniteDimensional F2 I] | |
| [Fintype (E ββ[F2] F)] [Fintype (F ββ[F2] E)] | |
| [Fintype (I ββ[F2] F)] [Fintype (F ββ[F2] I)] | |
| def smallCoeff (ΞΉ : I ββ[F2] E) (f : (E ββ[F2] F) β β) | |
| (T : F ββ[F2] I) : β := | |
| if Function.Surjective T then linearCoeff f (ΞΉ.comp T) else 0 | |
| def smallComponent (ΞΉ : I ββ[F2] E) (f : (E ββ[F2] F) β β) : | |
| (I ββ[F2] F) β β := synthesis (smallCoeff ΞΉ f) | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem coeff_smallComponent (ΞΉ : I ββ[F2] E) | |
| (f : (E ββ[F2] F) β β) (T : F ββ[F2] I) : | |
| linearCoeff (smallComponent ΞΉ f) T = smallCoeff ΞΉ f T := | |
| coeff_synthesis _ _ | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem coeff_smallComponent_of_surjective (ΞΉ : I ββ[F2] E) | |
| (f : (E ββ[F2] F) β β) (T : F ββ[F2] I) | |
| (hT : Function.Surjective T) : | |
| linearCoeff (smallComponent ΞΉ f) T = linearCoeff f (ΞΉ.comp T) := by | |
| simp only [coeff_smallComponent, smallCoeff, ite_eq_left hT] | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem coeff_smallComponent_of_not_surjective (ΞΉ : I ββ[F2] E) | |
| (f : (E ββ[F2] F) β β) (T : F ββ[F2] I) | |
| (hT : Β¬ Function.Surjective T) : linearCoeff (smallComponent ΞΉ f) T = 0 := by | |
| simp only [coeff_smallComponent, smallCoeff, ite_eq_right hT] | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem smallComponent_energy (ΞΉ : I ββ[F2] E) (f : (E ββ[F2] F) β β) : | |
| (πΌ X, smallComponent ΞΉ f X ^ 2) = | |
| β T β Finset.univ.filter (fun T : F ββ[F2] I => Function.Surjective T), | |
| linearCoeff f (ΞΉ.comp T) ^ 2 := by | |
| rw [smallComponent, synthesis_energy, Finset.sum_filter] | |
| apply Finset.sum_congr rfl | |
| intro T _ | |
| by_cases hT : Function.Surjective T <;> simp [smallCoeff, hT] | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem rankComponent_smallComponent (ΞΉ : I ββ[F2] E) | |
| (f : (E ββ[F2] F) β β) : | |
| rankComponent (Module.finrank F2 I) (smallComponent ΞΉ f) = smallComponent ΞΉ f := by | |
| apply eq_of_coeff_eq | |
| intro T | |
| simp only [rankComponent, coeff_component, coeff_smallComponent] | |
| by_cases hT : Function.Surjective T | |
| Β· have hr : Module.finrank F2 T.range = Module.finrank F2 I := | |
| Submodule.eq_top_iff_finrank_eq.mp (LinearMap.range_eq_top.mpr hT) | |
| simp [hr] | |
| Β· simp [smallCoeff, hT] | |
| omit [FiniteDimensional F2 E] [FiniteDimensional F2 F] [FiniteDimensional F2 I] [Fintype (E ββ[F2] F)] [Fintype (F ββ[F2] E)] [Fintype (I ββ[F2] F)] [Fintype (F ββ[F2] I)] in | |
| theorem ker_comp_of_injective (ΞΉ : I ββ[F2] E) (hΞΉ : Function.Injective ΞΉ) | |
| (T : F ββ[F2] I) : (ΞΉ.comp T).ker = T.ker := | |
| LinearMap.ker_comp_of_ker_eq_bot T (LinearMap.ker_eq_bot.mpr hΞΉ) | |
| omit [FiniteDimensional F2 E] [FiniteDimensional F2 F] [FiniteDimensional F2 I] [Fintype (F ββ[F2] E)] [Fintype (I ββ[F2] F)] [Fintype (F ββ[F2] I)] in | |
| theorem smallCoeff_eq_of_kernel_coeff_const (ΞΉ ΞΊ : I ββ[F2] E) | |
| (hΞΉ : Function.Injective ΞΉ) (hΞΊ : Function.Injective ΞΊ) | |
| (f : (E ββ[F2] F) β β) | |
| (hcoeff : β S T : F ββ[F2] E, | |
| S.ker = T.ker β linearCoeff f S = linearCoeff f T) : | |
| smallCoeff ΞΉ f = smallCoeff ΞΊ f := by | |
| funext T | |
| unfold smallCoeff | |
| by_cases hT : Function.Surjective T | |
| Β· simp only [ite_eq_left hT] | |
| exact hcoeff _ _ ((ker_comp_of_injective ΞΉ hΞΉ T).trans | |
| (ker_comp_of_injective ΞΊ hΞΊ T).symm) | |
| Β· simp only [ite_eq_right hT] | |
| omit [FiniteDimensional F2 E] [FiniteDimensional F2 F] [FiniteDimensional F2 I] | |
| [Fintype (F ββ[F2] E)] [Fintype (I ββ[F2] F)] in | |
| theorem smallComponent_eq_of_kernel_coeff_const (ΞΉ ΞΊ : I ββ[F2] E) | |
| (hΞΉ : Function.Injective ΞΉ) (hΞΊ : Function.Injective ΞΊ) | |
| (f : (E ββ[F2] F) β β) | |
| (hcoeff : β S T : F ββ[F2] E, | |
| S.ker = T.ker β linearCoeff f S = linearCoeff f T) : | |
| smallComponent ΞΉ f = smallComponent ΞΊ f := | |
| congrArg synthesis (smallCoeff_eq_of_kernel_coeff_const ΞΉ ΞΊ hΞΉ hΞΊ f hcoeff) | |
| omit [FiniteDimensional F2 E] [Fintype (F ββ[F2] E)] in | |
| theorem smallComponent_orthogonal (ΞΉ : I ββ[F2] E) | |
| (f : (E ββ[F2] F) β β) (g : (I ββ[F2] F) β β) | |
| (hg : β T : F ββ[F2] I, Function.Surjective T β linearCoeff g T = 0) : | |
| (πΌ X, smallComponent ΞΉ f X * g X) = 0 := by | |
| rw [β linear_parseval_inner] | |
| apply Finset.sum_eq_zero | |
| intro T _ | |
| rw [coeff_smallComponent] | |
| by_cases hT : Function.Surjective T | |
| Β· rw [hg T hT, mul_zero] | |
| Β· simp [smallCoeff, hT] | |
| theorem smallComponent_energy_le (ΞΉ : I ββ[F2] E) (hΞΉ : Function.Injective ΞΉ) | |
| (f : (E ββ[F2] F) β β) : | |
| (πΌ X, smallComponent ΞΉ f X ^ 2) β€ πΌ X, f X ^ 2 := by | |
| have hinj : Function.Injective (fun T : F ββ[F2] I => ΞΉ.comp T) := by | |
| intro T U hTU | |
| apply LinearMap.ext | |
| intro x | |
| apply hΞΉ | |
| exact congrArg (fun S : F ββ[F2] E => S x) hTU | |
| rw [smallComponent_energy, β linear_parseval] | |
| calc | |
| _ = β S β (Finset.univ.filter (fun T : F ββ[F2] I => Function.Surjective T)).image | |
| (fun T => ΞΉ.comp T), linearCoeff f S ^ 2 := by | |
| rw [Finset.sum_image] | |
| intro T _ U _ hTU | |
| exact hinj hTU | |
| _ β€ β S, linearCoeff f S ^ 2 := | |
| Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) | |
| (fun S _ _ => sq_nonneg _) | |
| end | |
| end DFVSGames.Inverse.KMSAnalytic | |
| namespace DFVSGames.Inverse.KMSKernelOrbits | |
| noncomputable section | |
| variable {K E F : Type*} [DivisionRing K] | |
| [AddCommGroup E] [Module K E] [AddCommGroup F] [Module K F] | |
| def rangeEquivOfKerEq (S T : F ββ[K] E) (hker : S.ker = T.ker) : | |
| S.range ββ[K] T.range := | |
| S.quotKerEquivRange.symm βͺβ«β | |
| Submodule.quotEquivOfEq S.ker T.ker hker βͺβ«β T.quotKerEquivRange | |
| theorem rangeEquivOfKerEq_apply (S T : F ββ[K] E) (hker : S.ker = T.ker) (x : F) : | |
| (rangeEquivOfKerEq S T hker β¨S x, β¨x, rflβ©β© : E) = T x := by | |
| change (T.quotKerEquivRange ((Submodule.quotEquivOfEq S.ker T.ker hker) | |
| (S.quotKerEquivRange.symm β¨S x, β¨x, rflβ©β©)) : E) = T x | |
| have hs : (β¨S x, β¨x, rflβ©β© : S.range) = | |
| S.quotKerEquivRange (Submodule.Quotient.mk x) := rfl | |
| rw [hs, LinearEquiv.symm_apply_apply] | |
| rfl | |
| theorem exists_postcomp_equiv_of_ker_eq (S T : F ββ[K] E) | |
| [FiniteDimensional K S.range] (hker : S.ker = T.ker) : | |
| β g : E ββ[K] E, g.toLinearMap.comp S = T := by | |
| obtain β¨g, hgβ© := Submodule.exists_linearEquiv_restrict_eq | |
| (rangeEquivOfKerEq S T hker) | |
| refine β¨g, ?_β© | |
| ext x | |
| change g (S x) = T x | |
| exact (hg β¨S x, β¨x, rflβ©β©).symm.trans (rangeEquivOfKerEq_apply S T hker x) | |
| theorem ker_eq_iff_exists_postcomp_equiv (S T : F ββ[K] E) | |
| [FiniteDimensional K S.range] : | |
| S.ker = T.ker β β g : E ββ[K] E, g.toLinearMap.comp S = T := by | |
| constructor | |
| Β· exact exists_postcomp_equiv_of_ker_eq S T | |
| Β· rintro β¨g, rflβ© | |
| ext x | |
| simp | |
| end | |
| end DFVSGames.Inverse.KMSKernelOrbits | |
| namespace DFVSGames.Inverse.KMSBasisInvariant | |
| noncomputable section | |
| open scoped BigOperators | |
| open DFVSGames.Fourier.MatrixCharacters | |
| open DFVSGames.Fourier.MatrixFourier | |
| variable {E F : Type*} [AddCommGroup E] [Module F2 E] | |
| [AddCommGroup F] [Module F2 F] | |
| def primalChange (g : E ββ[F2] E) : (E ββ[F2] F) β (E ββ[F2] F) where | |
| toFun X := X.comp g.toLinearMap | |
| invFun X := X.comp g.symm.toLinearMap | |
| left_inv X := by ext x; simp | |
| right_inv X := by ext x; simp | |
| def frequencyChange (g : E ββ[F2] E) : (F ββ[F2] E) β (F ββ[F2] E) where | |
| toFun S := g.toLinearMap.comp S | |
| invFun S := g.symm.toLinearMap.comp S | |
| left_inv S := by ext x; simp | |
| right_inv S := by ext x; simp | |
| def IsBasisInvariant (f : (E ββ[F2] F) β β) : Prop := | |
| β (g : E ββ[F2] E) X, f (X.comp g.toLinearMap) = f X | |
| theorem character_change (g : E ββ[F2] E) (S : F ββ[F2] E) | |
| (X : E ββ[F2] F) : | |
| linearTraceCharacter (g.toLinearMap.comp S) X = | |
| linearTraceCharacter S (X.comp g.toLinearMap) := by | |
| simp only [linearTraceCharacter_apply, linearTracePair, LinearMap.comp_assoc] | |
| variable [Fintype (E ββ[F2] F)] | |
| theorem coefficient_change (f : (E ββ[F2] F) β β) | |
| (hf : IsBasisInvariant f) (g : E ββ[F2] E) (S : F ββ[F2] E) : | |
| linearCoeff f (g.toLinearMap.comp S) = linearCoeff f S := by | |
| unfold linearCoeff | |
| apply Fintype.expect_equiv (primalChange g) | |
| intro X | |
| change f X * (linearTraceCharacter (g.toLinearMap.comp S) X).re = | |
| f (X.comp g.toLinearMap) * (linearTraceCharacter S (X.comp g.toLinearMap)).re | |
| rw [character_change, hf g X] | |
| def frequencyRank (S : F ββ[F2] E) : β := Module.finrank F2 (LinearMap.range S) | |
| omit [Fintype (E ββ[F2] F)] in | |
| theorem frequencyRank_change (g : E ββ[F2] E) (S : F ββ[F2] E) : | |
| frequencyRank (g.toLinearMap.comp S) = frequencyRank S := by | |
| unfold frequencyRank | |
| rw [LinearMap.range_comp, g.finrank_map_eq] | |
| variable [Fintype (F ββ[F2] E)] | |
| def rankProjection (i : β) (f : (E ββ[F2] F) β β) (X : E ββ[F2] F) : β := | |
| β S, if frequencyRank S = i then linearCoeff f S * (linearTraceCharacter S X).re else 0 | |
| theorem rankProjection_invariant (i : β) (f : (E ββ[F2] F) β β) | |
| (hf : IsBasisInvariant f) : IsBasisInvariant (rankProjection i f) := by | |
| intro g X | |
| unfold rankProjection | |
| apply Fintype.sum_equiv (frequencyChange g) | |
| intro S | |
| change (if frequencyRank S = i then | |
| linearCoeff f S * (linearTraceCharacter S (X.comp g.toLinearMap)).re else 0) = | |
| if frequencyRank (g.toLinearMap.comp S) = i then | |
| linearCoeff f (g.toLinearMap.comp S) * | |
| (linearTraceCharacter (g.toLinearMap.comp S) X).re else 0 | |
| rw [frequencyRank_change, coefficient_change f hf, character_change] | |
| end | |
| end DFVSGames.Inverse.KMSBasisInvariant | |
| end OAI | |
Outline
- theorem
range_subtype_comp_of_surjective15 - def
fixedImageEquivSurjection26 - theorem
fixedImageEquivSurjection_symm_val47 - theorem
fixedImageEquivSurjection_apply_coe51 - abbrev
ImageRankFrequency55 - abbrev
RankImage58 - def
frequencyImage61 - def
frequencyImageFiberEquiv64 - def
rankFrequencyImageEquiv72 - theorem
rankFrequencyImageEquiv_symm_val79 - theorem
sum_fixedImage_eq_sum_surjection90 - theorem
sum_rankFrequency_eq_sum_image99 - theorem
sum_filter_rank_eq_sum_image114 - theorem
sum_eq_sum_image_of_rank_support124 - def
imageCoordinates141 - theorem
imageCoordinates_subtype144 - theorem
imageCoordinates_frequency148 - theorem
imageCoordinates_finrank156 - theorem
exists_imageCoordinates161 - def
compressBlock177 - theorem
compressBlock_apply180 - structure
Coordinates184 - theorem
Coordinates.ext190 - def
assemble199 - theorem
assemble_apply203 - theorem
compressBlock_assemble207 - def
extract216 - theorem
assemble_extract229 - theorem
extract_assemble248 - def
compressedFiberEquiv262 - theorem
assemble_injective271 - theorem
psi_split_inline_KMSAnalyticHybridCoordinatesConditions289 - theorem
hybrid_assemble_iff299 - def
fullCoordinates380 - def
embedLast385 - theorem
embedLast_apply388 - theorem
embedLast_injective391 - theorem
assemble_eq_embedLast_comp401 - theorem
range_assemble_of_fullCoordinates_surjective408 - theorem
finrank_assemble415 - theorem
ker_assemble422 - def
hybridFiberEquiv441 - theorem
hybridFiber_finrank462 - def
smallCoeff490 - def
smallComponent494 - theorem
coeff_smallComponent498 - theorem
coeff_smallComponent_of_surjective504 - theorem
coeff_smallComponent_of_not_surjective511 - theorem
smallComponent_energy518 - theorem
rankComponent_smallComponent529 - theorem
ker_comp_of_injective543 - theorem
smallCoeff_eq_of_kernel_coeff_const549 - theorem
smallComponent_eq_of_kernel_coeff_const565 - theorem
smallComponent_orthogonal575 - theorem
smallComponent_energy_le587 - def
rangeEquivOfKerEq617 - theorem
rangeEquivOfKerEq_apply622 - theorem
exists_postcomp_equiv_of_ker_eq631 - theorem
ker_eq_iff_exists_postcomp_equiv641 - def
primalChange662 - def
frequencyChange668 - def
IsBasisInvariant674 - theorem
character_change677 - theorem
coefficient_change685 - def
frequencyRank695 - theorem
frequencyRank_change698 - def
rankProjection705 - theorem
rankProjection_invariant708