∴LeanProofs
Learn Lean 4

Types, assumptions and goals

Distinguish a number from a proof of equality.

The variable a has type Nat: it is a number. The assumption hab has type a = b: it is evidence for an equality. A target a = c asks for the second kind of object. Merely naming a does not establish an equality. The correction must build evidence from the assumptions; rewriting the question to a = a would change the mathematical task. In a connected environment you would read the actual diagnostic and cursor goal. The descriptions here are author-written explanations.

Your task

Repair exact a without changing the statement. Identify which inputs are numbers and which inputs are evidence.

theorem equality_rewrite (a b c : Nat) (hab : a = b) (hbc : b = c) : a = c := by
  exact a
Exercise not verified. The target is a teaching task; changing it cannot earn a pass. A trusted fixed-challenge verifier is required before passes can be issued.
Show hints
  1. There are three numbers and two equality proofs in the context.
  2. You can combine hab and hbc rather than return a number.
  3. Reference idea: exact hab.trans hbc.

The repository’s six reference answers have a separate native type-and-axiom audit. This does not check or certify your edited answer. Read the reference audit (JSON)

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