internlm/Lean-Github huggingface dataset:
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
have : i < nfa.nodes.size + 1 := by
  have := step.h₂
  simp at this
  exact this
Proof state after:
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ Expr.matches cs Expr.epsilon
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ Expr.matches cs Expr.epsilon
Tactic:
have : i = nfa.nodes.size := Nat.eq_of_le_of_lt_succ (le_of_pathIn_right path) this
Proof state after:
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this✝ : i < nfa.nodes.size + 1
this : i = nfa.nodes.size
⊢ Expr.matches cs Expr.epsilon
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this✝ : i < nfa.nodes.size + 1
this : i = nfa.nodes.size
⊢ Expr.matches cs Expr.epsilon
Tactic:
cases step <;> simp [this, NFA.Node.charStep, NFA.Node.εStep] at *
Proof state after:
case intro.intro.intro.intro.intro.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝ : List Char
h₂✝ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
path : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size nfa.nodes.size nfa.nodes.size w✝
this✝ this h₁✝ step✝ : True
eqs : cs = w✝
⊢ Expr.matches cs Expr.epsilon
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝ : List Char
h₂✝ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
path : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size nfa.nodes.size nfa.nodes.size w✝
this✝ this h₁✝ step✝ : True
eqs : cs = w✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
cases path with
| base _ => exact eqs ▸ .epsilon
| step step rest =>
  cases step with
  | charStep _ _ step => simp [NFA.Node.charStep] at step
  | εStep _ _ step =>
    simp [NFA.Node.εStep] at step
    have := le_of_pathIn_left rest
    exact absurd next.isLt (Nat.not_lt_of_ge (step ▸ this))
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
⊢ i < nfa.nodes.size + 1
Tactic:
have := step.h₂
Proof state after:
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
⊢ i < nfa.nodes.size + 1
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
⊢ i < nfa.nodes.size + 1
Tactic:
simp at this
Proof state after:
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ i < nfa.nodes.size + 1
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
eqs : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ i < nfa.nodes.size + 1
Tactic:
exact this
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.base
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝ step✝ : True
h✝ : nfa.nodes.size ≤ nfa.nodes.size
eqs : cs = []
⊢ Expr.matches cs Expr.epsilon
Tactic:
exact eqs ▸ .epsilon
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.step
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝ step✝ : True
j✝ : ℕ
cs₁✝ cs₂✝ : List Char
step : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).stepIn nfa.nodes.size nfa.nodes.size j✝ cs₁✝
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
eqs : cs = cs₁✝ ++ cs₂✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
cases step with
| charStep _ _ step => simp [NFA.Node.charStep] at step
| εStep _ _ step =>
  simp [NFA.Node.εStep] at step
  have := le_of_pathIn_left rest
  exact absurd next.isLt (Nat.not_lt_of_ge (step ▸ this))
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.step.charStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
c✝ : Char
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
step : j✝ ∈ (↑(nfa.pushNode (Node.epsilon ↑next) ⋯))[nfa.nodes.size].charStep c✝
eqs : cs = [c✝] ++ cs₂✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
simp [NFA.Node.charStep] at step
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.step.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
step : j✝ ∈ (↑(nfa.pushNode (Node.epsilon ↑next) ⋯))[nfa.nodes.size].εStep
eqs : cs = [] ++ cs₂✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
simp [NFA.Node.εStep] at step
Proof state after:
case intro.intro.intro.intro.intro.εStep.step.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
eqs : cs = [] ++ cs₂✝
step : j✝ = ↑next
⊢ Expr.matches cs Expr.epsilon
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.step.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝ this h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
eqs : cs = [] ++ cs₂✝
step : j✝ = ↑next
⊢ Expr.matches cs Expr.epsilon
Tactic:
have := le_of_pathIn_left rest
Proof state after:
case intro.intro.intro.intro.intro.εStep.step.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝¹ this✝ h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
eqs : cs = [] ++ cs₂✝
step : j✝ = ↑next
this : nfa.nodes.size ≤ j✝
⊢ Expr.matches cs Expr.epsilon
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.εStep.step.εStep
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next Expr.epsilon = result
eq : result = nfa.pushNode (Node.epsilon ↑next) ⋯
i : ℕ
h₂✝¹ : i < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
this✝¹ this✝ h₁✝¹ step✝ : True
j✝ : ℕ
cs₂✝ : List Char
rest : (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).pathIn nfa.nodes.size j✝ nfa.nodes.size cs₂✝
h₁✝ : nfa.nodes.size ≤ nfa.nodes.size
h₂✝ : nfa.nodes.size < (↑(nfa.pushNode (Node.epsilon ↑next) ⋯)).nodes.size
eqs : cs = [] ++ cs₂✝
step : j✝ = ↑next
this : nfa.nodes.size ≤ j✝
⊢ Expr.matches cs Expr.epsilon
Tactic:
exact absurd next.isLt (Nat.not_lt_of_ge (step ▸ this))
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case char
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq : nfa.pushRegex next (Expr.char c) = result
path : (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs
⊢ Expr.matches cs (Expr.char c)
Tactic:
apply pushRegex.char eq
Proof state after:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq : nfa.pushRegex next (Expr.char c) = result
path : (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs
⊢ result = nfa.pushNode (Node.char c ↑next) ⋯ → Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq : nfa.pushRegex next (Expr.char c) = result
path : (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs
⊢ result = nfa.pushNode (Node.char c ↑next) ⋯ → Expr.matches cs (Expr.char c)
Tactic:
intro eq
Proof state after:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
path : (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
path : (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
⊢ Expr.matches cs (Expr.char c)
Tactic:
rw [eq] at path
Proof state after:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathToNext (↑next) nfa.nodes.size
    (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) cs
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathToNext (↑next) nfa.nodes.size
    (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) cs
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
⊢ Expr.matches cs (Expr.char c)
Tactic:
obtain ⟨i, _, _, _, path, step⟩ := path
Proof state after:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
⊢ Expr.matches cs (Expr.char c)
Tactic:
have : i < nfa.nodes.size + 1 := by
  have := step.h₂
  simp at this
  exact this
Proof state after:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ Expr.matches cs (Expr.char c)
Tactic:
have : i = nfa.nodes.size := Nat.eq_of_le_of_lt_succ (le_of_pathIn_right path) this
Proof state after:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this✝ : i < nfa.nodes.size + 1
this : i = nfa.nodes.size
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this✝ : i < nfa.nodes.size + 1
this : i = nfa.nodes.size
⊢ Expr.matches cs (Expr.char c)
Tactic:
cases step <;> simp [this, NFA.Node.charStep, NFA.Node.εStep] at *
Proof state after:
case intro.intro.intro.intro.intro.charStep
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝ : List Char
c✝ : Char
h₂✝ : i < (↑(nfa.pushNode (Node.char c ↑next) ⋯)).nodes.size
left✝ : cs = w✝ ++ [c✝]
path : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size nfa.nodes.size nfa.nodes.size w✝
this✝ this h₁✝ : True
step✝ : c✝ = c
⊢ Expr.matches cs (Expr.char c)
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
case intro.intro.intro.intro.intro.charStep
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝ : List Char
c✝ : Char
h₂✝ : i < (↑(nfa.pushNode (Node.char c ↑next) ⋯)).nodes.size
left✝ : cs = w✝ ++ [c✝]
path : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size nfa.nodes.size nfa.nodes.size w✝
this✝ this h₁✝ : True
step✝ : c✝ = c
⊢ Expr.matches cs (Expr.char c)
Tactic:
cases path with
| base _ =>
  simp [*]
  exact .char c
| step step rest =>
  cases step with
  | charStep _ _ step =>
    simp [NFA.Node.charStep] at step
    have := le_of_pathIn_left rest
    exact absurd next.isLt (Nat.not_lt_of_ge (step.right ▸ this))
  | εStep _ _ step => simp [NFA.Node.εStep] at step
Proof state after:
no goals
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
⊢ i < nfa.nodes.size + 1
Tactic:
have := step.h₂
Proof state after:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < (↑(nfa.pushNode (Node.char c ↑next) ⋯)).nodes.size
⊢ i < nfa.nodes.size + 1
Theorem: Regex.NFA.matches_of_pathToNext_pushRegex
Proof state before:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < (↑(nfa.pushNode (Node.char c ↑next) ⋯)).nodes.size
⊢ i < nfa.nodes.size + 1
Tactic:
simp at this
Proof state after:
c : Char
nfa : NFA
next : Fin nfa.nodes.size
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.char c) = result
eq : result = nfa.pushNode (Node.char c ↑next) ⋯
i : ℕ
w✝¹ w✝ : List Char
left✝ : cs = w✝¹ ++ w✝
path :
  (↑(nfa.pushNode (Node.char c ↑next) ⋯)).pathIn nfa.nodes.size (↑(↑(nfa.pushNode (Node.char c ↑next) ⋯)).start) i w✝¹
step : (↑(nfa.pushNode (Node.char c ↑next) ⋯)).stepIn nfa.nodes.size i (↑next) w✝
this : i < nfa.nodes.size + 1
⊢ i < nfa.nodes.size + 1