lean4-htt/tests/lean/beginEndAsMacro.lean
Leonardo de Moura 9a032cd261
feat: backward.isDefEq.respectTransparency (#12179)
This PR ensures `isDefEq` does not increase the transparency mode to
`.default` when checking whether implicit arguments are definitionally
equal. The previous behavior was creating scalability problems in
Mathlib. That said, this is a very disruptive change. The previous
behavior can be restored using the command
```
set_option backward.isDefEq.respectTransparency false
```
2026-02-16 15:57:21 +00:00

18 lines
457 B
Text

/- ANCHOR: doc -/
open Lean in
macro "begin " ts:tactic,*,? i:"end" : term => do
-- preserve position of the last token, which is used
-- as the error position in case of an unfinished proof
`(by { $[$ts:tactic]* }%$i)
theorem ex1 (x : Nat) : x + 0 = 0 + x :=
begin
rw [Nat.add_zero],
rw [Nat.zero_add]
end
/- ANCHOR_END: doc -/
theorem ex2 (x : Nat) : x + 0 = 0 + x :=
begin
rw [Nat.add_zero]
end -- error should be shown here