Rewriting is directed substitution. In this variant the first equality is hba : b = a, while the target starts with a. A reverse rewrite uses the arrow syntax ← to move from a to b. After a rewrite, inspect the new target rather than guessing that a tactic solved it. The starter deliberately applies the wrong direction. Run the starter to read the actual diagnostic in the separately versioned browser environment. The hint describes the intended rewrite; it is not live compiler output.
Your task
Fix the rewrite direction and complete the equality without changing hba or hbc.
theorem reverse_rewrite (a b c : Nat) (hba : b = a) (hbc : b = c) : a = c := by
rw [hba]
exact hbc
Show hints
- The target contains a. The given equality starts with b.
- A reverse rewrite is written rw [← hba].
- Then the target is b = c, supplied by hbc.
When you get stuck
Read the expected type, compare it with your term, and change one line. The experimental browser checker provides actual diagnostics. Goal information is available at the checked cursor when the runtime supports it; it is a source snapshot, not a live language server. Independent exercise verification is not available.
Use the error repair guide