Download full_collection/FinDFA.jsonl from DAPS-Math/DAPS-Blueprint: direct link, hf CLI and curl.
- Browser
- Download file 8.19 kB
-
https://huggingface.co/datasets/DAPS-Math/DAPS-Blueprint/resolve/main/full_collection/FinDFA.jsonl
- Command line
-
hf download hf://datasets/DAPS-Math/DAPS-Blueprint/full_collection/FinDFA.jsonl
-
curl -L -o FinDFA.jsonl https://huggingface.co/datasets/DAPS-Math/DAPS-Blueprint/resolve/main/full_collection/FinDFA.jsonl
8.19 kB
| {"id":"def:dfa","label":"dfa","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://AydenLamp.github.io/FinDFA/blueprint/dep_graph_document.html","dependencies":[],"nlp_text":"Mathlib provides a general definition of deterministic finite automata that does not require the state space or alphabet to be finite or have decidable equality. A DFA \\(\\alpha \\) \\(\\sigma \\) consists of: step : \\(\\sigma \\) \\(\\to \\) \\(\\alpha \\) \\(\\to \\) \\(\\sigma \\) - a transition function that maps a state and input symbol to a new state start : \\(\\sigma \\) - an initial state accept : Set \\(\\sigma \\) - a set of accepting states The DFA structure provides methods such as: eval : List \\(\\alpha \\) \\(\\to \\) \\(\\sigma \\) - evaluates a word from the start state evalFrom : \\(\\sigma \\) \\(\\to \\) List \\(\\alpha \\) \\(\\to \\) \\(\\sigma \\) - evaluates a word from a given state accepts : Set (List \\(\\alpha \\)) - the language accepted by the automaton Decidable equality means that for any two elements of a type, we can computationally determine whether they are equal or not. This is essential for implementing algorithms that need to compare states or symbols.","doc_url":null,"latex_link":"sect0001.html#def:dfa","lean_link":null,"lean_decl_name":"dfa","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":false,"proof_status":"nlp_only"} | |
| {"id":"lem:exists-short-access-word","label":"exists-short-access-word","background_color":"#1CAC78","border_color":"green","kind":"ellipse","dep_graph_url":"https://AydenLamp.github.io/FinDFA/blueprint/dep_graph_document.html","dependencies":["def:accessible-fin-dfa"],"nlp_text":"A fundamental result for implementing accessibility checking is that if a state is accessible by any word, then it is accessible by some word of length at most the number of states in the automaton. This bound follows from the pigeonhole principle: if a longer word exists, it must revisit some state, creating a loop that can be removed. This theorem enables us to create a decidable procedure for determining state accessibility. Instead of searching the infinite space of all possible words, we only need to check words up to a finite length bound. Using the getWordsLeqLength function, we can enumerate all words of bounded length and test each one. Furthermore, this allows us to implement a language-preserving conversion from any FinDFA to an AccessibleFinDFA by restricting the state space to only the accessible states. The resulting automaton accepts exactly the same language as the original.","doc_url":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/FinDFA.exists_short_access_word","latex_link":"sect0001.html#lem:exists-short-access-word","lean_link":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/FinDFA.exists_short_access_word","lean_decl_name":"FinDFA.exists_short_access_word","kind_description":"theorems and lemmas","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":false,"found_in_mathlib4v4.22.0":false,"source_repo":"FinDFA","source_path":"./MyProject/DFA/Accessible.lean","lean4_code":"theorem exists_short_access_word (s : σ) {w : List α}\n (hw : M.eval w = s) :\n ∃ v : List α, v.length ≤ Fintype.card σ ∧ M.eval v = s := by\n -- Strong recursion on the length of `w`\n refine (Nat.strongRecOn\n (motive := fun n => ∀ w : List α, w.length = n → M.eval w = s →\n ∃ v : List α, v.length ≤ Fintype.card σ ∧ M.eval v = s)\n w.length ?_ w rfl hw)\n simp_all\n intro n ih u hlen hu\n by_cases hshort : n ≤ Fintype.card σ\n · subst hlen\n use u\n · have hle : Fintype.card σ ≤ n := by exact Nat.le_of_not_ge hshort\n -- Use Mathlib's `DFA.evalFrom_split` lemma to split `w` into `a ++ b ++ c` with a loop on `b`.\n subst hlen\n have h := (M.evalFrom_split hle hu)\n rcases h with ⟨q, a, b, c, hsplit, hlen, hbne, hqa, hqb, hqc⟩\n simp_all\n have hlen₂ : (a ++ c).length < a.length + (b.length + c.length) := by\n simp_all\n exact List.length_pos_iff.mpr hbne\n specialize ih (a ++ c).length hlen₂ (a ++ c) rfl\n apply ih\n simp [eval, evalFrom_of_append, hqa, hqc]\n\nvariable [Fintype α] [DecidableEq α]\n\n/-- A state is accessible iff there exists a word accessing it in the Finset\nof all words of length less than or equal to the cardinality of the state-space. -/\n","line":188,"end_line":217,"proof_status":"formalized"} | |
| {"id":"def:fin-dfa","label":"fin-dfa","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://AydenLamp.github.io/FinDFA/blueprint/dep_graph_document.html","dependencies":[],"nlp_text":"We define FinDFA \\(\\alpha \\) \\(\\sigma \\) as a computable version of DFA \\(\\alpha \\) \\(\\sigma \\) that enables algorithmic manipulation. A FinDFA differs from a DFA in several key ways: It requires Fintype instances on both the alphabet \\(\\alpha \\) and state space \\(\\sigma \\). A Fintype is a type that has finitely many elements and provides a way to enumerate all of them. It requires DecidableEq instances on both types, enabling computational equality testing. The accepting states are represented as a Finset \\(\\sigma \\) rather than a Set \\(\\sigma \\). A Finset is a finite set that can be computationally manipulated, unlike the more general Set which may be infinite or non-computable. This structure allows for a decidable procedure to determine if a state is accepting - we can simply check membership in the finite set of accepting states. We provide a coercion from FinDFA to DFA, allowing us to use all the existing DFA definitions for evaluation and language acceptance.","doc_url":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/FinDFA","latex_link":"sect0001.html#def:fin-dfa","lean_link":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/FinDFA","lean_decl_name":"FinDFA","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":false,"source_repo":"remote_github","source_path":"https://raw.githubusercontent.com/AydenLamp/FinDFA/a817bff14f8dd08b3681cda1fa8bb87a89e64805/MyProject/Defs.lean","lean4_code":"/-- A computable DFA. Just like `DFA` but `accept` is a `Finset` -/\nstructure FinDFA (α : Type u) (σ : Type v) where\n /-- Transition function. -/\n step : σ → α → σ\n /-- Start state. -/\n start : σ\n /-- Accepting states as a `Finset`. -/\n accept : Finset σ","line":118,"end_line":125,"proof_status":"formalized"} | |
| {"id":"def:accessible-fin-dfa","label":"accessible-fin-dfa","background_color":"#B0ECA3","border_color":"green","kind":"box","dep_graph_url":"https://AydenLamp.github.io/FinDFA/blueprint/dep_graph_document.html","dependencies":["def:fin-dfa"],"nlp_text":"A state \\(s\\) in a FinDFA is called accessible if there exists some word \\(w\\) that reaches \\(s\\) from the start state. Formally, FinDFA.IsAccessibleState M s holds when there exists a word \\(w\\) such that evaluating \\(w\\) from the start state of \\(M\\) results in state \\(s\\). An AccessibleFinDFA is a structure that extends FinDFA with the additional requirement that every state in the automaton is accessible from the start state. This ensures that the automaton contains no \"dead\" or unreachable states.","doc_url":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/AccessibleFinDFA","latex_link":"sect0001.html#def:accessible-fin-dfa","lean_link":"https://AydenLamp.github.io/FinDFA/docs/find/#doc/AccessibleFinDFA","lean_decl_name":"AccessibleFinDFA","kind_description":"definitions","status_from_color":"formalized","lookup_in_mathlib4v4.22.0":true,"found_in_mathlib4v4.22.0":false,"source_repo":"remote_github","source_path":"https://raw.githubusercontent.com/AydenLamp/FinDFA/a817bff14f8dd08b3681cda1fa8bb87a89e64805/MyProject/Defs.lean","lean4_code":"/-- A DFA where every state is accessible from the start state. -/\nstructure AccessibleFinDFA (α : Type u) (σ : Type v) extends M : FinDFA α σ where\n is_accessible (s : σ) : M.IsAccessibleState s","line":290,"end_line":292,"proof_status":"formalized"} | |