Download data/lean/OAI/Combinatorics/MatchingPSD/AdmissibleTables.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/AdmissibleTables.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatchingPSD/AdmissibleTables.lean
-
curl -L -o AdmissibleTables.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/AdmissibleTables.lean
3.6 kB
| import OAI.Combinatorics.MatchingPSD.GlobalGeometry | |
| namespace OAI | |
| universe u_1 u_2 u_3 u_4 | |
| namespace MatchingSmoothing | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable | |
| section ColorTransport | |
| variable {A : Type u_1} {B : Type u_2} {C : Type u_3} [Fintype A] [Fintype B] [Fintype C] [DecidableEq C] | |
| noncomputable def colorEquiv (f : A β C) (g : B β C) (h : histogram f = histogram g) : A β B := | |
| (Equiv.sigmaFiberEquiv f).symm.trans | |
| ((Equiv.sigmaCongrRight (fun c => Fintype.equivOfCardEq (congrFun h c))).trans | |
| (Equiv.sigmaFiberEquiv g)) | |
| omit [Fintype C] in | |
| lemma colorEquiv_spec (f : A β C) (g : B β C) (h : histogram f = histogram g) (a : A) : | |
| g (colorEquiv f g h a) = f a := by | |
| exact (Fintype.equivOfCardEq (congrFun h (f a)) β¨a,rflβ©).property | |
| end ColorTransport | |
| def typePair : Fin 6 β Fin 3 Γ Fin 3 := ![(0,0),(0,1),(0,2),(1,1),(1,2),(2,2)] | |
| abbrev TypedEdges (E : Fin 6 β β) := (t : Fin 6) Γ Fin (E t) | |
| def edgeColor (E : Fin 6 β β) : TypedEdges E Γ Bool β Fin 3 := | |
| fun v => if v.2 then (typePair v.1.1).2 else (typePair v.1.1).1 | |
| def endpointSizes (E : Fin 6 β β) : Fin 3 β β := | |
| ![2*E 0+E 1+E 2, E 1+2*E 3+E 4, E 2+E 4+2*E 5] | |
| lemma edgeColor_histogram (E : Fin 6 β β) : histogram (edgeColor E) = endpointSizes E := by | |
| funext c | |
| apply Nat.cast_injective (R := β) | |
| rw [histogram_cast_sum] | |
| simp only [Fintype.sum_prod_type, Fintype.sum_sigma, Fintype.sum_bool] | |
| fin_cases c <;> simp [edgeColor, endpointSizes, typePair, Fin.sum_univ_succ] <;> ring | |
| lemma edgeColor_cross (E : Fin 6 β β) (i : Fin 3) : | |
| crossCoordinate (edgeColor E) i (standardPairing (H := TypedEdges E)) = | |
| (![E 1,E 2,E 4] i : β) := by | |
| simp only [crossCoordinate, tableCoordinate, Fintype.sum_prod_type, | |
| Fintype.sum_sigma, Fintype.sum_bool] | |
| fin_cases i <;> simp [crossPair, standardPairing, edgeColor, typePair, Fin.sum_univ_succ] | |
| lemma exists_pairing_of_endpoints {V : Type u_4} [Fintype V] | |
| (z : V β Fin 3) (E : Fin 6 β β) (hz : histogram z = endpointSizes E) : | |
| β M : Pairing V, β i : Fin 3, crossCoordinate z i M = (![E 1,E 2,E 4] i : β) := by | |
| let e := colorEquiv (edgeColor E) z ((edgeColor_histogram E).trans hz.symm) | |
| have he : z β e = edgeColor E := funext (colorEquiv_spec _ _ _) | |
| refine β¨Pairing.transport e standardPairing, ?_β© | |
| intro i | |
| rw [crossCoordinate, tableCoordinate_transport, he] | |
| exact edgeColor_cross E i | |
| abbrev TripleVertices (s : β) := (Fin (2*s+1) β Fin (2*s+1)) β (Fin s Γ Bool) | |
| def tripleColor {s : β} : TripleVertices s β Fin 3 := | |
| Sum.elim (Sum.elim (fun _ => 0) (fun _ => 1)) (fun _ => 2) | |
| lemma tripleColor_histogram (s : β) : | |
| histogram (@tripleColor s) = ![2*s+1,2*s+1,2*s] := by | |
| funext c | |
| apply Nat.cast_injective (R := β) | |
| rw [histogram_cast_sum] | |
| fin_cases c <;> simp [tripleColor, Fintype.sum_sum_type, Nat.cast_add, Nat.cast_mul]; ring | |
| lemma triple_card (s : β) : Fintype.card (TripleVertices s) = 2*(3*s+1) := by | |
| simp only [TripleVertices, Fintype.card_sum, Fintype.card_fin, Fintype.card_prod, | |
| Fintype.card_bool] | |
| omega | |
| noncomputable def tripleEquiv (s : β) : TripleVertices s β Vertices (3*s+1) := | |
| Fintype.equivOfCardEq (by | |
| change Fintype.card (TripleVertices s) = Fintype.card (Fin (3*s+1) Γ Bool) | |
| rw [triple_card, Fintype.card_prod, Fintype.card_fin, Fintype.card_bool] | |
| omega) | |
| lemma triple_histogram_pos {s : β} (hs : 0 < s) (i : Fin 3) : | |
| 0 < histogram (@tripleColor s) i := by | |
| rw [tripleColor_histogram] | |
| fin_cases i <;> simp; omega | |
| end MatchingSmoothing | |
| end OAI | |