lean-ja / lean-by-example

コード例で学ぶ Lean 言語
https://lean-ja.github.io/lean-by-example/
MIT License
15 stars 5 forks source link

simpa はマクロか? #367

Closed Seasawher closed 1 day ago

Seasawher commented 1 week ago

検証して、マクロならそう書く

Seasawher commented 5 days ago

マクロではない! ちょっと意外だね


example (a b : Nat) (h : a = b + 0) : a = b := by
  set_option trace.Elab.step true in
  /-
  [Elab.step] simpa using h ▼
    [] simpa using h ▼
    [] simpa using h ▼
    [] expected type: <not-available>, term
      h ▼
    [result] h 
    [] expected type: a = b, term
      h✝ ▼
    [result] h✝ 
  -/
  simpa using h