Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/FiniteCover.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.07 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/FiniteCover.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/FiniteCover.lean
-
curl -L -o FiniteCover.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/FiniteCover.lean
3.07 kB
| import Mathlib.Data.Finset.Card | |
| import Mathlib.Data.Fintype.BigOperators | |
| import Mathlib.Algebra.Order.BigOperators.Group.Finset | |
| import Mathlib.Data.Fintype.Card | |
| namespace OAI | |
| /-! Finite type counts, hierarchy separation and tensor execution bounds. -/ | |
| open scoped BigOperators | |
| namespace MatrixMultiplication.FiniteCover | |
| variable {Ξ© M G : Type*} | |
| theorem exists_avoiding [Fintype Ξ©] [DecidableEq Ξ©] [DecidableEq M] | |
| (s : Finset M) (bad : M β Finset Ξ©) (t : β) | |
| (hbad : β m β s, (bad m).card β€ t) | |
| (hbudget : s.card * t < Fintype.card Ξ©) : | |
| β Ο : Ξ©, β m β s, Ο β bad m := by | |
| classical | |
| have hcard : (s.biUnion bad).card β€ s.card * t := by | |
| calc | |
| (s.biUnion bad).card β€ β m β s, (bad m).card := Finset.card_biUnion_le | |
| _ β€ β _m β s, t := Finset.sum_le_sum fun m hm => hbad m hm | |
| _ = s.card * t := by simp | |
| by_contra hn | |
| have hsub : (Finset.univ : Finset Ξ©) β s.biUnion bad := by | |
| intro Ο hΟ | |
| by_contra hout | |
| apply hn | |
| refine β¨Ο, ?_β© | |
| intro m hm hmem | |
| exact hout (Finset.mem_biUnion.mpr β¨m, hm, hmemβ©) | |
| have := Finset.card_le_card hsub | |
| simp only [Finset.card_univ] at this | |
| exact (not_lt_of_ge (this.trans hcard)) hbudget | |
| def avoidingWords [Fintype G] [DecidableEq G] (bad : Finset G) (L : β) : | |
| Finset (Fin L β G) := Finset.univ.filter fun f => β i, f i β bad | |
| theorem card_avoidingWords [Fintype G] [DecidableEq G] (bad : Finset G) (L : β) : | |
| (avoidingWords bad L).card = bad.card ^ L := by | |
| classical | |
| let e : {f : Fin L β G // f β avoidingWords bad L} β (Fin L β {g // g β bad}) := | |
| { toFun := fun f i => β¨f.1 i, (Finset.mem_filter.mp f.2).2 iβ© | |
| invFun := fun f => β¨fun i => (f i).1, by simp [avoidingWords]β© | |
| left_inv := by intro f; rfl | |
| right_inv := by intro f; rfl } | |
| calc | |
| (avoidingWords bad L).card = Fintype.card {f : Fin L β G // f β avoidingWords bad L} := by simp | |
| _ = Fintype.card (Fin L β {g // g β bad}) := Fintype.card_congr e | |
| _ = bad.card ^ L := by simp | |
| theorem exists_cover [Fintype G] [DecidableEq G] [DecidableEq M] | |
| (s : Finset M) (good : G β M β Prop) [β g, DecidablePred (good g)] | |
| (t L : β) | |
| (hbad : β m β s, (Finset.univ.filter fun g => Β¬good g m).card β€ t) | |
| (hbudget : s.card * t ^ L < Fintype.card G ^ L) : | |
| β f : Fin L β G, β m β s, β i, good (f i) m := by | |
| classical | |
| let bad : M β Finset G := fun m => Finset.univ.filter fun g => Β¬good g m | |
| have hb : β m β s, (avoidingWords (bad m) L).card β€ t ^ L := by | |
| intro m hm | |
| rw [card_avoidingWords] | |
| exact Nat.pow_le_pow_left (hbad m hm) L | |
| obtain β¨f, hfβ© := exists_avoiding s (fun m => avoidingWords (bad m) L) (t ^ L) hb | |
| (by simpa using hbudget) | |
| refine β¨f, ?_β© | |
| intro m hm | |
| by_contra hn | |
| apply hf m hm | |
| simp only [avoidingWords, Finset.mem_filter, Finset.mem_univ, true_and] | |
| intro i | |
| simp only [bad, Finset.mem_filter, Finset.mem_univ, true_and] | |
| exact fun hi => hn β¨i, hiβ© | |
| end MatrixMultiplication.FiniteCover | |
| end OAI | |