cases path with
| base _ =>
  rw [eq₃] at heq
  simp at heq
  have : nfa.nodes.size < nfa''.val.nodes.size := Nat.lt_trans nfa'.property nfa''.property
  exact (Nat.lt_irrefl _ (heq.left ▸ this)).elim
| @step _ j _ cs₁ cs₂ step' rest =>
  simp [eqs, heq.right]
  have eqStart : nfa'''.val[nfa'''.val.start.val] = .save (2 * i) nfa''.val.start := by
    rw [eq₃]
    simp
  cases step' with
  | charStep _ _ step => simp [eqStart, Node.charStep] at step
  | εStep _ _ step =>
    simp [eqStart, Node.εStep] at step
    subst step
    simp
    have : pathIn nfa'' nfa.nodes.size nfa''.val.start i' cs₂ := by
      apply rest.cast' (nfa''.val.start.isLt) (Nat.le_of_lt nfa'''.property)
      intro i _ h₂
      rw [eq₃, pushNode_get_lt _ h₂]
    have ⟨cs₃, cs₄, eqs, path', path''⟩ :=
      pathIn_split eq₂.symm (heq.left ▸ nfa'.property) (ge_pushRegex_start eq₂.symm) this
    cases path'' with
    | base _ =>
      simp at eqs
      exact eqs ▸ path'
    | step step rest =>
      have : nfa'.val.start.val < nfa''.val.nodes.size :=
        Nat.lt_trans nfa'.val.start.isLt nfa''.property
      have eqStart : nfa''.val[nfa'.val.start.val] = .save (2 * i + 1) next := by
        rw [pushRegex_get_lt eq₂.symm _ nfa'.val.start.isLt]
        rw [eq₁]
        simp
      have step := step.step
      simp [eqStart, Node.charStep, Node.εStep] at step
      subst step
      have := le_of_pathIn_left rest
      exact (Nat.lt_irrefl _ (Nat.lt_of_le_of_lt this next.isLt)).elim
case intro.intro.intro.intro.intro
nfa : NFA
next : Fin nfa.nodes.size
i : ℕ
r : Expr
result : { nfa' // nfa.nodes.size < nfa'.nodes.size }
cs : List Char
eq✝ : nfa.pushRegex next (Expr.group i r) = result
ih :
  ∀ {nfa : NFA} {next : Fin nfa.nodes.size} {result : { nfa' // nfa.nodes.size < nfa'.nodes.size }} {cs : List Char},
    nfa.pushRegex next r = result →
      (↑result).pathToNext (↑next) nfa.nodes.size (↑(↑result).start) cs → Expr.matches cs r
nfa' : { nfa' // nfa.nodes.size < nfa'.nodes.size }
nfa'' : { nfa'_1 // (↑nfa').nodes.size < nfa'_1.nodes.size }
nfa''' : { nfa'_1 // (↑nfa'').nodes.size < nfa'_1.nodes.size }
property : nfa.nodes.size < (↑nfa''').nodes.size
inBounds'✝ : (Node.save (2 * i + 1) ↑next).inBounds (nfa.nodes.size + 1)
inBounds'''✝ : (Node.save (2 * i) ↑(↑nfa'').start).inBounds ((↑nfa'').nodes.size + 1)
eq₁ : nfa' = nfa.pushNode (Node.save (2 * i + 1) ↑next) inBounds'✝
eq₂ : nfa'' = (↑nfa').pushRegex (↑nfa').start r
eq₃ : nfa''' = (↑nfa'').pushNode (Node.save (2 * i) ↑(↑nfa'').start) inBounds'''✝
eq : result = ⟨↑nfa''', property⟩
i' : ℕ
cs₁ cs₂ : List Char
eqs : cs = cs₁ ++ cs₂
path : (↑nfa''').pathIn nfa.nodes.size (↑(↑nfa''').start) i' cs₁
step : (↑nfa''').stepIn nfa.nodes.size i' (↑next) cs₂
heq : i' = nfa.nodes.size ∧ cs₂ = []
⊢ (↑nfa'').pathToNext (↑(↑nfa').start) (↑nfa').nodes.size (↑(↑nfa'').start) cs
no goals