exact ContextFreeGrammar.derivation_preserves_prefix d h_lhs' h_rhs
α nt : Type
P : Finset α → Finset nt → Type
i : Production.ContextFree α nt P
G : Grammar P
lhs rhs : Word ({ x // x ∈ G.V } ⊕ { x // x ∈ G.Z })
w : Word { x // x ∈ G.Z }
xs : Word ({ x // x ∈ G.V } ⊕ { x // x ∈ G.Z })
a : { x // x ∈ G.Z }
d✝ : Grammar.Derivation G lhs rhs
h_lhs : lhs = Sum.inr a :: xs
h_rhs : rhs = Sum.inr <$> w
u'✝ : Word ({ x // x ∈ G.V } ⊕ { x // x ∈ G.Z })
s : Grammar.DerivationStep G lhs
d : Grammar.Derivation G u'✝ rhs
r : Sum.inr a :: (List.tail s.pre ++ (Production.rhs ↑s.prod ++ s.suf)) = u'✝
h_lhs' : u'✝ = Sum.inr a :: (List.tail s.pre ++ (Production.rhs ↑s.prod ++ s.suf)) := r.symm
⊢ w = a :: List.tail w
no goals