Zulip Chat Archive

Stream: lean4

Topic: OrdConnected.succOrder, type classes are confusing


Nir Paz (Nov 22 2024 at 20:22):

I want to prove this, which I think is true if the inherited SuccOrder is the obvious one:

import Mathlib

open Set Order

example {o : Ordinal} {h : o.IsLimit} {α : Iio o} : (succ α).1 = α.1 + 1 := sorry

I'm having a lot of trouble just getting to the actual definition of succ here. It's inherited through many layers of type classes (from Iio α being ordConnected) and I can't find a theorem that just "says" what it is. I don't know how to deal with this except by naively unfolding everything, which only gets me even more confusing proof states.

Ruben Van de Velde (Nov 22 2024 at 20:53):

If such a lemma is missing and you know what it should be, you can write the lemma yourself with proof rfl

Nir Paz (Nov 22 2024 at 20:59):

I guess the lemma would be that if S is an OrdConnected subtype of something and s : S is such that there is an element of S above it, then (succ s).1 = succ s.1 (not 100% this is true, I'm extrapolating from the OrdConnected requirement). But I straight up can't prove this.

Matt Diamond (Nov 22 2024 at 21:36):

import Mathlib

open Set Order

example {o : Ordinal} {h : o.IsLimit} {α : Iio o} : (succ α).1 = α.1 + 1 :=
by
  rw [Ordinal.add_one_eq_succ]
  apply coe_succ_of_mem
  have := Subtype.mem α
  rw [mem_Iio] at this 
  exact h.succ_lt this

Matt Diamond (Nov 22 2024 at 21:37):

I think docs#coe_succ_of_mem might've been the missing piece here

Nir Paz (Nov 22 2024 at 23:06):

Thanks!


Last updated: May 02 2025 at 03:31 UTC