internlm/Lean-Github huggingface dataset:
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
cases SparseSet.eq_or_mem_of_mem_insert hi with
| inl htarget =>
  subst htarget
  simp [εStep, Node.εStep, hn] at hj
| inr hnext =>
  match inv i j hnext hj with
  | .inl hnext => exact .inl (SparseSet.mem_insert_of_mem hnext)
  | .inr (.inl htarget) => exact .inl (htarget ▸ SparseSet.mem_insert)
  | .inr (.inr hstack) => exact .inr hstack
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
case inl
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
htarget : i = target
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
subst htarget
Proof state after:
case inl
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
i j : Fin nfa.nodes.size
hj : ↑j ∈ nfa.εStep ↑i
inv : LowerInvExploreεClosure nfa next i stack
h✝ : i ∉ next
hn : nfa[↑i] = Node.fail
h : εClosure nfa pos (next.insert i) currentSave matched saveSlots stack = (matched', next', saveSlots')
hi : i ∈ next.insert i
⊢ j ∈ next.insert i ∨ StackEntry.explore j ∈ stack
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
case inl
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
i j : Fin nfa.nodes.size
hj : ↑j ∈ nfa.εStep ↑i
inv : LowerInvExploreεClosure nfa next i stack
h✝ : i ∉ next
hn : nfa[↑i] = Node.fail
h : εClosure nfa pos (next.insert i) currentSave matched saveSlots stack = (matched', next', saveSlots')
hi : i ∈ next.insert i
⊢ j ∈ next.insert i ∨ StackEntry.explore j ∈ stack
Tactic:
simp [εStep, Node.εStep, hn] at hj
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
case inr
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
hnext : i ∈ next
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
match inv i j hnext hj with
| .inl hnext => exact .inl (SparseSet.mem_insert_of_mem hnext)
| .inr (.inl htarget) => exact .inl (htarget ▸ SparseSet.mem_insert)
| .inr (.inr hstack) => exact .inr hstack
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
hnext✝ : i ∈ next
hnext : j ∈ next
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
exact .inl (SparseSet.mem_insert_of_mem hnext)
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
hnext : i ∈ next
htarget : j = target
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
exact .inl (htarget ▸ SparseSet.mem_insert)
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_exploreεClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
target : Fin nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvExploreεClosure nfa next target stack
h✝ : target ∉ next
hn : nfa[↑target] = Node.fail
h : εClosure nfa pos (next.insert target) currentSave matched saveSlots stack = (matched', next', saveSlots')
i j : Fin nfa.nodes.size
hi : i ∈ next.insert target
hj : ↑j ∈ nfa.εStep ↑i
hnext : i ∈ next
hstack : StackEntry.explore j ∈ stack
⊢ j ∈ next.insert target ∨ StackEntry.explore j ∈ stack
Tactic:
exact .inr hstack
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : εClosure nfa pos next currentSave matched saveSlots stack = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next stack
⊢ LowerInvεClosure nfa next' #[]
Tactic:
unfold εClosure at h
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h :
  (if hemp : stack.isEmpty = true then (matched, next, saveSlots)
    else
      let entry := stack.back' hemp;
      let stack' := stack.pop;
      let_fun this := ⋯;
      match entry with
      | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
      | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h :
  (if hemp : stack.isEmpty = true then (matched, next, saveSlots)
    else
      let entry := stack.back' hemp;
      let stack' := stack.pop;
      let_fun this := ⋯;
      match entry with
      | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
      | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Tactic:
split at h
Proof state after:
case inl
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : stack.isEmpty = true
h : (matched, next, saveSlots) = (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]

case inr
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : ¬stack.isEmpty = true
h :
  (let entry := stack.back' h✝;
    let stack' := stack.pop;
    let_fun this := ⋯;
    match entry with
    | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
    | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
case inl
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : stack.isEmpty = true
h : (matched, next, saveSlots) = (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]

case inr
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : ¬stack.isEmpty = true
h :
  (let entry := stack.back' h✝;
    let stack' := stack.pop;
    let_fun this := ⋯;
    match entry with
    | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
    | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Tactic:
next hemp =>
  have : stack = #[] := Array.isEmpty_iff.mp hemp
  subst this
  have : next = next' := by
    simp at h
    simp only [h]
  subst this
  exact inv
Proof state after:
case inr
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : ¬stack.isEmpty = true
h :
  (let entry := stack.back' h✝;
    let stack' := stack.pop;
    let_fun this := ⋯;
    match entry with
    | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
    | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
case inr
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
h✝ : ¬stack.isEmpty = true
h :
  (let entry := stack.back' h✝;
    let stack' := stack.pop;
    let_fun this := ⋯;
    match entry with
    | StackEntry.explore target => exploreεClosure nfa pos next currentSave matched saveSlots target stack'
    | StackEntry.restore save => εClosure nfa pos next save matched saveSlots stack') =
    (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Tactic:
next hemp =>
  simp at h
  have : stack.pop.size < stack.size := Array.lt_size_of_pop_of_not_empty _ (by assumption)
  split at h
  next _ target heq =>
    have inv' : LowerInvExploreεClosure nfa next target stack.pop := by
      intro i j hi hj
      cases inv i j hi hj with
      | inl hnext => exact .inl hnext
      | inr hstack =>
        cases Array.mem_pop_or_eq_of_mem _ _ hemp hstack with
        | inl hstack => exact .inr (.inr hstack)
        | inr heq' =>
          rw [heq] at heq'
          have : j = target := by
            simp at heq'
            exact heq'
          exact .inr (.inl this)
    exact lower_inv_exploreεClosure h inv'
  next _ _ heq =>
    have inv' : LowerInvεClosure nfa next stack.pop := by
      intro i j hi hj
      cases inv i j hi hj with
      | inl hnext => exact .inl hnext
      | inr hstack =>
        cases Array.mem_pop_or_eq_of_mem _ _ hemp hstack with
        | inl hstack => exact .inr hstack
        | inr heq' =>
          rw [heq] at heq'
          contradiction
    exact lower_inv_εClosure h inv'
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
hemp : stack.isEmpty = true
h : (matched, next, saveSlots) = (matched', next', saveSlots')
⊢ LowerInvεClosure nfa next' #[]
Tactic:
have : stack = #[] := Array.isEmpty_iff.mp hemp
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
hemp : stack.isEmpty = true
h : (matched, next, saveSlots) = (matched', next', saveSlots')
this : stack = #[]
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
stack : Array (StackEntry nfa.nodes.size)
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next stack
hemp : stack.isEmpty = true
h : (matched, next, saveSlots) = (matched', next', saveSlots')
this : stack = #[]
⊢ LowerInvεClosure nfa next' #[]
Tactic:
subst this
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : (matched, next, saveSlots) = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : (matched, next, saveSlots) = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
⊢ LowerInvεClosure nfa next' #[]
Tactic:
have : next = next' := by
  simp at h
  simp only [h]
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : (matched, next, saveSlots) = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
this : next = next'
⊢ LowerInvεClosure nfa next' #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : (matched, next, saveSlots) = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
this : next = next'
⊢ LowerInvεClosure nfa next' #[]
Tactic:
subst this
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
h : (matched, next, saveSlots) = (matched', next, saveSlots')
⊢ LowerInvεClosure nfa next #[]
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
h : (matched, next, saveSlots) = (matched', next, saveSlots')
⊢ LowerInvεClosure nfa next #[]
Tactic:
exact inv
Proof state after:
no goals
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
h : (matched, next, saveSlots) = (matched', next', saveSlots')
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
⊢ next = next'
Tactic:
simp at h
Proof state after:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
h : matched = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ next = next'
Theorem: Regex.VM.lower_inv_εClosure
Proof state before:
nfa : NFA
pos : String.Pos
next : SparseSet nfa.nodes.size
currentSave : Array (Option String.Pos)
matched : Option (Array (Option String.Pos))
saveSlots : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
matched' : Option (Array (Option String.Pos))
next' : SparseSet nfa.nodes.size
saveSlots' : Data.Vec (Array (Option String.Pos)) nfa.nodes.size
inv : LowerInvεClosure nfa next #[]
hemp : #[].isEmpty = true
h : matched = matched' ∧ next = next' ∧ saveSlots = saveSlots'
⊢ next = next'
Tactic:
simp only [h]
Proof state after:
no goals