Download lean/OAI/Computability/StarHeight/Model.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/StarHeight/Model.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Computability/StarHeight/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/StarHeight/Model.lean
1.23 kB
| import Mathlib | |
| namespace OAI | |
| namespace GeneralizedStarHeight | |
| universe u | |
| inductive Expression (Alphabet : Type u) : Type u | |
| | zero : Expression Alphabet | |
| | one : Expression Alphabet | |
| | letter : Alphabet → Expression Alphabet | |
| | union : Expression Alphabet → Expression Alphabet → Expression Alphabet | |
| | concat : Expression Alphabet → Expression Alphabet → Expression Alphabet | |
| | compl : Expression Alphabet → Expression Alphabet | |
| | star : Expression Alphabet → Expression Alphabet | |
| namespace Expression | |
| open scoped Computability | |
| def language {Alphabet : Type u} : Expression Alphabet → Language Alphabet | |
| | .zero => 0 | |
| | .one => 1 | |
| | .letter a => {[a]} | |
| | .union P Q => P.language + Q.language | |
| | .concat P Q => P.language * Q.language | |
| | .compl P => P.languageᶜ | |
| | .star P => P.language∗ | |
| def height {Alphabet : Type u} : Expression Alphabet → ℕ | |
| | .zero | .one | .letter _ => 0 | |
| | .union P Q | .concat P Q => max P.height Q.height | |
| | .compl P => P.height | |
| | .star P => 1 + P.height | |
| end Expression | |
| def HasHeightAtMost {Alphabet : Type u} (L : Language Alphabet) (n : ℕ) : Prop := | |
| ∃ P : Expression Alphabet, P.language = L ∧ P.height ≤ n | |
| end GeneralizedStarHeight | |
| end OAI | |