Download lean/OAI/Computability/StarHeight/Main.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 884 Bytes
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/StarHeight/Main.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Computability/StarHeight/Main.lean
-
curl -L -o Main.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/StarHeight/Main.lean
884 Bytes
| import OAI.Computability.StarHeight.Recognition | |
| namespace OAI | |
| namespace GeneralizedStarHeight | |
| universe u | |
| theorem main {Alphabet : Type u} [Finite Alphabet] (L : Language Alphabet) (hL : L.IsRegular) : | |
| HasHeightAtMost L 3 := by | |
| classical | |
| rcases isEmpty_or_nonempty Alphabet with h|h | |
| · let : IsEmpty Alphabet := h | |
| apply HasHeightAtMost.finite L _ 3 | |
| apply (Set.finite_singleton ([] : List Alphabet)).subset | |
| intro w _ | |
| cases w with | |
| | nil => rfl | |
| | cons a w => exact isEmptyElim a | |
| · let : Nonempty Alphabet := h | |
| obtain ⟨M,hM,hfin,T,F,hTF⟩ := FiniteRecognition.of_regular hL | |
| let : Monoid M := hM | |
| let : Fintype M := hfin | |
| have heq : L=({w | T (FreeMonoid.ofList w)∈F} : Language Alphabet) := by | |
| ext w | |
| exact hTF w | |
| rw [heq] | |
| exact FiniteRecognition.recognized_height_three T F | |
| end GeneralizedStarHeight | |
| end OAI | |