Zulip Chat Archive
Stream: lean4
Topic: Implicit argument by tactic
Cody Roux (Sep 20 2024 at 03:11):
How might one define a notation where an argument is filled at use-time by a tactic execution?
Chris Bailey (Sep 20 2024 at 03:23):
Is this what you're describing? https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.E2.9C.94.20Implicit.20evidences.20with.20simp.20proofs/near/462600813
Cody Roux (Sep 20 2024 at 15:32):
Yep, coolio. Don't understand the evaluation semantics of default args though. Are they all lazy like this?
Floris van Doorn (Sep 20 2024 at 15:40):
I believe that (h : T := t)
and (h : T := by tac)
are treated quite/completely differently by Lean.
Yury G. Kudryashov (Sep 20 2024 at 17:06):
If you write (h : T := t)
, then t
has to make sense and have a correct type at the moment of declaration of your lemma/def. If you write (h : T := by tac)
, then it is stored as a Syntax
, then executed whenever you apply
your lemma.
Last updated: May 02 2025 at 03:31 UTC