Download data/lean/OAI/Geometry/Borsuk/TenLabels/Labels.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.01 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Borsuk/TenLabels/Labels.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/Borsuk/TenLabels/Labels.lean
-
curl -L -o Labels.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Borsuk/TenLabels/Labels.lean
5.01 kB
| import Mathlib | |
| namespace OAI | |
| open Set MeasureTheory | |
| namespace BorsukNine.FiniteObstruction | |
| abbrev Labels := Fin 10 | |
| abbrev Family := Finset Labels β Prop | |
| attribute [local instance] Classical.propDecidable | |
| structure TenSystem (T Q : Family) : Prop where | |
| tetra_card : β S, Q S β S.card = 4 | |
| down : β S U, Q S β U β S β U.card = 3 β T U | |
| pure : β U, T U β β S, Q S β§ U β S | |
| no_boundary : β S U, Q S β U β S β U.card = 3 β | |
| β S', Q S' β§ U β S' β§ S' β S | |
| complementary : β S U, Q S β U β SαΆ β U.card = 3 β | |
| (T U β Β¬ T (SαΆ \ U)) | |
| pair_count : β S P, Q S β P β SαΆ β P.card = 2 β | |
| ((SαΆ \ P).filter (fun w => T (insert w P))).card = 2 | |
| variable {T Q : Family} | |
| lemma filter_card_eq_two_three_pos {s r : Finset Labels} {p : Labels β Prop} | |
| [DecidablePred p] (hs : s.card = 4) (hr : r.card = 3) (hrs : r β s) | |
| (hp : (s.filter p).card = 2) : β x β r, p x := by | |
| by_contra hn | |
| have hsub : s.filter p β s \ r := by | |
| intro x hx | |
| obtain β¨hxs, hpxβ© := Finset.mem_filter.mp hx | |
| refine Finset.mem_sdiff.mpr β¨hxs, ?_β© | |
| intro hxr | |
| exact hn β¨x, hxr, hpxβ© | |
| have hc := Finset.card_le_card hsub | |
| rw [Finset.card_sdiff_of_subset hrs, hs, hr, hp] at hc | |
| norm_num at hc | |
| lemma filter_card_eq_two_three_neg {s r : Finset Labels} {p : Labels β Prop} | |
| [DecidablePred p] (hr : r.card = 3) (hrs : r β s) | |
| (hp : (s.filter p).card = 2) : β x β r, Β¬ p x := by | |
| by_contra hn | |
| have hsub : r β s.filter p := by | |
| intro x hx | |
| apply Finset.mem_filter.mpr | |
| refine β¨hrs hx, ?_β© | |
| by_contra hnp | |
| exact hn β¨x, hx, hnpβ© | |
| have hc := Finset.card_le_card hsub | |
| rw [hr, hp] at hc | |
| norm_num at hc | |
| lemma three_pos (h : TenSystem T Q) (S P R : Finset Labels) | |
| (hS : Q S) (hP : P β SαΆ) (hcP : P.card = 2) | |
| (hR : R β SαΆ \ P) (hcR : R.card = 3) : | |
| β w β R, T (insert w P) := by | |
| classical | |
| apply filter_card_eq_two_three_pos (s := SαΆ \ P) (r := R) ?_ hcR hR | |
| (h.pair_count S P hS hP hcP) | |
| rw [Finset.card_sdiff_of_subset hP, Finset.card_compl, h.tetra_card S hS, hcP] | |
| decide | |
| lemma three_neg (h : TenSystem T Q) (S P R : Finset Labels) | |
| (hS : Q S) (hP : P β SαΆ) (hcP : P.card = 2) | |
| (hR : R β SαΆ \ P) (hcR : R.card = 3) : | |
| β w β R, Β¬ T (insert w P) := by | |
| classical | |
| exact filter_card_eq_two_three_neg hcR hR (h.pair_count S P hS hP hcP) | |
| lemma tetra_extension {S U : Finset Labels} (hU : U β S) | |
| (hcS : S.card = 4) (hcU : U.card = 3) : | |
| β v, v β U β§ S = insert v U := by | |
| have hcard : (S \ U).card = 1 := by | |
| rw [Finset.card_sdiff_of_subset hU, hcS, hcU] | |
| obtain β¨v, hvβ© := Finset.card_eq_one.mp hcard | |
| have hm : v β S \ U := by rw [hv]; simp | |
| refine β¨v, (Finset.mem_sdiff.mp hm).2, ?_β© | |
| have he := Finset.sdiff_union_of_subset hU | |
| rw [hv] at he | |
| simpa using he.symm | |
| @[simp] lemma map_compl (e : Equiv.Perm Labels) (S : Finset Labels) : | |
| SαΆ.map e.toEmbedding = (S.map e.toEmbedding)αΆ := by | |
| ext x | |
| simp | |
| @[simp] lemma map_symm_map (e : Equiv.Perm Labels) (S : Finset Labels) : | |
| (S.map e.symm.toEmbedding).map e.toEmbedding = S := by | |
| ext x | |
| simp | |
| @[simp] lemma symm_map_map (e : Equiv.Perm Labels) (S : Finset Labels) : | |
| (S.map e.toEmbedding).map e.symm.toEmbedding = S := by | |
| ext x | |
| simp | |
| lemma TenSystem.relabel (h : TenSystem T Q) (e : Equiv.Perm Labels) : | |
| TenSystem (fun U => T (U.map e.toEmbedding)) | |
| (fun S => Q (S.map e.toEmbedding)) := by | |
| constructor | |
| Β· intro S hS | |
| simpa using h.tetra_card _ hS | |
| Β· intro S U hS hUS hcU | |
| exact h.down _ _ hS (Finset.map_subset_map.mpr hUS) (by simpa using hcU) | |
| Β· intro U hU | |
| obtain β¨S, hS, hUSβ© := h.pure _ hU | |
| refine β¨S.map e.symm.toEmbedding, ?_, ?_β© | |
| Β· simpa using hS | |
| Β· have hh := (Finset.map_subset_map (f := e.symm.toEmbedding)).mpr hUS | |
| simpa using hh | |
| Β· intro S U hS hUS hcU | |
| obtain β¨S', hS', hUS', hneβ© := h.no_boundary _ _ hS | |
| (Finset.map_subset_map.mpr hUS) (by simpa using hcU) | |
| refine β¨S'.map e.symm.toEmbedding, ?_, ?_, ?_β© | |
| Β· simpa using hS' | |
| Β· have hh := (Finset.map_subset_map (f := e.symm.toEmbedding)).mpr hUS' | |
| simpa using hh | |
| Β· intro he | |
| have hh := congrArg (Finset.map e.toEmbedding) he | |
| exact hne (by simpa using hh) | |
| Β· intro S U hS hUS hcU | |
| have hh := h.complementary _ _ hS | |
| (show U.map e.toEmbedding β (S.map e.toEmbedding)αΆ by | |
| rw [β map_compl] | |
| exact Finset.map_subset_map.mpr hUS) | |
| (by simpa using hcU) | |
| simpa [Finset.map_sdiff] using hh | |
| Β· intro S P hS hPS hcP | |
| have hh := h.pair_count _ _ hS | |
| (show P.map e.toEmbedding β (S.map e.toEmbedding)αΆ by | |
| rw [β map_compl] | |
| exact Finset.map_subset_map.mpr hPS) | |
| (by simpa using hcP) | |
| rw [β map_compl, β Finset.map_sdiff, Finset.filter_map, Finset.card_map] at hh | |
| simpa only [Function.comp_apply, Finset.map_insert] using hh | |
| end BorsukNine.FiniteObstruction | |
| end OAI | |