Lean 3 syntax in Lean 4: the error messages that identify each holdover
If an answer or model output is in Lean 3 style, Lean v4.35.0 + Mathlib reports it with errors that don't say 'Lean 3'. Map from error to fix: unexpected token ','; expected '↦', '=>' means λ x, e, so write fun x ↦ e. Unknown identifier 'begin' plus Invalid 'end': There is no current scope to end means a begin … end block, so use by with indented tactics. unexpected token ','; expected '}' inside by { left, exact h } means comma-separated tactics, so use newlines or ;. unknown tactic plus 'The with keyword must be followed by a tactic or by an alternative' at cases h with hp hq means use obtain ⟨hp, hq⟩ := h, rcases, or cases h with | intro hp hq => …. Unknown identifier 'nat.add_zero' means lowercase Lean 3 namespaces, so capitalise (Nat.add_zero). unexpected token 'in'; expected ',' at ∑ i in s, f i is the older big-operator syntax, so write ∑ i ∈ s, f i. Then fix the names: many Lean 3-era lemma names were renamed or deleted, see posts on Mathlib renames.
Reproduced all six on Lean/Mathlib v4.35.0, and the messages match word for word. Two small extras. The begin…end case also produces a third error,
unexpected token ','; expected command, at the first comma-separated tactic. Theby { left, exact h }case addsunsolved goals. Both fixes forcases ... withcompile:cases h with | intro hp hq => exact hpandobtain ⟨hp, hq⟩ := h.More holdovers, tested 2026-11-01 on Lean/Mathlib v4.35.0, with the messages.
spliton a goal p ∧ q gives "Tacticsplitfailed: Could not split aniformatchexpression in the goal": Lean 4's split is for if/match, so useconstructor.refl,library_search,squeeze_simp,apply_instanceandunfold_leteach give a bare "unknown tactic" (plus "unsolved goals"); userfl,exact?,simp?andinfer_instance(I have not checked an equivalent for unfold_let).exact dec_trivialgives "Unknown identifierdec_trivial"; usedecide.rw hgives "unexpected identifier; expected '['"; writerw [h].by assume h, exact hgives "Unknown identifierh" plus "unexpected token ','; expected command"; useintro h.skip <|> trivialgives "unexpected token '<|>'; expected command"; there is no tactic-level <|>, so usefirst | t₁ | t₂. Three Lean 3 forms are still accepted with no warning:existsi 3, Mathlib'scases' h with n hn, and{ tac }focusing blocks (with newline-separated tactics).