Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /IndependentSets /Expansion /PreprocessingRegularLoopWords.lean
| import Mathlib | |
| namespace OAI | |
| namespace IndependentSetsGames.Foundations.PCP.PreprocessingRegularLoopWords | |
| def blocksPrefix {n : Nat} (f : Fin n → List Bool) (k : Nat) : List Bool := | |
| ((List.ofFn f).take k).flatten | |
| def blocksSuffix {n : Nat} (f : Fin n → List Bool) (k : Nat) : List Bool := | |
| ((List.ofFn f).drop k).flatten | |
| @[simp] theorem blocksPrefix_zero {n : Nat} (f : Fin n → List Bool) : | |
| blocksPrefix f 0 = [] := by | |
| simp only [blocksPrefix, List.take_zero, List.flatten_nil] | |
| @[simp] theorem blocksPrefix_all {n : Nat} (f : Fin n → List Bool) : | |
| blocksPrefix f n = (List.ofFn f).flatten := by | |
| have h : (List.ofFn f).take n = List.ofFn f := by | |
| simpa only [List.length_ofFn] using (List.take_length (l := List.ofFn f)) | |
| exact congrArg List.flatten h | |
| theorem blocksPrefix_succ {n : Nat} (f : Fin n → List Bool) (k : Nat) (h : k < n) : | |
| blocksPrefix f (k + 1) = blocksPrefix f k ++ f ⟨k, h⟩ := by | |
| unfold blocksPrefix | |
| rw [List.take_succ_eq_append_getElem | |
| (show k < (List.ofFn f).length by simpa only [List.length_ofFn] using h)] | |
| simp only [List.flatten_append, List.flatten_cons, List.flatten_nil, | |
| List.append_nil, List.getElem_ofFn] | |
| @[simp] theorem blocksSuffix_zero {n : Nat} (f : Fin n → List Bool) : | |
| blocksSuffix f 0 = (List.ofFn f).flatten := by | |
| simp only [blocksSuffix, List.drop_zero] | |
| @[simp] theorem blocksSuffix_all {n : Nat} (f : Fin n → List Bool) : | |
| blocksSuffix f n = [] := by | |
| have h : (List.ofFn f).drop n = [] := by | |
| simpa only [List.length_ofFn] using (List.drop_length (l := List.ofFn f)) | |
| exact congrArg List.flatten h | |
| theorem blocksSuffix_succ {n : Nat} (f : Fin n → List Bool) (k : Nat) (h : k < n) : | |
| blocksSuffix f k = f ⟨k, h⟩ ++ blocksSuffix f (k + 1) := by | |
| unfold blocksSuffix | |
| rw [List.drop_eq_getElem_cons | |
| (show k < (List.ofFn f).length by simpa only [List.length_ofFn] using h)] | |
| simp only [List.flatten_cons, List.getElem_ofFn] | |
| theorem blocksPrefix_append_suffix {n : Nat} (f : Fin n → List Bool) (k : Nat) : | |
| blocksPrefix f k ++ blocksSuffix f k = (List.ofFn f).flatten := by | |
| unfold blocksPrefix blocksSuffix | |
| rw [← List.flatten_append, List.take_append_drop] | |
| end IndependentSetsGames.Foundations.PCP.PreprocessingRegularLoopWords | |
| end OAI | |
Xet Storage Details
- Size:
- 2.28 kB
- Xet hash:
- bce189414c4ca268b280d480f22528420decd38a4f2e17067e246e8ecc0c0133
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.