Zulip Chat Archive

Stream: general

Topic: Proving lemma without doing pattern matching


petercommand (Jan 14 2019 at 15:31):

lemma eq.subst' {α : Sort u} {a b : α} {P : Π (m: α), (m = a) ∨ (m = b) → Prop}
    (h₁ : a = b) (h₂ : P a (or.inl rfl)) : P b (or.inr rfl) := by cases h₁; assumption

Is it possible to prove this lemma with eliminators without doing pattern matching?

petercommand (Jan 14 2019 at 15:33):

In this example, I am trying to prove a variant of the traditional Leibniz equality (subst)

Patrick Massot (Jan 14 2019 at 15:40):

Of course it's possible, this is what Lean does in the end. You can #print eq.subst'. Or am I missing something?

petercommand (Jan 14 2019 at 16:12):

You are right, it's just that I need to set_option pp.implicit true before #print eq.subst'

petercommand (Jan 14 2019 at 16:16):

I thought the generated program doesn't typecheck

Patrick Massot (Jan 16 2019 at 17:35):

(deleted)


Last updated: Dec 20 2023 at 11:08 UTC