Skip to content

Commit 8f87bbb

Browse files
committed
little more explanation
1 parent ae2ee35 commit 8f87bbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CustomSimpRw.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,16 @@ of transitivity.
314314
-/
315315
example (a b c : Nat) (pf1 : a = b) (pf2 : b = c) : True := by
316316
-- we would like to emulate calling something like
317-
have pf3 := Eq.trans pf1 pf2
317+
have pf3 : a = c := Eq.trans pf1 pf2
318318
-- but the full expression we want to build is
319319
have pf3' := @Eq.trans.{1} Nat a b c pf1 pf2
320320
-- on tactic level, we have several ways to construct it
321321
run_tacq
322322
-- (a) low-level constructing the term, we have to provide all the arguments
323323
let lowlev := mkApp6 ((mkConst ``Eq.trans [1])) (mkConst ``Nat) a b c pf1 pf2
324324
logInfo m!"lowlev = {lowlev}"
325-
-- (b) using `Qq`
326-
let pfQ := q(Eq.trans $pf1 $pf2)
325+
-- (b) using `Qq`, the type annotation is optional
326+
let pfQ : Q($a = $c) := q(Eq.trans $pf1 $pf2)
327327
logInfo m!"pfq = {pfQ}"
328328
-- (c) using `mkAppM`
329329
let pfAppM ← mkAppM ``Eq.trans #[pf1, pf2]

0 commit comments

Comments
 (0)