internlm/Lean-Github huggingface dataset:
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
case inl
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  (let_fun isLt := ⋯;
    let currentSave := saveSlots.get ↑target ⋯;
    exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true

case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
next =>
  simp at h
  exact exploreεClosure_mem_done_iff h (by simp; exact hnotDone)
Proof state after:
case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
next =>
  simp at h
  simp [←h]
  exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  (let_fun isLt := ⋯;
    let currentSave := saveSlots.get ↑target ⋯;
    exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp at h
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
exact exploreεClosure_mem_done_iff h (by simp; exact hnotDone)
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next, nfa[i] = Node.done) ↔ none.isSome = true
Tactic:
simp
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : c = c'✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Tactic:
exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp at h
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp [←h]
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
c'✝ : Char
target'✝ : ℕ
heq✝ : nfa[target] = Node.char c'✝ target'✝
h✝ : ¬c = c'✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Tactic:
exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h :
  (if c ∈ cs✝ then
      let_fun isLt := ⋯;
      let currentSave := saveSlots.get ↑target ⋯;
      exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]
    else (none, next, saveSlots)) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
split at h
Proof state after:
case inl
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  (let_fun isLt := ⋯;
    let currentSave := saveSlots.get ↑target ⋯;
    exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true

case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
case inl
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  (let_fun isLt := ⋯;
    let currentSave := saveSlots.get ↑target ⋯;
    exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true

case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
next =>
  simp at h
  exact exploreεClosure_mem_done_iff h (by simp; exact hnotDone)
Proof state after:
case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
case inr
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
next =>
  simp at h
  simp [←h]
  exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  (let_fun isLt := ⋯;
    let currentSave := saveSlots.get ↑target ⋯;
    exploreεClosure nfa pos next currentSave none saveSlots ⟨target'✝, isLt⟩ #[]) =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp at h
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
exact exploreεClosure_mem_done_iff h (by simp; exact hnotDone)
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ (∃ i ∈ next, nfa[i] = Node.done) ↔ none.isSome = true
Tactic:
simp
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∈ cs✝
h :
  exploreεClosure nfa pos next (saveSlots.get ↑target ⋯) none saveSlots ⟨target'✝, ⋯⟩ #[] =
    (matched', next', saveSlots')
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Tactic:
exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp at h
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp [←h]
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
cs✝ : Data.Classes
target'✝ : ℕ
heq✝ : nfa[target] = Node.sparse cs✝ target'✝
h✝ : c ∉ cs✝
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ ∀ (x : Fin nfa.nodes.size), next.mem x = true → ¬nfa[↑x] = Node.done
Tactic:
exact hnotDone
Proof state after:
no goals
Theorem: Regex.VM.stepChar_mem_done_iff
Proof state before:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
x✝¹ : ∀ (c' : Char) (target' : ℕ), nfa[target] = Node.char c' target' → False
x✝ : ∀ (cs : Data.Classes) (target' : ℕ), nfa[target] = Node.sparse cs target' → False
h : (none, next, saveSlots) = (matched', next', saveSlots')
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true
Tactic:
simp at h
Proof state after:
nfa : NFA
c : Char
pos : String.Pos
next : SparseSet nfa.nodes.size
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
hnotDone : ∀ i ∈ next, nfa[i] ≠ Node.done
x✝¹ : ∀ (c' : Char) (target' : ℕ), nfa[target] = Node.char c' target' → False
x✝ : ∀ (cs : Data.Classes) (target' : ℕ), nfa[target] = Node.sparse cs target' → False
h : none = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ (∃ i ∈ next', nfa[i] = Node.done) ↔ matched'.isSome = true