File: Mathlib/Order/InitialSeg.lean

full_name: InitialSeg
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
structure InitialSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The order embedding is an initial segment -/
  init' : ∀ a b, s b (toRelEmbedding a) → ∃ a', toRelEmbedding a' = b
goal: Type (max u_4 u_5)

full_name: InitialSeg.init'
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
structure InitialSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The order embedding is an initial segment -/
  init' : ∀ a b, s b (toRelEmbedding a) → ∃ a', toRelEmbedding a' = b
goal: s b (self.toRelEmbedding a) → ∃ a', self.toRelEmbedding a' = b

full_name: _aux_Mathlib_Order_InitialSeg___unexpand_InitialSeg_1
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
infixl:25 " ≼i " => InitialSeg
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Order_InitialSeg___macroRules_term_≼i__1»
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
infixl:25 " ≼i " => InitialSeg
goal: Lean.Macro

full_name: InitialSeg.instCoeRelEmbedding
code: instance : Coe (r ≼i s) (r ↪r s) 
goal: Coe (r ≼i s) (r ↪r s)

full_name: InitialSeg.instFunLike
code: instance : FunLike (r ≼i s) α β 
goal: FunLike (r ≼i s) α β

full_name: InitialSeg.instEmbeddingLike
code: instance : EmbeddingLike (r ≼i s) α β 
goal: EmbeddingLike (r ≼i s) α β

full_name: InitialSeg.ext
code: @[ext] lemma ext {f g : r ≼i s} (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: InitialSeg.coe_coe_fn
code: @[simp]
theorem coe_coe_fn (f : r ≼i s) : ((f : r ↪r s) : α → β) = f 
goal: ⇑f.toRelEmbedding = ⇑f

full_name: InitialSeg.init
code: theorem init (f : r ≼i s) {a : α} {b : β} : s b (f a) → ∃ a', f a' = b 
goal: s b (f a) → ∃ a', f a' = b

full_name: InitialSeg.map_rel_iff
code: theorem map_rel_iff {a b : α} (f : r ≼i s) : s (f a) (f b) ↔ r a b 
goal: s (f a) (f b) ↔ r a b

full_name: InitialSeg.init_iff
code: theorem init_iff (f : r ≼i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a 
goal: s b (f a) ↔ ∃ a', f a' = b ∧ r a' a

full_name: InitialSeg.ofIso
code: /-- An order isomorphism is an initial segment -/
def ofIso (f : r ≃r s) : r ≼i s 
goal: r ≼i s

full_name: InitialSeg.refl
code: /-- The identity function shows that `≼i` is reflexive -/
@[refl]
protected def refl (r : α → α → Prop) : r ≼i r 
goal: r ≼i r

full_name: InitialSeg.instInhabited
code: instance (r : α → α → Prop) : Inhabited (r ≼i r) 
goal: Inhabited (r ≼i r)

full_name: InitialSeg.trans
code: /-- Composition of functions shows that `≼i` is transitive -/
@[trans]
protected def trans (f : r ≼i s) (g : s ≼i t) : r ≼i t 
goal: r ≼i t

full_name: InitialSeg.refl_apply
code: @[simp]
theorem refl_apply (x : α) : InitialSeg.refl r x = x 
goal: (InitialSeg.refl r) x = x

full_name: InitialSeg.trans_apply
code: @[simp]
theorem trans_apply (f : r ≼i s) (g : s ≼i t) (a : α) : (f.trans g) a = g (f a) 
goal: (f.trans g) a = g (f a)

full_name: InitialSeg.subsingleton_of_trichotomous_of_irrefl
code: instance subsingleton_of_trichotomous_of_irrefl [IsTrichotomous β s] [IsIrrefl β s]
    [IsWellFounded α r] : Subsingleton (r ≼i s) 
goal: Subsingleton (r ≼i s)

full_name: InitialSeg.instSubsingletonOfIsWellOrder
code: instance [IsWellOrder β s] : Subsingleton (r ≼i s) 
goal: Subsingleton (r ≼i s)

full_name: InitialSeg.eq
code: protected theorem eq [IsWellOrder β s] (f g : r ≼i s) (a) : f a = g a 
goal: f a = g a

full_name: InitialSeg.Antisymm.aux
code: theorem Antisymm.aux [IsWellOrder α r] (f : r ≼i s) (g : s ≼i r) : LeftInverse g f 
goal: Function.LeftInverse ⇑g ⇑f

full_name: InitialSeg.antisymm
code: /-- If we have order embeddings between `α` and `β` whose images are initial segments, and `β`
is a well-order then `α` and `β` are order-isomorphic. -/
def antisymm [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : r ≃r s 
goal: r ≃r s

full_name: InitialSeg.antisymm_toFun
code: @[simp]
theorem antisymm_toFun [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : (antisymm f g : α → β) = f 
goal: ⇑(f.antisymm g) = ⇑f

full_name: InitialSeg.antisymm_symm
code: @[simp]
theorem antisymm_symm [IsWellOrder α r] [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) :
    (antisymm f g).symm = antisymm g f 
goal: (f.antisymm g).symm = g.antisymm f

full_name: InitialSeg.eq_or_principal
code: theorem eq_or_principal [IsWellOrder β s] (f : r ≼i s) :
    Surjective f ∨ ∃ b, ∀ x, s x b ↔ ∃ y, f y = x 
goal: Function.Surjective ⇑f ∨ ∃ b, ∀ (x : β), s x b ↔ ∃ y, f y = x

full_name: InitialSeg.codRestrict
code: /-- Restrict the codomain of an initial segment -/
def codRestrict (p : Set β) (f : r ≼i s) (H : ∀ a, f a ∈ p) : r ≼i Subrel s p 
goal: r ≼i Subrel s p

full_name: InitialSeg.codRestrict_apply
code: @[simp]
theorem codRestrict_apply (p) (f : r ≼i s) (H a) : codRestrict p f H a = ⟨f a, H a⟩ 
goal: (InitialSeg.codRestrict p f H) a = ⟨f a, ⋯⟩

full_name: InitialSeg.ofIsEmpty
code: /-- Initial segment from an empty type. -/
def ofIsEmpty (r : α → α → Prop) (s : β → β → Prop) [IsEmpty α] : r ≼i s 
goal: r ≼i s

full_name: InitialSeg.leAdd
code: /-- Initial segment embedding of an order `r` into the disjoint union of `r` and `s`. -/
def leAdd (r : α → α → Prop) (s : β → β → Prop) : r ≼i Sum.Lex r s 
goal: r ≼i Sum.Lex r s

full_name: InitialSeg.leAdd_apply
code: @[simp]
theorem leAdd_apply (r : α → α → Prop) (s : β → β → Prop) (a) : leAdd r s a = Sum.inl a 
goal: (InitialSeg.leAdd r s) a = Sum.inl a

full_name: InitialSeg.acc
code: protected theorem acc (f : r ≼i s) (a : α) : Acc r a ↔ Acc s (f a) 
goal: Acc r a ↔ Acc s (f a)

full_name: PrincipalSeg.top
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
structure PrincipalSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The supremum of the principal segment -/
  top : β
  /-- The image of the order embedding is the set of elements `b` such that `s b top` -/
  down' : ∀ b, s b top ↔ ∃ a, toRelEmbedding a = b
goal: β

full_name: PrincipalSeg.down'
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
structure PrincipalSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The supremum of the principal segment -/
  top : β
  /-- The image of the order embedding is the set of elements `b` such that `s b top` -/
  down' : ∀ b, s b top ↔ ∃ a, toRelEmbedding a = b
goal: s b self.top ↔ ∃ a, self.toRelEmbedding a = b

full_name: PrincipalSeg
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
structure PrincipalSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
  /-- The supremum of the principal segment -/
  top : β
  /-- The image of the order embedding is the set of elements `b` such that `s b top` -/
  down' : ∀ b, s b top ↔ ∃ a, toRelEmbedding a = b
goal: Type (max u_4 u_5)

full_name: «_aux_Mathlib_Order_InitialSeg___macroRules_term_≺i__1»
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
infixl:25 " ≺i " => PrincipalSeg
goal: Lean.Macro

full_name: _aux_Mathlib_Order_InitialSeg___unexpand_PrincipalSeg_1
code: /-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
infixl:25 " ≺i " => PrincipalSeg
goal: Lean.PrettyPrinter.Unexpander

full_name: PrincipalSeg.instCoeOutRelEmbedding
code: instance : CoeOut (r ≺i s) (r ↪r s) 
goal: CoeOut (r ≺i s) (r ↪r s)

full_name: PrincipalSeg.instCoeFunForall
code: instance : CoeFun (r ≺i s) fun _ => α → β 
goal: CoeFun (r ≺i s) fun x => α → β

full_name: PrincipalSeg.coe_fn_mk
code: @[simp]
theorem coe_fn_mk (f : r ↪r s) (t o) : (@PrincipalSeg.mk _ _ r s f t o : α → β) = f 
goal: ⇑{ toRelEmbedding := f, top := t, down' := o }.toRelEmbedding = ⇑f

full_name: PrincipalSeg.down
code: theorem down (f : r ≺i s) : ∀ {b : β}, s b f.top ↔ ∃ a, f a = b 
goal: s b f.top ↔ ∃ a, f.toRelEmbedding a = b

full_name: PrincipalSeg.lt_top
code: theorem lt_top (f : r ≺i s) (a : α) : s (f a) f.top 
goal: s (f.toRelEmbedding a) f.top

full_name: PrincipalSeg.init
code: theorem init [IsTrans β s] (f : r ≺i s) {a : α} {b : β} (h : s b (f a)) : ∃ a', f a' = b 
goal: ∃ a', f.toRelEmbedding a' = b

full_name: PrincipalSeg.hasCoeInitialSeg
code: /-- A principal segment is in particular an initial segment. -/
instance hasCoeInitialSeg [IsTrans β s] : Coe (r ≺i s) (r ≼i s) 
goal: Coe (r ≺i s) (r ≼i s)

full_name: PrincipalSeg.coe_coe_fn'
code: theorem coe_coe_fn' [IsTrans β s] (f : r ≺i s) : ((f : r ≼i s) : α → β) = f 
goal: ⇑{ toRelEmbedding := f.toRelEmbedding, init' := ⋯ } = ⇑f.toRelEmbedding

full_name: PrincipalSeg.init_iff
code: theorem init_iff [IsTrans β s] (f : r ≺i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a 
goal: s b (f.toRelEmbedding a) ↔ ∃ a', f.toRelEmbedding a' = b ∧ r a' a

full_name: PrincipalSeg.irrefl
code: theorem irrefl {r : α → α → Prop} [IsWellOrder α r] (f : r ≺i r) : False 
goal: False

full_name: PrincipalSeg.instIsEmptyOfIsWellOrder
code: instance (r : α → α → Prop) [IsWellOrder α r] : IsEmpty (r ≺i r) 
goal: IsEmpty (r ≺i r)

full_name: PrincipalSeg.ltLe
code: /-- Composition of a principal segment with an initial segment, as a principal segment -/
def ltLe (f : r ≺i s) (g : s ≼i t) : r ≺i t 
goal: r ≺i t

full_name: PrincipalSeg.lt_le_apply
code: @[simp]
theorem lt_le_apply (f : r ≺i s) (g : s ≼i t) (a : α) : (f.ltLe g) a = g (f a) 
goal: (f.ltLe g).toRelEmbedding a = g (f.toRelEmbedding a)

full_name: PrincipalSeg.lt_le_top
code: @[simp]
theorem lt_le_top (f : r ≺i s) (g : s ≼i t) : (f.ltLe g).top = g f.top 
goal: (f.ltLe g).top = g f.top

full_name: PrincipalSeg.trans
code: /-- Composition of two principal segments as a principal segment -/
@[trans]
protected def trans [IsTrans γ t] (f : r ≺i s) (g : s ≺i t) : r ≺i t 
goal: r ≺i t

full_name: PrincipalSeg.trans_apply
code: @[simp]
theorem trans_apply [IsTrans γ t] (f : r ≺i s) (g : s ≺i t) (a : α) : (f.trans g) a = g (f a) 
goal: (f.trans g).toRelEmbedding a = g.toRelEmbedding (f.toRelEmbedding a)

full_name: PrincipalSeg.trans_top
code: @[simp]
theorem trans_top [IsTrans γ t] (f : r ≺i s) (g : s ≺i t) : (f.trans g).top = g f.top 
goal: (f.trans g).top = g.toRelEmbedding f.top

full_name: PrincipalSeg.equivLT
code: /-- Composition of an order isomorphism with a principal segment, as a principal segment -/
def equivLT (f : r ≃r s) (g : s ≺i t) : r ≺i t 
goal: r ≺i t

full_name: PrincipalSeg.ltEquiv
code: /-- Composition of a principal segment with an order isomorphism, as a principal segment -/
def ltEquiv {r : α → α → Prop} {s : β → β → Prop} {t : γ → γ → Prop} (f : PrincipalSeg r s)
    (g : s ≃r t) : PrincipalSeg r t 
goal: r ≺i t

full_name: PrincipalSeg.equivLT_apply
code: @[simp]
theorem equivLT_apply (f : r ≃r s) (g : s ≺i t) (a : α) : (equivLT f g) a = g (f a) 
goal: (PrincipalSeg.equivLT f g).toRelEmbedding a = g.toRelEmbedding (f a)

full_name: PrincipalSeg.equivLT_top
code: @[simp]
theorem equivLT_top (f : r ≃r s) (g : s ≺i t) : (equivLT f g).top = g.top 
goal: (PrincipalSeg.equivLT f g).top = g.top

full_name: PrincipalSeg.instSubsingletonOfIsWellOrder
code: /-- Given a well order `s`, there is a most one principal segment embedding of `r` into `s`. -/
instance [IsWellOrder β s] : Subsingleton (r ≺i s) 
goal: Subsingleton (r ≺i s)

full_name: PrincipalSeg.top_eq
code: theorem top_eq [IsWellOrder γ t] (e : r ≃r s) (f : r ≺i t) (g : s ≺i t) : f.top = g.top 
goal: f.top = g.top

full_name: PrincipalSeg.topLTTop
code: theorem topLTTop {r : α → α → Prop} {s : β → β → Prop} {t : γ → γ → Prop} [IsWellOrder γ t]
    (f : PrincipalSeg r s) (g : PrincipalSeg s t) (h : PrincipalSeg r t) : t h.top g.top 
goal: t h.top g.top

full_name: PrincipalSeg.ofElement
code: /-- Any element of a well order yields a principal segment -/
def ofElement {α : Type*} (r : α → α → Prop) (a : α) : Subrel r { b | r b a } ≺i r 
goal: Subrel r {b | r b a} ≺i r

full_name: PrincipalSeg.ofElement_apply
code: @[simp, nolint simpNF]
theorem ofElement_apply {α : Type*} (r : α → α → Prop) (a : α) (b) : ofElement r a b = b.1 
goal: (PrincipalSeg.ofElement r a).toRelEmbedding b = ↑b

full_name: PrincipalSeg.ofElement_top
code: @[simp]
theorem ofElement_top {α : Type*} (r : α → α → Prop) (a : α) : (ofElement r a).top = a 
goal: (PrincipalSeg.ofElement r a).top = a

full_name: PrincipalSeg.subrelIso
code: /-- For any principal segment `r ≺i s`, there is a `Subrel` of `s` order isomorphic to `r`. -/
@[simps! symm_apply]
noncomputable def subrelIso (f : r ≺i s) : Subrel s {b | s b f.top} ≃r r 
goal: Subrel s {b | s b f.top} ≃r r

full_name: PrincipalSeg.subrelIso_symm_apply
code: /-- For any principal segment `r ≺i s`, there is a `Subrel` of `s` order isomorphic to `r`. -/
@[simps! symm_apply]
noncomputable def subrelIso (f : r ≺i s) : Subrel s {b | s b f.top} ≃r r 
goal: ∀ (a : α), f.subrelIso.symm a = (Equiv.setCongr ⋯) ⟨f.toRelEmbedding a, ⋯⟩

full_name: PrincipalSeg.apply_subrelIso
code: @[simp, nolint simpNF]
theorem apply_subrelIso (f : r ≺i s) (b : {b | s b f.top}) :
    f (f.subrelIso b) = b 
goal: f.toRelEmbedding (f.subrelIso b) = ↑b

full_name: PrincipalSeg.subrelIso_apply
code: @[simp, nolint simpNF]
theorem subrelIso_apply (f : r ≺i s) (a : α) :
    f.subrelIso ⟨f a, f.down.mpr ⟨a, rfl⟩⟩ = a 
goal: f.subrelIso ⟨f.toRelEmbedding a, ⋯⟩ = a

full_name: PrincipalSeg.codRestrict
code: /-- Restrict the codomain of a principal segment -/
def codRestrict (p : Set β) (f : r ≺i s) (H : ∀ a, f a ∈ p) (H₂ : f.top ∈ p) : r ≺i Subrel s p 
goal: r ≺i Subrel s p

full_name: PrincipalSeg.codRestrict_apply
code: @[simp]
theorem codRestrict_apply (p) (f : r ≺i s) (H H₂ a) : codRestrict p f H H₂ a = ⟨f a, H a⟩ 
goal: (PrincipalSeg.codRestrict p f H H₂).toRelEmbedding a = ⟨f.toRelEmbedding a, ⋯⟩

full_name: PrincipalSeg.codRestrict_top
code: @[simp]
theorem codRestrict_top (p) (f : r ≺i s) (H H₂) : (codRestrict p f H H₂).top = ⟨f.top, H₂⟩ 
goal: (PrincipalSeg.codRestrict p f H H₂).top = ⟨f.top, H₂⟩

full_name: PrincipalSeg.ofIsEmpty
code: /-- Principal segment from an empty type into a type with a minimal element. -/
def ofIsEmpty (r : α → α → Prop) [IsEmpty α] {b : β} (H : ∀ b', ¬s b' b) : r ≺i s 
goal: r ≺i s

full_name: PrincipalSeg.ofIsEmpty_top
code: @[simp]
theorem ofIsEmpty_top (r : α → α → Prop) [IsEmpty α] {b : β} (H : ∀ b', ¬s b' b) :
    (ofIsEmpty r H).top = b 
goal: (PrincipalSeg.ofIsEmpty r H).top = b

full_name: PrincipalSeg.pemptyToPunit
code: /-- Principal segment from the empty relation on `PEmpty` to the empty relation on `PUnit`. -/
abbrev pemptyToPunit : @EmptyRelation PEmpty ≺i @EmptyRelation PUnit 
goal: EmptyRelation ≺i EmptyRelation

full_name: PrincipalSeg.acc
code: protected theorem acc [IsTrans β s] (f : r ≺i s) (a : α) : Acc r a ↔ Acc s (f a) 
goal: Acc r a ↔ Acc s (f.toRelEmbedding a)

full_name: wellFounded_iff_wellFounded_subrel
code: /-- A relation is well-founded iff every principal segment of it is well-founded.

In this lemma we use `Subrel` to indicate its principal segments because it's usually more
convenient to use.
-/
theorem wellFounded_iff_wellFounded_subrel {β : Type*} {s : β → β → Prop} [IsTrans β s] :
    WellFounded s ↔ ∀ b, WellFounded (Subrel s { b' | s b' b }) 
goal: WellFounded s ↔ ∀ (b : β), WellFounded (Subrel s {b' | s b' b})

full_name: wellFounded_iff_principalSeg
code: theorem wellFounded_iff_principalSeg.{u} {β : Type u} {s : β → β → Prop} [IsTrans β s] :
    WellFounded s ↔ ∀ (α : Type u) (r : α → α → Prop) (_ : r ≺i s), WellFounded r 
goal: WellFounded s ↔ ∀ (α : Type u) (r : α → α → Prop), r ≺i s → WellFounded r

full_name: InitialSeg.ltOrEq
code: /-- To an initial segment taking values in a well order, one can associate either a principal
segment (if the range is not everything, hence one can take as top the minimum of the complement
of the range) or an order isomorphism (if the range is everything). -/
noncomputable def InitialSeg.ltOrEq [IsWellOrder β s] (f : r ≼i s) : (r ≺i s) ⊕ (r ≃r s) 
goal: (r ≺i s) ⊕ (r ≃r s)

full_name: InitialSeg.ltOrEq_apply_left
code: theorem InitialSeg.ltOrEq_apply_left [IsWellOrder β s] (f : r ≼i s) (g : r ≺i s) (a : α) :
    g a = f a 
goal: g.toRelEmbedding a = f a

full_name: InitialSeg.ltOrEq_apply_right
code: theorem InitialSeg.ltOrEq_apply_right [IsWellOrder β s] (f : r ≼i s) (g : r ≃r s) (a : α) :
    g a = f a 
goal: g a = f a

full_name: InitialSeg.leLT
code: /-- Composition of an initial segment taking values in a well order and a principal segment. -/
noncomputable def InitialSeg.leLT [IsWellOrder β s] [IsTrans γ t] (f : r ≼i s) (g : s ≺i t) :
    r ≺i t 
goal: r ≺i t

full_name: InitialSeg.leLT_apply
code: @[simp]
theorem InitialSeg.leLT_apply [IsWellOrder β s] [IsTrans γ t] (f : r ≼i s) (g : s ≺i t) (a : α) :
    (f.leLT g) a = g (f a) 
goal: (f.leLT g).toRelEmbedding a = g.toRelEmbedding (f a)

full_name: RelEmbedding.collapseF
code: /-- Given an order embedding into a well order, collapse the order embedding by filling the
gaps, to obtain an initial segment. Here, we construct the collapsed order embedding pointwise,
but the proof of the fact that it is an initial segment will be given in `collapse`. -/
noncomputable def collapseF [IsWellOrder β s] (f : r ↪r s) : ∀ a, { b // ¬s (f a) b } 
goal: { b // ¬s (f a) b }

full_name: RelEmbedding.collapseF.lt
code: theorem collapseF.lt [IsWellOrder β s] (f : r ↪r s) {a : α} :
    ∀ {a'}, r a' a → s (collapseF f a').1 (collapseF f a).1 
goal: r a' a → s ↑(f.collapseF a') ↑(f.collapseF a)

full_name: RelEmbedding.collapseF.not_lt
code: theorem collapseF.not_lt [IsWellOrder β s] (f : r ↪r s) (a : α) {b}
    (h : ∀ a' (_ : r a' a), s (collapseF f a').1 b) : ¬s b (collapseF f a).1 
goal: ¬s b ↑(f.collapseF a)

full_name: RelEmbedding.collapse
code: /-- Construct an initial segment from an order embedding into a well order, by collapsing it
to fill the gaps. -/
noncomputable def collapse [IsWellOrder β s] (f : r ↪r s) : r ≼i s 
goal: r ≼i s

full_name: RelEmbedding.collapse_apply
code: theorem collapse_apply [IsWellOrder β s] (f : r ↪r s) (a) : collapse f a = (collapseF f a).1 
goal: f.collapse a = ↑(f.collapseF a)