Download data/lean/OAI/Combinatorics/MatchingPSD/CellAverages.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.33 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/CellAverages.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatchingPSD/CellAverages.lean
-
curl -L -o CellAverages.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/CellAverages.lean
3.33 kB
| import OAI.Combinatorics.MatchingPSD.CutGeometry | |
| namespace OAI | |
| universe u_1 u_2 u_3 u_4 u_5 u_6 | |
| namespace MatchingSmoothing | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable | |
| section CellAverages | |
| variable {A : Type u_1} {B : Type u_2} {C : Type u_3} {I : Type u_4} [Fintype A] [Fintype B] [Fintype C] [Fintype I] [DecidableEq I] | |
| noncomputable def extensionAverage (i : I) (f : Pairing ((A β B) β (I Γ C)) β β) | |
| (M : Pairing ((A β B) β C)) : β := | |
| πΌ N : {j : I // j β i} β Pairing C, f (extendLocal i M N) | |
| noncomputable def cellAverage (i : I) (f : Pairing ((A β B) β (I Γ C)) β β) | |
| (x : Fin 3 β β) : β := | |
| predicateAverage (fun M => crossVector threeColor M = x) (extensionAverage i f) | |
| omit [Fintype A] [Fintype B] in | |
| lemma extensionAverage_relabel (i : I) (p : Equiv.Perm ((A β B) β C)) | |
| (f : Pairing ((A β B) β (I Γ C)) β β) (M : Pairing ((A β B) β C)) : | |
| extensionAverage i f (Pairing.relabel p M) = | |
| extensionAverage i (fun N => f (Pairing.relabel (liftLocal i p) N)) M := by | |
| simp only [extensionAverage, extendLocal_relabel] | |
| lemma expect_pair_product {X : Type u_5} {Y : Type u_6} [Fintype X] [Fintype Y] (f : X Γ Y β β) : | |
| (πΌ p : X Γ Y, f p) = πΌ x : X, πΌ y : Y, f (x,y) := by | |
| rw [β Finset.univ_product_univ, Finset.expect_product] | |
| lemma cellAverage_star (i : I) (f : Pairing ((A β B) β (I Γ C)) β β) (x : β) : | |
| cellAverage i f ![x,0,0] = | |
| πΌ M : {M : Pairing (A β B) // tableCoordinate abColor (0,1) M = x}, | |
| πΌ N : I β Pairing C, f (Pairing.sum M.1 (Pairing.cellwise N)) := by | |
| classical | |
| rw [cellAverage, predicateAverage_eq_expect] | |
| have he := Fintype.expect_equiv (starFiberEquiv (A := A) (B := B) (C := C) x) | |
| (fun p => extensionAverage i f (Pairing.sum p.1.1 p.2)) | |
| (fun p => extensionAverage i f p.1) (fun _ => rfl) | |
| calc | |
| _ = πΌ p : {M : Pairing (A β B) // tableCoordinate abColor (0,1) M = x} Γ Pairing C, | |
| extensionAverage i f (Pairing.sum p.1.1 p.2) := by | |
| convert he.symm using 1 | |
| congr 1 | |
| ext; simp | |
| _ = _ := ?_ | |
| rw [expect_pair_product] | |
| apply Finset.expect_congr rfl | |
| intro M _ | |
| simp only [extensionAverage] | |
| calc | |
| _ = πΌ p : Pairing C Γ ({j : I // j β i} β Pairing C), | |
| f (extendLocal i (Pairing.sum M.1 p.1) p.2) := by | |
| convert (expect_pair_product (fun p : Pairing C Γ ({j : I // j β i} β Pairing C) => | |
| f (extendLocal i (Pairing.sum M.1 p.1) p.2))).symm using 1 | |
| _ = _ := (Fintype.expect_equiv (Equiv.piSplitAt i (fun _ : I => Pairing C)) | |
| (fun N => f (Pairing.sum M.1 (Pairing.cellwise N))) | |
| (fun p => f (extendLocal i (Pairing.sum M.1 p.1) p.2)) | |
| (fun N => by rw [Equiv.piSplitAt_apply, extendLocal_sum])).symm | |
| lemma cellAverage_const (i : I) (f : Pairing ((A β B) β (I Γ C)) β β) | |
| (x : Fin 3 β β) (c : β) (hM : β M : Pairing ((A β B) β C), crossVector threeColor M = x) | |
| [Nonempty (Pairing C)] | |
| (hf : β M, crossVector threeColor M = x β β N, f (extendLocal i M N) = c) : | |
| cellAverage i f x = c := by | |
| apply predicateAverage_of_constant _ _ hM | |
| intro M hM | |
| simp only [extensionAverage, hf M hM, Finset.expect_const, Finset.univ_nonempty] | |
| end CellAverages | |
| end MatchingSmoothing | |
| end OAI | |