File: Mathlib/Order/RelIso/Basic.lean

full_name: RelHom.toFun
code: /-- A relation homomorphism with respect to a given pair of relations `r` and `s`
is a function `f : α → β` such that `r a b → s (f a) (f b)`. -/
structure RelHom {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) where
  /-- The underlying function of a `RelHom` -/
  toFun : α → β
  /-- A `RelHom` sends related elements to related elements -/
  map_rel' : ∀ {a b}, r a b → s (toFun a) (toFun b)
goal: α → β

full_name: RelHom.map_rel'
code: /-- A relation homomorphism with respect to a given pair of relations `r` and `s`
is a function `f : α → β` such that `r a b → s (f a) (f b)`. -/
structure RelHom {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) where
  /-- The underlying function of a `RelHom` -/
  toFun : α → β
  /-- A `RelHom` sends related elements to related elements -/
  map_rel' : ∀ {a b}, r a b → s (toFun a) (toFun b)
goal: r a b → s (self.toFun a) (self.toFun b)

full_name: RelHom
code: /-- A relation homomorphism with respect to a given pair of relations `r` and `s`
is a function `f : α → β` such that `r a b → s (f a) (f b)`. -/
structure RelHom {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) where
  /-- The underlying function of a `RelHom` -/
  toFun : α → β
  /-- A `RelHom` sends related elements to related elements -/
  map_rel' : ∀ {a b}, r a b → s (toFun a) (toFun b)
goal: Type (max u_5 u_6)

full_name: _aux_Mathlib_Order_RelIso_Basic___unexpand_RelHom_1
code: /-- A relation homomorphism with respect to a given pair of relations `r` and `s`
is a function `f : α → β` such that `r a b → s (f a) (f b)`. -/
infixl:25 " →r " => RelHom
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Order_RelIso_Basic___macroRules_term_→r__1»
code: /-- A relation homomorphism with respect to a given pair of relations `r` and `s`
is a function `f : α → β` such that `r a b → s (f a) (f b)`. -/
infixl:25 " →r " => RelHom
goal: Lean.Macro

full_name: RelHomClass
code: /-- `RelHomClass F r s` asserts that `F` is a type of functions such that all `f : F`
satisfy `r a b → s (f a) (f b)`.

The relations `r` and `s` are `outParam`s since figuring them out from a goal is a higher-order
matching problem that Lean usually can't do unaided.
-/
class RelHomClass (F : Type*) {α β : Type*} (r : outParam <| α → α → Prop)
  (s : outParam <| β → β → Prop) [FunLike F α β] : Prop where
  /-- A `RelHomClass` sends related elements to related elements -/
  map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
goal: Prop

full_name: RelHomClass.map_rel
code: /-- `RelHomClass F r s` asserts that `F` is a type of functions such that all `f : F`
satisfy `r a b → s (f a) (f b)`.

The relations `r` and `s` are `outParam`s since figuring them out from a goal is a higher-order
matching problem that Lean usually can't do unaided.
-/
class RelHomClass (F : Type*) {α β : Type*} (r : outParam <| α → α → Prop)
  (s : outParam <| β → β → Prop) [FunLike F α β] : Prop where
  /-- A `RelHomClass` sends related elements to related elements -/
  map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
goal: r a b → s (f a) (f b)

full_name: RelHomClass.isIrrefl
code: protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
  
goal: IsIrrefl α r

full_name: RelHomClass.isAsymm
code: protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAsymm α r
  
goal: IsAsymm α r

full_name: RelHomClass.acc
code: protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc r a 
goal: Acc s (f a) → Acc r a

full_name: RelHomClass.wellFounded
code: protected theorem wellFounded [RelHomClass F r s] (f : F) : WellFounded s → WellFounded r
  
goal: WellFounded s → WellFounded r

full_name: RelHom.instFunLike
code: instance : FunLike (r →r s) α β 
goal: FunLike (r →r s) α β

full_name: RelHom.instRelHomClass
code: instance : RelHomClass (r →r s) r s 
goal: RelHomClass (r →r s) r s

full_name: RelHom.map_rel
code: protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b) 
goal: r a b → s (f a) (f b)

full_name: RelHom.coe_fn_toFun
code: @[simp]
theorem coe_fn_toFun (f : r →r s) : f.toFun = (f : α → β) 
goal: f.toFun = ⇑f

full_name: RelHom.coe_fn_injective
code: /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
theorem coe_fn_injective : Injective fun (f : r →r s) => (f : α → β) 
goal: Function.Injective fun f => ⇑f

full_name: RelHom.ext
code: @[ext]
theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: RelHom.ext_iff
code: theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : α), f x = g x

full_name: RelHom.id
code: /-- Identity map is a relation homomorphism. -/
@[refl, simps]
protected def id (r : α → α → Prop) : r →r r 
goal: r →r r

full_name: RelHom.id_apply
code: /-- Identity map is a relation homomorphism. -/
@[refl, simps]
protected def id (r : α → α → Prop) : r →r r 
goal: (RelHom.id r) x = x

full_name: RelHom.comp_apply
code: /-- Composition of two relation homomorphisms is a relation homomorphism. -/
@[simps]
protected def comp (g : s →r t) (f : r →r s) : r →r t 
goal: (g.comp f) x = g (f x)

full_name: RelHom.comp
code: /-- Composition of two relation homomorphisms is a relation homomorphism. -/
@[simps]
protected def comp (g : s →r t) (f : r →r s) : r →r t 
goal: r →r t

full_name: RelHom.swap
code: /-- A relation homomorphism is also a relation homomorphism between dual relations. -/
protected def swap (f : r →r s) : swap r →r swap s 
goal: Function.swap r →r Function.swap s

full_name: RelHom.preimage
code: /-- A function is a relation homomorphism from the preimage relation of `s` to `s`. -/
def preimage (f : α → β) (s : β → β → Prop) : f ⁻¹'o s →r s 
goal: f ⁻¹'o s →r s

full_name: injective_of_increasing
code: /-- An increasing function is injective -/
theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop) [IsTrichotomous α r]
    [IsIrrefl β s] (f : α → β) (hf : ∀ {x y}, r x y → s (f x) (f y)) : Injective f 
goal: Function.Injective f

full_name: RelHom.injective_of_increasing
code: /-- An increasing function is injective -/
theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f : r →r s) :
    Injective f 
goal: Function.Injective ⇑f

full_name: Function.Surjective.wellFounded_iff
code: theorem Function.Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
    (o : ∀ {a b}, r a b ↔ s (f a) (f b)) :
    WellFounded r ↔ WellFounded s 
goal: WellFounded r ↔ WellFounded s

full_name: RelEmbedding.map_rel_iff'
code: /-- A relation embedding with respect to a given pair of relations `r` and `s`
is an embedding `f : α ↪ β` such that `r a b ↔ s (f a) (f b)`. -/
structure RelEmbedding {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends α ↪ β where
  /-- Elements are related iff they are related after apply a `RelEmbedding` -/
  map_rel_iff' : ∀ {a b}, s (toEmbedding a) (toEmbedding b) ↔ r a b
goal: s (self.toEmbedding a) (self.toEmbedding b) ↔ r a b

full_name: RelEmbedding
code: /-- A relation embedding with respect to a given pair of relations `r` and `s`
is an embedding `f : α ↪ β` such that `r a b ↔ s (f a) (f b)`. -/
structure RelEmbedding {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends α ↪ β where
  /-- Elements are related iff they are related after apply a `RelEmbedding` -/
  map_rel_iff' : ∀ {a b}, s (toEmbedding a) (toEmbedding b) ↔ r a b
goal: Type (max u_5 u_6)

full_name: _aux_Mathlib_Order_RelIso_Basic___unexpand_RelEmbedding_1
code: /-- A relation embedding with respect to a given pair of relations `r` and `s`
is an embedding `f : α ↪ β` such that `r a b ↔ s (f a) (f b)`. -/
infixl:25 " ↪r " => RelEmbedding
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Order_RelIso_Basic___macroRules_term_↪r__1»
code: /-- A relation embedding with respect to a given pair of relations `r` and `s`
is an embedding `f : α ↪ β` such that `r a b ↔ s (f a) (f b)`. -/
infixl:25 " ↪r " => RelEmbedding
goal: Lean.Macro

full_name: Subtype.relEmbedding
code: /-- The induced relation on a subtype is an embedding under the natural inclusion. -/
def Subtype.relEmbedding {X : Type*} (r : X → X → Prop) (p : X → Prop) :
    (Subtype.val : Subtype p → X) ⁻¹'o r ↪r r 
goal: Subtype.val ⁻¹'o r ↪r r

full_name: preimage_equivalence
code: theorem preimage_equivalence {α β} (f : α → β) {s : β → β → Prop} (hs : Equivalence s) :
    Equivalence (f ⁻¹'o s) 
goal: Equivalence (f ⁻¹'o s)

full_name: RelEmbedding.toRelHom
code: /-- A relation embedding is also a relation homomorphism -/
def toRelHom (f : r ↪r s) : r →r s 
goal: r →r s

full_name: RelEmbedding.instCoeRelHom
code: instance : Coe (r ↪r s) (r →r s) 
goal: Coe (r ↪r s) (r →r s)

full_name: RelEmbedding.instFunLike
code: instance : FunLike (r ↪r s) α β 
goal: FunLike (r ↪r s) α β

full_name: RelEmbedding.instRelHomClass
code: instance : RelHomClass (r ↪r s) r s 
goal: RelHomClass (r ↪r s) r s

full_name: RelEmbedding.instEmbeddingLike
code: instance : EmbeddingLike (r ↪r s) α β 
goal: EmbeddingLike (r ↪r s) α β

full_name: RelEmbedding.coe_toEmbedding
code: @[simp]
theorem coe_toEmbedding {f : r ↪r s} : ((f : r ↪r s).toEmbedding : α → β) = f 
goal: ⇑f.toEmbedding = ⇑f

full_name: RelEmbedding.coe_toRelHom
code: @[simp]
theorem coe_toRelHom {f : r ↪r s} : ((f : r ↪r s).toRelHom : α → β) = f 
goal: ⇑f.toRelHom = ⇑f

full_name: RelEmbedding.injective
code: theorem injective (f : r ↪r s) : Injective f 
goal: Function.Injective ⇑f

full_name: RelEmbedding.inj
code: theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b 
goal: f a = f b ↔ a = b

full_name: RelEmbedding.map_rel_iff
code: theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b 
goal: s (f a) (f b) ↔ r a b

full_name: RelEmbedding.coe_mk
code: @[simp]
theorem coe_mk {f} {h} : ⇑(⟨f, h⟩ : r ↪r s) = f 
goal: ⇑{ toEmbedding := f, map_rel_iff' := h } = ⇑f

full_name: RelEmbedding.coe_fn_injective
code: /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
theorem coe_fn_injective : Injective fun f : r ↪r s => (f : α → β) 
goal: Function.Injective fun f => ⇑f

full_name: RelEmbedding.ext
code: @[ext]
theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: RelEmbedding.ext_iff
code: theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : α), f x = g x

full_name: RelEmbedding.refl_apply
code: /-- Identity map is a relation embedding. -/
@[refl, simps!]
protected def refl (r : α → α → Prop) : r ↪r r 
goal: (RelEmbedding.refl r) a = a

full_name: RelEmbedding.refl
code: /-- Identity map is a relation embedding. -/
@[refl, simps!]
protected def refl (r : α → α → Prop) : r ↪r r 
goal: r ↪r r

full_name: RelEmbedding.trans
code: /-- Composition of two relation embeddings is a relation embedding. -/
protected def trans (f : r ↪r s) (g : s ↪r t) : r ↪r t 
goal: r ↪r t

full_name: RelEmbedding.instInhabited
code: instance (r : α → α → Prop) : Inhabited (r ↪r r) 
goal: Inhabited (r ↪r r)

full_name: RelEmbedding.trans_apply
code: theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a) 
goal: (f.trans g) a = g (f a)

full_name: RelEmbedding.coe_trans
code: @[simp]
theorem coe_trans (f : r ↪r s) (g : s ↪r t) : (f.trans g) = g ∘ f 
goal: ⇑(f.trans g) = ⇑g ∘ ⇑f

full_name: RelEmbedding.swap
code: /-- A relation embedding is also a relation embedding between dual relations. -/
protected def swap (f : r ↪r s) : swap r ↪r swap s 
goal: Function.swap r ↪r Function.swap s

full_name: RelEmbedding.preimage
code: /-- If `f` is injective, then it is a relation embedding from the
  preimage relation of `s` to `s`. -/
def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s 
goal: ⇑f ⁻¹'o s ↪r s

full_name: RelEmbedding.eq_preimage
code: theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s 
goal: r = ⇑f ⁻¹'o s

full_name: RelEmbedding.isIrrefl
code: protected theorem isIrrefl (f : r ↪r s) [IsIrrefl β s] : IsIrrefl α r 
goal: IsIrrefl α r

full_name: RelEmbedding.isRefl
code: protected theorem isRefl (f : r ↪r s) [IsRefl β s] : IsRefl α r 
goal: IsRefl α r

full_name: RelEmbedding.isSymm
code: protected theorem isSymm (f : r ↪r s) [IsSymm β s] : IsSymm α r 
goal: IsSymm α r

full_name: RelEmbedding.isAsymm
code: protected theorem isAsymm (f : r ↪r s) [IsAsymm β s] : IsAsymm α r 
goal: IsAsymm α r

full_name: RelEmbedding.isAntisymm
code: protected theorem isAntisymm : ∀ (_ : r ↪r s) [IsAntisymm β s], IsAntisymm α r
  
goal: r ↪r s → ∀ [inst : IsAntisymm β s], IsAntisymm α r

full_name: RelEmbedding.isTrans
code: protected theorem isTrans : ∀ (_ : r ↪r s) [IsTrans β s], IsTrans α r
  
goal: r ↪r s → ∀ [inst : IsTrans β s], IsTrans α r

full_name: RelEmbedding.isTotal
code: protected theorem isTotal : ∀ (_ : r ↪r s) [IsTotal β s], IsTotal α r
  
goal: r ↪r s → ∀ [inst : IsTotal β s], IsTotal α r

full_name: RelEmbedding.isPreorder
code: protected theorem isPreorder : ∀ (_ : r ↪r s) [IsPreorder β s], IsPreorder α r
  
goal: r ↪r s → ∀ [inst : IsPreorder β s], IsPreorder α r

full_name: RelEmbedding.isPartialOrder
code: protected theorem isPartialOrder : ∀ (_ : r ↪r s) [IsPartialOrder β s], IsPartialOrder α r
  
goal: r ↪r s → ∀ [inst : IsPartialOrder β s], IsPartialOrder α r

full_name: RelEmbedding.isLinearOrder
code: protected theorem isLinearOrder : ∀ (_ : r ↪r s) [IsLinearOrder β s], IsLinearOrder α r
  
goal: r ↪r s → ∀ [inst : IsLinearOrder β s], IsLinearOrder α r

full_name: RelEmbedding.isStrictOrder
code: protected theorem isStrictOrder : ∀ (_ : r ↪r s) [IsStrictOrder β s], IsStrictOrder α r
  
goal: r ↪r s → ∀ [inst : IsStrictOrder β s], IsStrictOrder α r

full_name: RelEmbedding.isTrichotomous
code: protected theorem isTrichotomous : ∀ (_ : r ↪r s) [IsTrichotomous β s], IsTrichotomous α r
  
goal: r ↪r s → ∀ [inst : IsTrichotomous β s], IsTrichotomous α r

full_name: RelEmbedding.isStrictTotalOrder
code: protected theorem isStrictTotalOrder : ∀ (_ : r ↪r s) [IsStrictTotalOrder β s],
    IsStrictTotalOrder α r
  
goal: r ↪r s → ∀ [inst : IsStrictTotalOrder β s], IsStrictTotalOrder α r

full_name: RelEmbedding.acc
code: protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a 
goal: Acc s (f a) → Acc r a

full_name: RelEmbedding.wellFounded
code: protected theorem wellFounded : ∀ (_ : r ↪r s) (_ : WellFounded s), WellFounded r
  
goal: r ↪r s → WellFounded s → WellFounded r

full_name: RelEmbedding.isWellFounded
code: protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r 
goal: IsWellFounded α r

full_name: RelEmbedding.isWellOrder
code: protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrder α r
  
goal: r ↪r s → ∀ [inst : IsWellOrder β s], IsWellOrder α r

full_name: Subtype.wellFoundedLT
code: instance Subtype.wellFoundedLT [LT α] [WellFoundedLT α] (p : α → Prop) :
    WellFoundedLT (Subtype p) 
goal: WellFoundedLT (Subtype p)

full_name: Subtype.wellFoundedGT
code: instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
    WellFoundedGT (Subtype p) 
goal: WellFoundedGT (Subtype p)

full_name: Quotient.mkRelHom
code: /-- `Quotient.mk'` as a relation homomorphism between the relation and the lift of a relation. -/
@[simps]
def Quotient.mkRelHom [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : r →r Quotient.lift₂ r H 
goal: r →r Quotient.lift₂ r H

full_name: Quotient.mkRelHom_apply
code: /-- `Quotient.mk'` as a relation homomorphism between the relation and the lift of a relation. -/
@[simps]
def Quotient.mkRelHom [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : r →r Quotient.lift₂ r H 
goal: (Quotient.mkRelHom H) a = Quotient.mk' a

full_name: Quotient.outRelEmbedding_apply
code: /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
@[simps!]
noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r 
goal: ∀ (a : Quotient inst✝), (Quotient.outRelEmbedding H) a = a.out

full_name: Quotient.outRelEmbedding
code: /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
@[simps!]
noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r 
goal: Quotient.lift₂ r H ↪r r

full_name: Quotient.out'RelEmbedding
code: /-- `Quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
@[simps]
noncomputable def Quotient.out'RelEmbedding {_ : Setoid α} {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) :
    (fun a b => Quotient.liftOn₂' a b r H) ↪r r 
goal: {x : Setoid α} →
  {r : α → α → Prop} →
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) → (fun a b => a.liftOn₂' b r H) ↪r r

full_name: Quotient.out'RelEmbedding_apply
code: /-- `Quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
@[simps]
noncomputable def Quotient.out'RelEmbedding {_ : Setoid α} {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) :
    (fun a b => Quotient.liftOn₂' a b r H) ↪r r 
goal: ∀ {x : Setoid α} {r : α → α → Prop} (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) (a : Quotient x),
  (Quotient.out'RelEmbedding H) a = a.out'

full_name: acc_lift₂_iff
code: @[simp]
theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop}
    {H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂} {a} :
    Acc (Quotient.lift₂ r H) ⟦a⟧ ↔ Acc r a 
goal: Acc (Quotient.lift₂ r H) ⟦a⟧ ↔ Acc r a

full_name: acc_liftOn₂'_iff
code: @[simp]
theorem acc_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} {a} :
    Acc (fun x y => Quotient.liftOn₂' x y r H) (Quotient.mk'' a : Quotient s) ↔ Acc r a 
goal: Acc (fun x y => x.liftOn₂' y r H) (Quotient.mk'' a) ↔ Acc r a

full_name: wellFounded_lift₂_iff
code: /-- A relation is well founded iff its lift to a quotient is. -/
@[simp]
theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop}
    {H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂} :
    WellFounded (Quotient.lift₂ r H) ↔ WellFounded r 
goal: WellFounded (Quotient.lift₂ r H) ↔ WellFounded r

full_name: wellFounded_liftOn₂'_iff
code: @[simp]
theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
    (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r 
goal: (WellFounded fun x y => x.liftOn₂' y r H) ↔ WellFounded r

full_name: RelEmbedding.ofMapRelIff
code: /-- To define a relation embedding from an antisymmetric relation `r` to a reflexive relation `s`
it suffices to give a function together with a proof that it satisfies `s (f a) (f b) ↔ r a b`.
-/
def ofMapRelIff (f : α → β) [IsAntisymm α r] [IsRefl β s] (hf : ∀ a b, s (f a) (f b) ↔ r a b) :
    r ↪r s 
goal: r ↪r s

full_name: RelEmbedding.ofMapRelIff_coe
code: @[simp]
theorem ofMapRelIff_coe (f : α → β) [IsAntisymm α r] [IsRefl β s]
    (hf : ∀ a b, s (f a) (f b) ↔ r a b) :
    (ofMapRelIff f hf : r ↪r s) = f 
goal: ⇑(RelEmbedding.ofMapRelIff f hf) = f

full_name: RelEmbedding.ofMonotone
code: /-- It suffices to prove `f` is monotone between strict relations
  to show it is a relation embedding. -/
def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b, r a b → s (f a) (f b)) :
    r ↪r s 
goal: r ↪r s

full_name: RelEmbedding.ofMonotone_coe
code: @[simp]
theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
    (@ofMonotone _ _ r s _ _ f H : α → β) = f 
goal: ⇑(RelEmbedding.ofMonotone f H) = f

full_name: RelEmbedding.ofIsEmpty
code: /-- A relation embedding from an empty type. -/
def ofIsEmpty (r : α → α → Prop) (s : β → β → Prop) [IsEmpty α] : r ↪r s 
goal: r ↪r s

full_name: RelEmbedding.sumLiftRelInl_apply
code: /-- `Sum.inl` as a relation embedding into `Sum.LiftRel r s`. -/
@[simps]
def sumLiftRelInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.LiftRel r s 
goal: (RelEmbedding.sumLiftRelInl r s) val = Sum.inl val

full_name: RelEmbedding.sumLiftRelInl
code: /-- `Sum.inl` as a relation embedding into `Sum.LiftRel r s`. -/
@[simps]
def sumLiftRelInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.LiftRel r s 
goal: r ↪r Sum.LiftRel r s

full_name: RelEmbedding.sumLiftRelInr_apply
code: /-- `Sum.inr` as a relation embedding into `Sum.LiftRel r s`. -/
@[simps]
def sumLiftRelInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.LiftRel r s 
goal: (RelEmbedding.sumLiftRelInr r s) val = Sum.inr val

full_name: RelEmbedding.sumLiftRelInr
code: /-- `Sum.inr` as a relation embedding into `Sum.LiftRel r s`. -/
@[simps]
def sumLiftRelInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.LiftRel r s 
goal: s ↪r Sum.LiftRel r s

full_name: RelEmbedding.sumLiftRelMap_apply
code: /-- `Sum.map` as a relation embedding between `Sum.LiftRel` relations. -/
@[simps]
def sumLiftRelMap (f : r ↪r s) (g : t ↪r u) : Sum.LiftRel r t ↪r Sum.LiftRel s u 
goal: ∀ (a : α ⊕ γ), (f.sumLiftRelMap g) a = Sum.map (⇑f) (⇑g) a

full_name: RelEmbedding.sumLiftRelMap
code: /-- `Sum.map` as a relation embedding between `Sum.LiftRel` relations. -/
@[simps]
def sumLiftRelMap (f : r ↪r s) (g : t ↪r u) : Sum.LiftRel r t ↪r Sum.LiftRel s u 
goal: Sum.LiftRel r t ↪r Sum.LiftRel s u

full_name: RelEmbedding.sumLexInl
code: /-- `Sum.inl` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.Lex r s 
goal: r ↪r Sum.Lex r s

full_name: RelEmbedding.sumLexInl_apply
code: /-- `Sum.inl` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.Lex r s 
goal: (RelEmbedding.sumLexInl r s) val = Sum.inl val

full_name: RelEmbedding.sumLexInr_apply
code: /-- `Sum.inr` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.Lex r s 
goal: (RelEmbedding.sumLexInr r s) val = Sum.inr val

full_name: RelEmbedding.sumLexInr
code: /-- `Sum.inr` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.Lex r s 
goal: s ↪r Sum.Lex r s

full_name: RelEmbedding.sumLexMap
code: /-- `Sum.map` as a relation embedding between `Sum.Lex` relations. -/
@[simps]
def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u 
goal: Sum.Lex r t ↪r Sum.Lex s u

full_name: RelEmbedding.sumLexMap_apply
code: /-- `Sum.map` as a relation embedding between `Sum.Lex` relations. -/
@[simps]
def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u 
goal: ∀ (a : α ⊕ γ), (f.sumLexMap g) a = Sum.map (⇑f) (⇑g) a

full_name: RelEmbedding.prodLexMkLeft
code: /-- `fun b ↦ Prod.mk a b` as a relation embedding. -/
@[simps]
def prodLexMkLeft (s : β → β → Prop) {a : α} (h : ¬r a a) : s ↪r Prod.Lex r s 
goal: s ↪r Prod.Lex r s

full_name: RelEmbedding.prodLexMkLeft_apply
code: /-- `fun b ↦ Prod.mk a b` as a relation embedding. -/
@[simps]
def prodLexMkLeft (s : β → β → Prop) {a : α} (h : ¬r a a) : s ↪r Prod.Lex r s 
goal: (RelEmbedding.prodLexMkLeft s h) snd = (a, snd)

full_name: RelEmbedding.prodLexMkRight
code: /-- `fun a ↦ Prod.mk a b` as a relation embedding. -/
@[simps]
def prodLexMkRight (r : α → α → Prop) {b : β} (h : ¬s b b) : r ↪r Prod.Lex r s 
goal: r ↪r Prod.Lex r s

full_name: RelEmbedding.prodLexMkRight_apply
code: /-- `fun a ↦ Prod.mk a b` as a relation embedding. -/
@[simps]
def prodLexMkRight (r : α → α → Prop) {b : β} (h : ¬s b b) : r ↪r Prod.Lex r s 
goal: (RelEmbedding.prodLexMkRight r h) a = (a, b)

full_name: RelEmbedding.prodLexMap_apply
code: /-- `Prod.map` as a relation embedding. -/
@[simps]
def prodLexMap (f : r ↪r s) (g : t ↪r u) : Prod.Lex r t ↪r Prod.Lex s u 
goal: ∀ (a : α × γ), (f.prodLexMap g) a = Prod.map (⇑f) (⇑g) a

full_name: RelEmbedding.prodLexMap
code: /-- `Prod.map` as a relation embedding. -/
@[simps]
def prodLexMap (f : r ↪r s) (g : t ↪r u) : Prod.Lex r t ↪r Prod.Lex s u 
goal: Prod.Lex r t ↪r Prod.Lex s u

full_name: RelIso.map_rel_iff'
code: /-- A relation isomorphism is an equivalence that is also a relation embedding. -/
structure RelIso {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends α ≃ β where
  /-- Elements are related iff they are related after apply a `RelIso` -/
  map_rel_iff' : ∀ {a b}, s (toEquiv a) (toEquiv b) ↔ r a b
goal: s (self.toEquiv a) (self.toEquiv b) ↔ r a b

full_name: RelIso
code: /-- A relation isomorphism is an equivalence that is also a relation embedding. -/
structure RelIso {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends α ≃ β where
  /-- Elements are related iff they are related after apply a `RelIso` -/
  map_rel_iff' : ∀ {a b}, s (toEquiv a) (toEquiv b) ↔ r a b
goal: Type (max u_5 u_6)

full_name: _aux_Mathlib_Order_RelIso_Basic___unexpand_RelIso_1
code: /-- A relation isomorphism is an equivalence that is also a relation embedding. -/
infixl:25 " ≃r " => RelIso
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Order_RelIso_Basic___macroRules_term_≃r__1»
code: /-- A relation isomorphism is an equivalence that is also a relation embedding. -/
infixl:25 " ≃r " => RelIso
goal: Lean.Macro

full_name: RelIso.toRelEmbedding
code: /-- Convert a `RelIso` to a `RelEmbedding`. This function is also available as a coercion
but often it is easier to write `f.toRelEmbedding` than to write explicitly `r` and `s`
in the target type. -/
def toRelEmbedding (f : r ≃r s) : r ↪r s 
goal: r ↪r s

full_name: RelIso.toEquiv_injective
code: theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
  
goal: Function.Injective RelIso.toEquiv

full_name: RelIso.instCoeOutRelEmbedding
code: instance : CoeOut (r ≃r s) (r ↪r s) 
goal: CoeOut (r ≃r s) (r ↪r s)

full_name: RelIso.instFunLike
code: instance : FunLike (r ≃r s) α β 
goal: FunLike (r ≃r s) α β

full_name: RelIso.instRelHomClass
code: instance : RelHomClass (r ≃r s) r s 
goal: RelHomClass (r ≃r s) r s

full_name: RelIso.instEquivLike
code: instance : EquivLike (r ≃r s) α β 
goal: EquivLike (r ≃r s) α β

full_name: RelIso.coe_toRelEmbedding
code: @[simp]
theorem coe_toRelEmbedding (f : r ≃r s) : (f.toRelEmbedding : α → β) = f 
goal: ⇑f.toRelEmbedding = ⇑f

full_name: RelIso.coe_toEmbedding
code: @[simp]
theorem coe_toEmbedding (f : r ≃r s) : (f.toEmbedding : α → β) = f 
goal: ⇑f.toEmbedding = ⇑f

full_name: RelIso.map_rel_iff
code: theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b 
goal: s (f a) (f b) ↔ r a b

full_name: RelIso.coe_fn_mk
code: @[simp]
theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) :
    (RelIso.mk f @o : α → β) = f 
goal: ⇑{ toEquiv := f, map_rel_iff' := o } = ⇑f

full_name: RelIso.coe_fn_toEquiv
code: @[simp]
theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f 
goal: ⇑f.toEquiv = ⇑f

full_name: RelIso.coe_fn_injective
code: /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
`function.injective (fun e : r ≃r s ↦ (e : α → β))`, so we use a trick to say the same. -/
theorem coe_fn_injective : Injective fun f : r ≃r s => (f : α → β) 
goal: Function.Injective fun f => ⇑f

full_name: RelIso.ext
code: @[ext]
theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: RelIso.ext_iff
code: theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : α), f x = g x

full_name: RelIso.symm
code: /-- Inverse map of a relation isomorphism is a relation isomorphism. -/
protected def symm (f : r ≃r s) : s ≃r r 
goal: s ≃r r

full_name: RelIso.Simps.apply
code: /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
  because `RelIso` defines custom coercions other than the ones given by `DFunLike`. -/
def Simps.apply (h : r ≃r s) : α → β 
goal: α → β

full_name: RelIso.Simps.symm_apply
code: /-- See Note [custom simps projection]. -/
def Simps.symm_apply (h : r ≃r s) : β → α 
goal: β → α

full_name: RelIso.refl
code: /-- Identity map is a relation isomorphism. -/
@[refl, simps! apply]
protected def refl (r : α → α → Prop) : r ≃r r 
goal: r ≃r r

full_name: RelIso.refl_apply
code: /-- Identity map is a relation isomorphism. -/
@[refl, simps! apply]
protected def refl (r : α → α → Prop) : r ≃r r 
goal: (RelIso.refl r) a = a

full_name: RelIso.trans_apply
code: /-- Composition of two relation isomorphisms is a relation isomorphism. -/
@[simps! apply]
protected def trans (f₁ : r ≃r s) (f₂ : s ≃r t) : r ≃r t 
goal: ∀ (a : α), (f₁.trans f₂) a = f₂ (f₁ a)

full_name: RelIso.trans
code: /-- Composition of two relation isomorphisms is a relation isomorphism. -/
@[simps! apply]
protected def trans (f₁ : r ≃r s) (f₂ : s ≃r t) : r ≃r t 
goal: r ≃r t

full_name: RelIso.instInhabited
code: instance (r : α → α → Prop) : Inhabited (r ≃r r) 
goal: Inhabited (r ≃r r)

full_name: RelIso.default_def
code: @[simp]
theorem default_def (r : α → α → Prop) : default = RelIso.refl r 
goal: default = RelIso.refl r

full_name: RelIso.cast
code: /-- A relation isomorphism between equal relations on equal types. -/
@[simps! toEquiv apply]
protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : r ≃r s 
goal: r ≃r s

full_name: RelIso.cast_toEquiv
code: /-- A relation isomorphism between equal relations on equal types. -/
@[simps! toEquiv apply]
protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : r ≃r s 
goal: (RelIso.cast h₁ h₂).toEquiv = Equiv.cast h₁

full_name: RelIso.cast_apply
code: /-- A relation isomorphism between equal relations on equal types. -/
@[simps! toEquiv apply]
protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : r ≃r s 
goal: (RelIso.cast h₁ h₂) a = cast h₁ a

full_name: RelIso.cast_symm
code: @[simp]
protected theorem cast_symm {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : (RelIso.cast h₁ h₂).symm = RelIso.cast h₁.symm h₂.symm 
goal: (RelIso.cast h₁ h₂).symm = RelIso.cast ⋯ ⋯

full_name: RelIso.cast_refl
code: @[simp]
protected theorem cast_refl {α : Type u} {r : α → α → Prop} (h₁ : α = α := rfl)
    (h₂ : HEq r r := HEq.rfl) : RelIso.cast h₁ h₂ = RelIso.refl r 
goal: RelIso.cast h₁ h₂ = RelIso.refl r

full_name: RelIso.cast_trans
code: @[simp]
protected theorem cast_trans {α β γ : Type u} {r : α → α → Prop} {s : β → β → Prop}
    {t : γ → γ → Prop} (h₁ : α = β) (h₁' : β = γ) (h₂ : HEq r s) (h₂' : HEq s t) :
    (RelIso.cast h₁ h₂).trans (RelIso.cast h₁' h₂') = RelIso.cast (h₁.trans h₁') (h₂.trans h₂') 
goal: (RelIso.cast h₁ h₂).trans (RelIso.cast h₁' h₂') = RelIso.cast ⋯ ⋯

full_name: RelIso.swap
code: /-- a relation isomorphism is also a relation isomorphism between dual relations. -/
protected def swap (f : r ≃r s) : swap r ≃r swap s 
goal: Function.swap r ≃r Function.swap s

full_name: RelIso.coe_fn_symm_mk
code: @[simp]
theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f @o).symm : β → α) = f.symm 
goal: ⇑{ toEquiv := f, map_rel_iff' := o }.symm = ⇑f.symm

full_name: RelIso.apply_symm_apply
code: @[simp]
theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x 
goal: e (e.symm x) = x

full_name: RelIso.symm_apply_apply
code: @[simp]
theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x 
goal: e.symm (e x) = x

full_name: RelIso.rel_symm_apply
code: theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y 
goal: r x (e.symm y) ↔ s (e x) y

full_name: RelIso.symm_apply_rel
code: theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) 
goal: r (e.symm x) y ↔ s x (e y)

full_name: RelIso.self_trans_symm
code: @[simp]
theorem self_trans_symm (e : r ≃r s) : e.trans e.symm = RelIso.refl r 
goal: e.trans e.symm = RelIso.refl r

full_name: RelIso.symm_trans_self
code: @[simp]
theorem symm_trans_self (e : r ≃r s) : e.symm.trans e = RelIso.refl s 
goal: e.symm.trans e = RelIso.refl s

full_name: RelIso.bijective
code: protected theorem bijective (e : r ≃r s) : Bijective e 
goal: Function.Bijective ⇑e

full_name: RelIso.injective
code: protected theorem injective (e : r ≃r s) : Injective e 
goal: Function.Injective ⇑e

full_name: RelIso.surjective
code: protected theorem surjective (e : r ≃r s) : Surjective e 
goal: Function.Surjective ⇑e

full_name: RelIso.eq_iff_eq
code: theorem eq_iff_eq (f : r ≃r s) {a b} : f a = f b ↔ a = b 
goal: f a = f b ↔ a = b

full_name: RelIso.preimage
code: /-- Any equivalence lifts to a relation isomorphism between `s` and its preimage. -/
protected def preimage (f : α ≃ β) (s : β → β → Prop) : f ⁻¹'o s ≃r s 
goal: ⇑f ⁻¹'o s ≃r s

full_name: RelIso.IsWellOrder.preimage
code: instance IsWellOrder.preimage {α : Type u} (r : α → α → Prop) [IsWellOrder α r] (f : β ≃ α) :
    IsWellOrder β (f ⁻¹'o r) 
goal: IsWellOrder β (⇑f ⁻¹'o r)

full_name: RelIso.IsWellOrder.ulift
code: instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder α r] :
    IsWellOrder (ULift α) (ULift.down ⁻¹'o r) 
goal: IsWellOrder (ULift.{u_5, u} α) (ULift.down ⁻¹'o r)

full_name: RelIso.ofSurjective
code: /-- A surjective relation embedding is a relation isomorphism. -/
@[simps! apply]
noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s 
goal: r ≃r s

full_name: RelIso.ofSurjective_apply
code: /-- A surjective relation embedding is a relation isomorphism. -/
@[simps! apply]
noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s 
goal: (RelIso.ofSurjective f H) a = f a

full_name: RelIso.sumLexCongr
code: /-- Given relation isomorphisms `r₁ ≃r s₁` and `r₂ ≃r s₂`, construct a relation isomorphism for the
lexicographic orders on the sum.
-/
def sumLexCongr {α₁ α₂ β₁ β₂ r₁ r₂ s₁ s₂} (e₁ : @RelIso α₁ β₁ r₁ s₁) (e₂ : @RelIso α₂ β₂ r₂ s₂) :
    Sum.Lex r₁ r₂ ≃r Sum.Lex s₁ s₂ 
goal: Sum.Lex r₁ r₂ ≃r Sum.Lex s₁ s₂

full_name: RelIso.prodLexCongr
code: /-- Given relation isomorphisms `r₁ ≃r s₁` and `r₂ ≃r s₂`, construct a relation isomorphism for the
lexicographic orders on the product.
-/
def prodLexCongr {α₁ α₂ β₁ β₂ r₁ r₂ s₁ s₂} (e₁ : @RelIso α₁ β₁ r₁ s₁) (e₂ : @RelIso α₂ β₂ r₂ s₂) :
    Prod.Lex r₁ r₂ ≃r Prod.Lex s₁ s₂ 
goal: Prod.Lex r₁ r₂ ≃r Prod.Lex s₁ s₂

full_name: RelIso.relIsoOfIsEmpty
code: /-- Two relations on empty types are isomorphic. -/
def relIsoOfIsEmpty (r : α → α → Prop) (s : β → β → Prop) [IsEmpty α] [IsEmpty β] : r ≃r s 
goal: r ≃r s

full_name: RelIso.relIsoOfUniqueOfIrrefl
code: /-- Two irreflexive relations on a unique type are isomorphic. -/
def relIsoOfUniqueOfIrrefl (r : α → α → Prop) (s : β → β → Prop) [IsIrrefl α r]
    [IsIrrefl β s] [Unique α] [Unique β] : r ≃r s 
goal: r ≃r s

full_name: RelIso.relIsoOfUniqueOfRefl
code: /-- Two reflexive relations on a unique type are isomorphic. -/
def relIsoOfUniqueOfRefl (r : α → α → Prop) (s : β → β → Prop) [IsRefl α r] [IsRefl β s]
    [Unique α] [Unique β] : r ≃r s 
goal: r ≃r s