Zulip Chat Archive

Stream: lean4

Topic: multiple reverts delete hypotheses


Arien Malec (Jan 06 2023 at 02:27):

def Thing (α : Type u) : Type u := sorry

theorem foo {R : α  β  Prop} (C : Thing α  Thing β  Prop)
    (H :  {ca cb}, C ca cb  ca = cb) (Hc : C ca cb)
    (ha : True) : ca = cb := by
    revert ca cb; sorry

For this example, the hypothesis Hc is in the tactic state before the revert, and gone after

Arien Malec (Jan 06 2023 at 02:28):

I don't know if the Thing shenanigans are strictly necessary.

Arien Malec (Jan 06 2023 at 02:31):

De-Thinged

theorem foo {R : α  β  Prop} {a a' : α} {b b' : β} (C :  α   β  Prop)
    (H :  {ca cb}, C ca cb  a = a') (Hc : C ca cb)
    (ha : True) : b = b' := by
    revert ca cb; sorry

Same behavior.

Arien Malec (Jan 06 2023 at 02:38):

Also revert ca; revert cb; sorry has the same issues.

Gabriel Ebner (Jan 06 2023 at 02:43):

If you look closely Hc has been reverted as well.

Gabriel Ebner (Jan 06 2023 at 02:43):

You can't keep Hc after reverting: it's type depends on ca and cb. So it either needs to be deleted or reverted.

Arien Malec (Jan 06 2023 at 02:54):

ahh... I see it. and since it's dependent, it has to come after the \foralls. Thanks!


Last updated: Dec 20 2023 at 11:08 UTC