Zulip Chat Archive
Stream: lean4
Topic: Dealing with f (h ▸ b)
Tomas Skrivan (Sep 24 2021 at 00:41):
Can I somehow rewrite f (h ▸ b)
to (h ▸ f b)
? I'm not even sure it is meaningful as I do not fully understand what ▸
does. Concretely, in my case f = PSigma.fst
and I would like to reduce PSigma.fst (h ▸ {fst := x, snd := y})
to h ▸ x
. How can I achieve that?
Mario Carneiro (Sep 24 2021 at 00:57):
Assuming that the statement typechecks, you should be able to prove this with cases h; rfl
Mario Carneiro (Sep 24 2021 at 00:57):
What is the type of h
in your example?
Mario Carneiro (Sep 24 2021 at 00:58):
This is the sort of goal you want to avoid having in the first place
Tomas Skrivan (Sep 24 2021 at 01:08):
The concrete term is:
PSigma.fst
((_ : Impl (subs (comp swap (comp (comp HAdd.hAdd) HAdd.hAdd)) _root_.id) = Impl fun x y => x + y + x) ▸
{ fst := fun x x_1 => x + x_1 + _root_.id x,
snd :=
(_ :
subs (comp swap (comp (comp HAdd.hAdd) HAdd.hAdd)) _root_.id =
subs (comp swap (comp (comp HAdd.hAdd) HAdd.hAdd)) _root_.id) })
x y
where
def Impl {α} (a : α) := (f : α) ×' (f = a)
Mario Carneiro (Sep 24 2021 at 01:37):
Do you have a #mwe?
Tomas Skrivan (Sep 24 2021 at 14:57):
I will try to produce one, but it will take me some time. For now, I have managed to avoid the problem as you have suggested :)
Last updated: Dec 20 2023 at 11:08 UTC