Download data/lean/OAI/Combinatorics/MatchingPSD/EquivariantCompression.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.88 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/EquivariantCompression.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatchingPSD/EquivariantCompression.lean
-
curl -L -o EquivariantCompression.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/EquivariantCompression.lean
4.88 kB
| import OAI.Combinatorics.MatchingPSD.SpectralContraction | |
| namespace OAI | |
| universe u_1 u_2 u_3 | |
| namespace MatchingSmoothing | |
| namespace Pairing | |
| variable {V : Type u_1} | |
| lemma act_pointwise_mul (p : Equiv.Perm V) (f g : Pairing V โ โ) : | |
| act p (f * g) = act p f * act p g := rfl | |
| lemma act_pointwise_one (p : Equiv.Perm V) : act p (1 : Pairing V โ โ) = 1 := rfl | |
| lemma act_edgeCoord (p : Equiv.Perm V) (e : V ร V) : | |
| act p (edgeCoord e) = edgeCoord (p e.1, p e.2) := by | |
| classical | |
| ext M | |
| simp only [act_apply, edgeCoord, relabel_apply, inv_inv] | |
| congr 1 | |
| exact propext p.symm_apply_eq | |
| lemma lowDegree_invariant (p : Equiv.Perm V) (d : โ) | |
| (f : Pairing V โ โ) (hf : f โ lowDegree edgeCoord d) : | |
| act p f โ lowDegree edgeCoord d := by | |
| apply Submodule.span_induction (p := fun f _ => act p f โ lowDegree edgeCoord d) | |
| _ _ _ _ hf | |
| ยท rintro f โจl, hl, rflโฉ | |
| have hprod : act p ((l.map edgeCoord).prod) = | |
| ((l.map (fun e => (p e.1, p e.2))).map edgeCoord).prod := by | |
| clear hl | |
| induction l with | |
| | nil => exact act_pointwise_one p | |
| | cons e l ih => | |
| simp only [List.map_cons, List.prod_cons, act_pointwise_mul, | |
| act_edgeCoord, ih] | |
| rw [hprod] | |
| exact Submodule.subset_span โจ_, by simpa, rflโฉ | |
| ยท simp | |
| ยท intro f g _ _ hf hg | |
| simpa only [map_add] using (lowDegree edgeCoord d).add_mem hf hg | |
| ยท intro c f _ hf | |
| simpa only [map_smul] using (lowDegree edgeCoord d).smul_mem c hf | |
| end Pairing | |
| open scoped RealInnerProductSpace | |
| section EuclideanPermutations | |
| variable {X : Type u_2} [Fintype X] | |
| noncomputable def permIso (e : Equiv.Perm X) : | |
| EuclideanSpace โ X โโแตข[โ] EuclideanSpace โ X := | |
| LinearIsometryEquiv.piLpCongrLeft 2 โ โ e | |
| @[simp] lemma permIso_apply (e : Equiv.Perm X) (v : EuclideanSpace โ X) (x : X) : | |
| permIso e v x = v (e.symm x) := rfl | |
| lemma matrix_equivariant [DecidableEq X] (A : Matrix X X โ) (e : Equiv.Perm X) | |
| (hA : โ x y, A (e x) (e y) = A x y) (v : EuclideanSpace โ X) : | |
| A.toEuclideanLin (permIso e v) = permIso e (A.toEuclideanLin v) := by | |
| ext x | |
| change (โ y, A x y * v (e.symm y)) = โ y, A (e.symm x) y * v y | |
| rw [โ Equiv.sum_comp e (fun y => A x y * v (e.symm y))] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [e.symm_apply_apply, โ hA (e.symm x) y, e.apply_symm_apply] | |
| lemma matrix_trace_square [DecidableEq X] (A : Matrix X X โ) : | |
| LinearMap.trace โ (EuclideanSpace โ X) (A.toEuclideanLin * A.toEuclideanLin) = | |
| Matrix.trace (A * A) := by | |
| simp only [Matrix.toLpLin_eq_toLin, Module.End.mul_eq_comp, | |
| โ Matrix.toLin_mul, Matrix.trace_toLin_eq] | |
| end EuclideanPermutations | |
| section CompressionEquivariance | |
| variable {E : Type u_3} [NormedAddCommGroup E] [InnerProductSpace โ E] | |
| [FiniteDimensional โ E] | |
| omit [FiniteDimensional โ E] in | |
| lemma invariant_map_eq (W : Submodule โ E) (e : E โโแตข[โ] E) | |
| (h : โ x, x โ W โ e x โ W) (hi : โ x, x โ W โ e.symm x โ W) : | |
| W.map e.toLinearEquiv.toLinearMap = W := by | |
| apply le_antisymm | |
| ยท rintro _ โจx, hx, rflโฉ | |
| exact h x hx | |
| ยท intro x hx | |
| exact โจe.symm x, hi x hx, e.apply_symm_apply xโฉ | |
| omit [FiniteDimensional โ E] in | |
| lemma invariant_orthogonal (W : Submodule โ E) (e : E โโแตข[โ] E) | |
| (hi : โ x, x โ W โ e.symm x โ W) (x : E) (hx : x โ Wแฎ) : | |
| e x โ Wแฎ := by | |
| rw [Submodule.mem_orthogonal] at hx โข | |
| intro y hy | |
| rw [โ e.apply_symm_apply y, e.inner_map_map] | |
| exact hx (e.symm y) (hi y hy) | |
| lemma starProjection_equivariant (W : Submodule โ E) (e : E โโแตข[โ] E) | |
| (h : โ x, x โ W โ e x โ W) (hi : โ x, x โ W โ e.symm x โ W) | |
| (x : E) : e (W.starProjection x) = W.starProjection (e x) := by | |
| symm | |
| apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero | |
| ยท exact h _ (W.orthogonalProjectionOnto x).property | |
| ยท intro y hy | |
| rw [โ e.apply_symm_apply y, โ e.map_sub, e.inner_map_map] | |
| exact W.starProjection_inner_eq_zero x (e.symm y) (hi y hy) | |
| lemma compression_eigenspace_invariant (A : Module.End โ E) (W : Submodule โ E) | |
| (e : E โโแตข[โ] E) (h : โ x, x โ W โ e x โ W) | |
| (hi : โ x, x โ W โ e.symm x โ W) | |
| (hA : โ x, A (e x) = e (A x)) (c : โ) (x : E) | |
| (hx : x โ (Module.End.eigenspace (compression A W) c).map W.subtype) : | |
| e x โ (Module.End.eigenspace (compression A W) c).map W.subtype := by | |
| rcases hx with โจx, hx, rflโฉ | |
| refine โจโจe x, h x x.2โฉ, ?_, rflโฉ | |
| simp only [SetLike.mem_coe, Module.End.mem_eigenspace_iff] at hx โข | |
| apply Subtype.ext | |
| have he := congrArg (fun y : W => (y : E)) hx | |
| change W.starProjection (A x) = c โข (x : E) at he | |
| change W.starProjection (A (e (x : E))) = c โข e (x : E) | |
| rw [hA, โ starProjection_equivariant W e h hi, he, map_smul] | |
| end CompressionEquivariance | |
| end MatchingSmoothing | |
| end OAI | |