order.rel_iso.basicMathlib.Order.RelIso.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

chore(order/rel_iso/basic): better namespace management (#18758)

We remove a lot of _root_ by simply closing and reopening a namespace.

Diff
@@ -306,20 +306,22 @@ protected theorem is_well_founded (f : r ↪r s) [is_well_founded β s] : is_wel
 protected theorem is_well_order : ∀ (f : r ↪r s) [is_well_order β s], is_well_order α r
 | f H := by exactI {wf := f.well_founded H.wf, ..f.is_strict_total_order}
 
-instance _root_.subtype.well_founded_lt [has_lt α] [well_founded_lt α] (p : α → Prop) :
+end rel_embedding
+
+instance subtype.well_founded_lt [has_lt α] [well_founded_lt α] (p : α → Prop) :
   well_founded_lt (subtype p) := (subtype.rel_embedding (<) p).is_well_founded
 
-instance _root_.subtype.well_founded_gt [has_lt α] [well_founded_gt α] (p : α → Prop) :
+instance subtype.well_founded_gt [has_lt α] [well_founded_gt α] (p : α → Prop) :
   well_founded_gt (subtype p) := (subtype.rel_embedding (>) p).is_well_founded
 
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
-@[simps] def _root_.quotient.mk_rel_hom [setoid α] {r : α → α → Prop} (H) :
+@[simps] def quotient.mk_rel_hom [setoid α] {r : α → α → Prop} (H) :
   r →r quotient.lift₂ r H :=
 ⟨@quotient.mk α _, λ _ _, id⟩
 
 /-- `quotient.out` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
-noncomputable def _root_.quotient.out_rel_embedding [setoid α] {r : α → α → Prop} (H) :
+noncomputable def quotient.out_rel_embedding [setoid α] {r : α → α → Prop} (H) :
   quotient.lift₂ r H ↪r r :=
 ⟨embedding.quotient_out α, begin
   refine λ x y, quotient.induction_on₂ x y (λ a b, _),
@@ -329,12 +331,12 @@ end⟩
 
 /-- `quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
-noncomputable def _root_.quotient.out'_rel_embedding {s : setoid α} {r : α → α → Prop} (H) :
+noncomputable def quotient.out'_rel_embedding {s : setoid α} {r : α → α → Prop} (H) :
   (λ a b, quotient.lift_on₂' a b r H) ↪r r :=
 { to_fun := quotient.out',
   ..quotient.out_rel_embedding _ }
 
-@[simp] theorem _root_.acc_lift₂_iff [setoid α] {r : α → α → Prop} {H} {a} :
+@[simp] theorem acc_lift₂_iff [setoid α] {r : α → α → Prop} {H} {a} :
   acc (quotient.lift₂ r H) ⟦a⟧ ↔ acc r a :=
 begin
   split,
@@ -346,12 +348,12 @@ begin
     exact IH a' h, },
 end
 
-@[simp] theorem _root_.acc_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} {a} :
+@[simp] theorem acc_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} {a} :
   acc (λ x y, quotient.lift_on₂' x y r H) (quotient.mk' a : quotient s) ↔ acc r a :=
 acc_lift₂_iff
 
 /-- A relation is well founded iff its lift to a quotient is. -/
-theorem _root_.well_founded_lift₂_iff [setoid α] {r : α → α → Prop} {H} :
+theorem well_founded_lift₂_iff [setoid α] {r : α → α → Prop} {H} :
   well_founded (quotient.lift₂ r H) ↔ well_founded r :=
 begin
   split,
@@ -361,15 +363,16 @@ begin
     exact acc_lift₂_iff.2 (wf.apply a), },
 end
 
-alias _root_.well_founded_lift₂_iff ↔
-  _root_.well_founded.of_quotient_lift₂ _root_.well_founded.quotient_lift₂
+alias well_founded_lift₂_iff ↔ well_founded.of_quotient_lift₂ well_founded.quotient_lift₂
 
-@[simp] theorem _root_.well_founded_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} :
+@[simp] theorem well_founded_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} :
   well_founded (λ x y : quotient s, quotient.lift_on₂' x y r H) ↔ well_founded r :=
 well_founded_lift₂_iff
 
-alias _root_.well_founded_lift_on₂'_iff ↔
-  _root_.well_founded.of_quotient_lift_on₂' _root_.well_founded.quotient_lift_on₂'
+alias well_founded_lift_on₂'_iff ↔
+  well_founded.of_quotient_lift_on₂' well_founded.quotient_lift_on₂'
+
+namespace rel_embedding
 
 /--
 To define an relation embedding from an antisymmetric relation `r` to a reflexive relation `s` it

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(order/rel_iso): well-founded instances for subtypes (#18699)
Diff
@@ -300,9 +300,18 @@ end
 protected theorem well_founded : ∀ (f : r ↪r s) (h : well_founded s), well_founded r
 | f ⟨H⟩ := ⟨λ a, f.acc _ (H _)⟩
 
+protected theorem is_well_founded (f : r ↪r s) [is_well_founded β s] : is_well_founded α r :=
+⟨f.well_founded is_well_founded.wf⟩
+
 protected theorem is_well_order : ∀ (f : r ↪r s) [is_well_order β s], is_well_order α r
 | f H := by exactI {wf := f.well_founded H.wf, ..f.is_strict_total_order}
 
+instance _root_.subtype.well_founded_lt [has_lt α] [well_founded_lt α] (p : α → Prop) :
+  well_founded_lt (subtype p) := (subtype.rel_embedding (<) p).is_well_founded
+
+instance _root_.subtype.well_founded_gt [has_lt α] [well_founded_gt α] (p : α → Prop) :
+  well_founded_gt (subtype p) := (subtype.rel_embedding (>) p).is_well_founded
+
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
 @[simps] def _root_.quotient.mk_rel_hom [setoid α] {r : α → α → Prop} (H) :
   r →r quotient.lift₂ r H :=

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

chore(*): golf using acc_lift₂_iff and well_founded_lift₂_iff (#18526)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -303,8 +303,14 @@ protected theorem well_founded : ∀ (f : r ↪r s) (h : well_founded s), well_f
 protected theorem is_well_order : ∀ (f : r ↪r s) [is_well_order β s], is_well_order α r
 | f H := by exactI {wf := f.well_founded H.wf, ..f.is_strict_total_order}
 
+/-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
+@[simps] def _root_.quotient.mk_rel_hom [setoid α] {r : α → α → Prop} (H) :
+  r →r quotient.lift₂ r H :=
+⟨@quotient.mk α _, λ _ _, id⟩
+
 /-- `quotient.out` as a relation embedding between the lift of a relation and the relation. -/
-@[simps] noncomputable def _root_.quotient.out_rel_embedding [s : setoid α] {r : α → α → Prop} (H) :
+@[simps]
+noncomputable def _root_.quotient.out_rel_embedding [setoid α] {r : α → α → Prop} (H) :
   quotient.lift₂ r H ↪r r :=
 ⟨embedding.quotient_out α, begin
   refine λ x y, quotient.induction_on₂ x y (λ a b, _),
@@ -312,20 +318,50 @@ protected theorem is_well_order : ∀ (f : r ↪r s) [is_well_order β s], is_we
   apply quotient.mk_out
 end⟩
 
+/-- `quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
+@[simps]
+noncomputable def _root_.quotient.out'_rel_embedding {s : setoid α} {r : α → α → Prop} (H) :
+  (λ a b, quotient.lift_on₂' a b r H) ↪r r :=
+{ to_fun := quotient.out',
+  ..quotient.out_rel_embedding _ }
+
+@[simp] theorem _root_.acc_lift₂_iff [setoid α] {r : α → α → Prop} {H} {a} :
+  acc (quotient.lift₂ r H) ⟦a⟧ ↔ acc r a :=
+begin
+  split,
+  { exact rel_hom_class.acc (quotient.mk_rel_hom H) a, },
+  { intro ac,
+    induction ac with _ H IH, dsimp at IH,
+    refine ⟨_, λ q h, _⟩,
+    obtain ⟨a', rfl⟩ := q.exists_rep,
+    exact IH a' h, },
+end
+
+@[simp] theorem _root_.acc_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} {a} :
+  acc (λ x y, quotient.lift_on₂' x y r H) (quotient.mk' a : quotient s) ↔ acc r a :=
+acc_lift₂_iff
+
 /-- A relation is well founded iff its lift to a quotient is. -/
-@[simp] theorem _root_.well_founded_lift₂_iff [s : setoid α] {r : α → α → Prop} {H} :
+theorem _root_.well_founded_lift₂_iff [setoid α] {r : α → α → Prop} {H} :
   well_founded (quotient.lift₂ r H) ↔ well_founded r :=
-⟨λ hr, begin
-  suffices : ∀ {x : quotient s} {a : α}, ⟦a⟧ = x → acc r a,
-  { exact ⟨λ a, this rfl⟩ },
-  { refine λ x, hr.induction x _,
-    rintros x IH a rfl,
-    exact ⟨_, λ b hb, IH ⟦b⟧ hb rfl⟩ }
-end, (quotient.out_rel_embedding H).well_founded⟩
+begin
+  split,
+  { exact rel_hom_class.well_founded (quotient.mk_rel_hom H), },
+  { refine λ wf, ⟨λ q, _⟩,
+    obtain ⟨a, rfl⟩ := q.exists_rep,
+    exact acc_lift₂_iff.2 (wf.apply a), },
+end
 
 alias _root_.well_founded_lift₂_iff ↔
   _root_.well_founded.of_quotient_lift₂ _root_.well_founded.quotient_lift₂
 
+@[simp] theorem _root_.well_founded_lift_on₂'_iff {s : setoid α} {r : α → α → Prop} {H} :
+  well_founded (λ x y : quotient s, quotient.lift_on₂' x y r H) ↔ well_founded r :=
+well_founded_lift₂_iff
+
+alias _root_.well_founded_lift_on₂'_iff ↔
+  _root_.well_founded.of_quotient_lift_on₂' _root_.well_founded.quotient_lift_on₂'
+
 /--
 To define an 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`.

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -201,9 +201,9 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
   by
   intro x y hxy
   rcases trichotomous_of r x y with (h | h | h)
-  have := hf h; rw [hxy] at this ; exfalso; exact irrefl_of s (f y) this
+  have := hf h; rw [hxy] at this; exfalso; exact irrefl_of s (f y) this
   exact h
-  have := hf h; rw [hxy] at this ; exfalso; exact irrefl_of s (f y) this
+  have := hf h; rw [hxy] at this; exfalso; exact irrefl_of s (f y) this
 #align injective_of_increasing injective_of_increasing
 -/
 
@@ -562,7 +562,7 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
   constructor
   · exact RelHomClass.acc (Quotient.mkRelHom H) a
   · intro ac
-    induction' ac with _ H IH; dsimp at IH 
+    induction' ac with _ H IH; dsimp at IH
     refine' ⟨_, fun q h => _⟩
     obtain ⟨a', rfl⟩ := q.exists_rep
     exact IH a' h
Diff
@@ -67,11 +67,11 @@ matching problem that Lean usually can't do unaided.
 -/
 class RelHomClass (F : Type _) {α β : outParam <| Type _} (r : outParam <| α → α → Prop)
     (s : outParam <| β → β → Prop) extends DFunLike F α fun _ => β where
-  map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
+  mapRel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
 #align rel_hom_class RelHomClass
 -/
 
-export RelHomClass (map_rel)
+export RelHomClass (mapRel)
 
 -- The free parameters `r` and `s` are `out_param`s so this is not dangerous.
 attribute [nolint dangerous_instance] RelHomClass.toFunLike
@@ -84,13 +84,13 @@ variable {F : Type _}
 
 #print RelHomClass.isIrrefl /-
 protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
-  | ⟨H⟩ => ⟨fun a h => H _ (map_rel f h)⟩
+  | ⟨H⟩ => ⟨fun a h => H _ (mapRel f h)⟩
 #align rel_hom_class.is_irrefl RelHomClass.isIrrefl
 -/
 
 #print RelHomClass.isAsymm /-
 protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAsymm α r
-  | ⟨H⟩ => ⟨fun a b h₁ h₂ => H _ _ (map_rel f h₁) (map_rel f h₂)⟩
+  | ⟨H⟩ => ⟨fun a b h₁ h₂ => H _ _ (mapRel f h₁) (mapRel f h₂)⟩
 #align rel_hom_class.is_asymm RelHomClass.isAsymm
 -/
 
@@ -116,7 +116,7 @@ namespace RelHom
 instance : RelHomClass (r →r s) r s where
   coe o := o.toFun
   coe_injective' f g h := by cases f; cases g; congr
-  map_rel := map_rel'
+  mapRel := map_rel'
 
 /-- Auxiliary instance if `rel_hom_class.to_fun_like.to_has_coe_to_fun` isn't found -/
 instance : CoeFun (r →r s) fun _ => α → β :=
@@ -181,7 +181,7 @@ protected def comp (g : s →r t) (f : r →r s) : r →r t :=
 #print RelHom.swap /-
 /-- A relation homomorphism is also a relation homomorphism between dual relations. -/
 protected def swap (f : r →r s) : swap r →r swap s :=
-  ⟨f, fun a b => f.map_rel⟩
+  ⟨f, fun a b => f.mapRel⟩
 #align rel_hom.swap RelHom.swap
 -/
 
@@ -211,7 +211,7 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
 /-- An increasing function is injective -/
 theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f : r →r s) :
     Injective f :=
-  injective_of_increasing r s f fun x y => f.map_rel
+  injective_of_increasing r s f fun x y => f.mapRel
 #align rel_hom.injective_of_increasing RelHom.injective_of_increasing
 -/
 
@@ -276,7 +276,7 @@ instance : CoeFun (r ↪r s) fun _ => α → β :=
 instance : RelHomClass (r ↪r s) r s where
   coe := coeFn
   coe_injective' f g h := by rcases f with ⟨⟨⟩⟩; rcases g with ⟨⟨⟩⟩; congr
-  map_rel f a b := Iff.mpr (map_rel_iff' f)
+  mapRel f a b := Iff.mpr (map_rel_iff' f)
 
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
 because it is a composition of multiple projections. -/
@@ -798,7 +798,7 @@ instance : CoeFun (r ≃r s) fun _ => α → β :=
 instance : RelHomClass (r ≃r s) r s where
   coe := coeFn
   coe_injective' := Equiv.coe_fn_injective.comp toEquiv_injective
-  map_rel f a b := Iff.mpr (map_rel_iff' f)
+  mapRel f a b := Iff.mpr (map_rel_iff' f)
 
 @[simp]
 theorem toRelEmbedding_eq_coe (f : r ≃r s) : f.toRelEmbedding = f :=
Diff
@@ -66,7 +66,7 @@ The relations `r` and `s` are `out_param`s since figuring them out from a goal i
 matching problem that Lean usually can't do unaided.
 -/
 class RelHomClass (F : Type _) {α β : outParam <| Type _} (r : outParam <| α → α → Prop)
-    (s : outParam <| β → β → Prop) extends FunLike F α fun _ => β where
+    (s : outParam <| β → β → Prop) extends DFunLike F α fun _ => β where
   map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
 #align rel_hom_class RelHomClass
 -/
@@ -145,20 +145,20 @@ theorem coe_fn_toFun (f : r →r s) : (f.toFun : α → β) = f :=
 #print RelHom.coe_fn_injective /-
 /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r →r s) (α → β) coeFn :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_hom.coe_fn_injective RelHom.coe_fn_injective
 -/
 
 #print RelHom.ext /-
 @[ext]
 theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align rel_hom.ext RelHom.ext
 -/
 
 #print RelHom.ext_iff /-
 theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_hom.ext_iff RelHom.ext_iff
 -/
 
@@ -332,20 +332,20 @@ theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
 #print RelEmbedding.coe_fn_injective /-
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injective
 -/
 
 #print RelEmbedding.ext /-
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext _ _ h
+  DFunLike.ext _ _ h
 #align rel_embedding.ext RelEmbedding.ext
 -/
 
 #print RelEmbedding.ext_iff /-
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_embedding.ext_iff RelEmbedding.ext_iff
 -/
 
@@ -834,20 +834,20 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
 theorem coe_fn_injective : @Function.Injective (r ≃r s) (α → β) coeFn :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_iso.coe_fn_injective RelIso.coe_fn_injective
 -/
 
 #print RelIso.ext /-
 @[ext]
 theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align rel_iso.ext RelIso.ext
 -/
 
 #print RelIso.ext_iff /-
 theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_iso.ext_iff RelIso.ext_iff
 -/
 
Diff
@@ -278,13 +278,11 @@ instance : RelHomClass (r ↪r s) r s where
   coe_injective' f g h := by rcases f with ⟨⟨⟩⟩; rcases g with ⟨⟨⟩⟩; congr
   map_rel f a b := Iff.mpr (map_rel_iff' f)
 
-#print RelEmbedding.Simps.apply /-
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
 because it is a composition of multiple projections. -/
 def Simps.apply (h : r ↪r s) : α → β :=
   h
 #align rel_embedding.simps.apply RelEmbedding.Simps.apply
--/
 
 initialize_simps_projections RelEmbedding (to_embedding_to_fun → apply, -toEmbedding)
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 -/
-import Mathbin.Data.FunLike.Basic
-import Mathbin.Logic.Embedding.Basic
-import Mathbin.Order.RelClasses
+import Data.FunLike.Basic
+import Logic.Embedding.Basic
+import Order.RelClasses
 
 #align_import order.rel_iso.basic from "leanprover-community/mathlib"@"f29120f82f6e24a6f6579896dfa2de6769fec962"
 
Diff
@@ -215,9 +215,9 @@ theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f
 #align rel_hom.injective_of_increasing RelHom.injective_of_increasing
 -/
 
-#print Surjective.wellFounded_iff /-
+#print Function.Surjective.wellFounded_iff /-
 -- TODO: define a `rel_iff_class` so we don't have to do all the `convert` trickery?
-theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
+theorem Function.Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
     (o : ∀ {a b}, r a b ↔ s (f a) (f b)) : WellFounded r ↔ WellFounded s :=
   Iff.intro
     (by
@@ -226,7 +226,7 @@ theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
       intro a b h; apply o.2; convert h
       iterate 2 apply Classical.choose_spec hf.has_right_inverse)
     (RelHomClass.wellFounded (⟨f, fun _ _ => o.1⟩ : r →r s))
-#align surjective.well_founded_iff Surjective.wellFounded_iff
+#align surjective.well_founded_iff Function.Surjective.wellFounded_iff
 -/
 
 #print RelEmbedding /-
Diff
@@ -592,7 +592,7 @@ theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop} {H} :
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 -/
 
-alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.quotient_lift₂
+alias ⟨WellFounded.of_quotient_lift₂, WellFounded.quotient_lift₂⟩ := wellFounded_lift₂_iff
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
@@ -604,7 +604,7 @@ theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H}
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
 -/
 
-alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
+alias ⟨WellFounded.of_quotient_liftOn₂', WellFounded.quotient_liftOn₂'⟩ := wellFounded_liftOn₂'_iff
 #align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
 #align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2017 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit f29120f82f6e24a6f6579896dfa2de6769fec962
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.FunLike.Basic
 import Mathbin.Logic.Embedding.Basic
 import Mathbin.Order.RelClasses
 
+#align_import order.rel_iso.basic from "leanprover-community/mathlib"@"f29120f82f6e24a6f6579896dfa2de6769fec962"
+
 /-!
 # Relation homomorphisms, embeddings, isomorphisms
 
Diff
@@ -402,7 +402,7 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 -/
 
 #print RelEmbedding.eq_preimage /-
-theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by ext (a b); exact f.map_rel_iff.symm
+theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by ext a b; exact f.map_rel_iff.symm
 #align rel_embedding.eq_preimage RelEmbedding.eq_preimage
 -/
 
Diff
@@ -57,7 +57,6 @@ structure RelHom {α β : Type _} (r : α → α → Prop) (s : β → β → Pr
 #align rel_hom RelHom
 -/
 
--- mathport name: «expr →r »
 infixl:25 " →r " => RelHom
 
 section
@@ -86,24 +85,32 @@ namespace RelHomClass
 
 variable {F : Type _}
 
+#print RelHomClass.isIrrefl /-
 protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
   | ⟨H⟩ => ⟨fun a h => H _ (map_rel f h)⟩
 #align rel_hom_class.is_irrefl RelHomClass.isIrrefl
+-/
 
+#print RelHomClass.isAsymm /-
 protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAsymm α r
   | ⟨H⟩ => ⟨fun a b h₁ h₂ => H _ _ (map_rel f h₁) (map_rel f h₂)⟩
 #align rel_hom_class.is_asymm RelHomClass.isAsymm
+-/
 
+#print RelHomClass.acc /-
 protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc r a :=
   by
   generalize h : f a = b; intro ac
   induction' ac with _ H IH generalizing a; subst h
   exact ⟨_, fun a' h => IH (f a') (map_rel f h) _ rfl⟩
 #align rel_hom_class.acc RelHomClass.acc
+-/
 
+#print RelHomClass.wellFounded /-
 protected theorem wellFounded [RelHomClass F r s] (f : F) : ∀ h : WellFounded s, WellFounded r
   | ⟨H⟩ => ⟨fun a => RelHomClass.acc f _ (H _)⟩
 #align rel_hom_class.well_founded RelHomClass.wellFounded
+-/
 
 end RelHomClass
 
@@ -120,33 +127,43 @@ instance : CoeFun (r →r s) fun _ => α → β :=
 
 initialize_simps_projections RelHom (toFun → apply)
 
+#print RelHom.map_rel /-
 protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b) :=
   f.map_rel'
 #align rel_hom.map_rel RelHom.map_rel
+-/
 
 @[simp]
 theorem coeFn_mk (f : α → β) (o) : (@RelHom.mk _ _ r s f o : α → β) = f :=
   rfl
 #align rel_hom.coe_fn_mk RelHom.coeFn_mk
 
+#print RelHom.coe_fn_toFun /-
 @[simp]
 theorem coe_fn_toFun (f : r →r s) : (f.toFun : α → β) = f :=
   rfl
 #align rel_hom.coe_fn_to_fun RelHom.coe_fn_toFun
+-/
 
+#print RelHom.coe_fn_injective /-
 /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r →r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_hom.coe_fn_injective RelHom.coe_fn_injective
+-/
 
+#print RelHom.ext /-
 @[ext]
 theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align rel_hom.ext RelHom.ext
+-/
 
+#print RelHom.ext_iff /-
 theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_hom.ext_iff RelHom.ext_iff
+-/
 
 #print RelHom.id /-
 /-- Identity map is a relation homomorphism. -/
@@ -180,6 +197,7 @@ def preimage (f : α → β) (s : β → β → Prop) : f ⁻¹'o s →r s :=
 
 end RelHom
 
+#print injective_of_increasing /-
 /-- 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 :=
@@ -190,13 +208,17 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
   exact h
   have := hf h; rw [hxy] at this ; exfalso; exact irrefl_of s (f y) this
 #align injective_of_increasing injective_of_increasing
+-/
 
+#print RelHom.injective_of_increasing /-
 /-- An increasing function is injective -/
 theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f : r →r s) :
     Injective f :=
   injective_of_increasing r s f fun x y => f.map_rel
 #align rel_hom.injective_of_increasing RelHom.injective_of_increasing
+-/
 
+#print Surjective.wellFounded_iff /-
 -- TODO: define a `rel_iff_class` so we don't have to do all the `convert` trickery?
 theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
     (o : ∀ {a b}, r a b ↔ s (f a) (f b)) : WellFounded r ↔ WellFounded s :=
@@ -208,6 +230,7 @@ theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
       iterate 2 apply Classical.choose_spec hf.has_right_inverse)
     (RelHomClass.wellFounded (⟨f, fun _ _ => o.1⟩ : r →r s))
 #align surjective.well_founded_iff Surjective.wellFounded_iff
+-/
 
 #print RelEmbedding /-
 /-- A relation embedding with respect to a given pair of relations `r` and `s`
@@ -217,7 +240,6 @@ structure RelEmbedding {α β : Type _} (r : α → α → Prop) (s : β → β
 #align rel_embedding RelEmbedding
 -/
 
--- mathport name: «expr ↪r »
 infixl:25 " ↪r " => RelEmbedding
 
 #print Subtype.relEmbedding /-
@@ -228,10 +250,12 @@ def Subtype.relEmbedding {X : Type _} (r : X → X → Prop) (p : X → Prop) :
 #align subtype.rel_embedding Subtype.relEmbedding
 -/
 
+#print preimage_equivalence /-
 theorem preimage_equivalence {α β} (f : α → β) {s : β → β → Prop} (hs : Equivalence s) :
     Equivalence (f ⁻¹'o s) :=
   ⟨fun a => hs.1 _, fun a b h => hs.2.1 h, fun a b c h₁ h₂ => hs.2.2 h₁ h₂⟩
 #align preimage_equivalence preimage_equivalence
+-/
 
 namespace RelEmbedding
 
@@ -277,42 +301,58 @@ theorem coe_coeFn (f : r ↪r s) : ((f : r →r s) : α → β) = f :=
   rfl
 #align rel_embedding.coe_coe_fn RelEmbedding.coe_coeFn
 
+#print RelEmbedding.injective /-
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
 #align rel_embedding.injective RelEmbedding.injective
+-/
 
+#print RelEmbedding.inj /-
 @[simp]
 theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
   f.Injective.eq_iff
 #align rel_embedding.inj RelEmbedding.inj
+-/
 
+#print RelEmbedding.map_rel_iff /-
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_embedding.map_rel_iff RelEmbedding.map_rel_iff
+-/
 
+#print RelEmbedding.coe_mk /-
 @[simp]
 theorem coe_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β) = f :=
   rfl
 #align rel_embedding.coe_fn_mk RelEmbedding.coe_mk
+-/
 
+#print RelEmbedding.coe_toEmbedding /-
 @[simp]
 theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
   rfl
 #align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbedding
+-/
 
+#print RelEmbedding.coe_fn_injective /-
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injective
+-/
 
+#print RelEmbedding.ext /-
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext _ _ h
 #align rel_embedding.ext RelEmbedding.ext
+-/
 
+#print RelEmbedding.ext_iff /-
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_embedding.ext_iff RelEmbedding.ext_iff
+-/
 
 #print RelEmbedding.refl /-
 /-- Identity map is a relation embedding. -/
@@ -333,14 +373,18 @@ protected def trans (f : r ↪r s) (g : s ↪r t) : r ↪r t :=
 instance (r : α → α → Prop) : Inhabited (r ↪r r) :=
   ⟨RelEmbedding.refl _⟩
 
+#print RelEmbedding.trans_apply /-
 theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a) :=
   rfl
 #align rel_embedding.trans_apply RelEmbedding.trans_apply
+-/
 
+#print RelEmbedding.coe_trans /-
 @[simp]
 theorem coe_trans (f : r ↪r s) (g : s ↪r t) : ⇑(f.trans g) = g ∘ f :=
   rfl
 #align rel_embedding.coe_trans RelEmbedding.coe_trans
+-/
 
 #print RelEmbedding.swap /-
 /-- A relation embedding is also a relation embedding between dual relations. -/
@@ -357,80 +401,116 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 #align rel_embedding.preimage RelEmbedding.preimage
 -/
 
+#print RelEmbedding.eq_preimage /-
 theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by ext (a b); exact f.map_rel_iff.symm
 #align rel_embedding.eq_preimage RelEmbedding.eq_preimage
+-/
 
+#print RelEmbedding.isIrrefl /-
 protected theorem isIrrefl (f : r ↪r s) [IsIrrefl β s] : IsIrrefl α r :=
   ⟨fun a => mt f.map_rel_iff.2 (irrefl (f a))⟩
 #align rel_embedding.is_irrefl RelEmbedding.isIrrefl
+-/
 
+#print RelEmbedding.isRefl /-
 protected theorem isRefl (f : r ↪r s) [IsRefl β s] : IsRefl α r :=
   ⟨fun a => f.map_rel_iff.1 <| refl _⟩
 #align rel_embedding.is_refl RelEmbedding.isRefl
+-/
 
+#print RelEmbedding.isSymm /-
 protected theorem isSymm (f : r ↪r s) [IsSymm β s] : IsSymm α r :=
   ⟨fun a b => imp_imp_imp f.map_rel_iff.2 f.map_rel_iff.1 symm⟩
 #align rel_embedding.is_symm RelEmbedding.isSymm
+-/
 
+#print RelEmbedding.isAsymm /-
 protected theorem isAsymm (f : r ↪r s) [IsAsymm β s] : IsAsymm α r :=
   ⟨fun a b h₁ h₂ => asymm (f.map_rel_iff.2 h₁) (f.map_rel_iff.2 h₂)⟩
 #align rel_embedding.is_asymm RelEmbedding.isAsymm
+-/
 
+#print RelEmbedding.isAntisymm /-
 protected theorem isAntisymm : ∀ (f : r ↪r s) [IsAntisymm β s], IsAntisymm α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b h₁ h₂ => f.inj' (H _ _ (o.2 h₁) (o.2 h₂))⟩
 #align rel_embedding.is_antisymm RelEmbedding.isAntisymm
+-/
 
+#print RelEmbedding.isTrans /-
 protected theorem isTrans : ∀ (f : r ↪r s) [IsTrans β s], IsTrans α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b c h₁ h₂ => o.1 (H _ _ _ (o.2 h₁) (o.2 h₂))⟩
 #align rel_embedding.is_trans RelEmbedding.isTrans
+-/
 
+#print RelEmbedding.isTotal /-
 protected theorem isTotal : ∀ (f : r ↪r s) [IsTotal β s], IsTotal α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b => (or_congr o o).1 (H _ _)⟩
 #align rel_embedding.is_total RelEmbedding.isTotal
+-/
 
+#print RelEmbedding.isPreorder /-
 protected theorem isPreorder : ∀ (f : r ↪r s) [IsPreorder β s], IsPreorder α r
   | f, H => { f.is_refl, f.is_trans with }
 #align rel_embedding.is_preorder RelEmbedding.isPreorder
+-/
 
+#print RelEmbedding.isPartialOrder /-
 protected theorem isPartialOrder : ∀ (f : r ↪r s) [IsPartialOrder β s], IsPartialOrder α r
   | f, H => { f.is_preorder, f.is_antisymm with }
 #align rel_embedding.is_partial_order RelEmbedding.isPartialOrder
+-/
 
+#print RelEmbedding.isLinearOrder /-
 protected theorem isLinearOrder : ∀ (f : r ↪r s) [IsLinearOrder β s], IsLinearOrder α r
   | f, H => { f.is_partial_order, f.is_total with }
 #align rel_embedding.is_linear_order RelEmbedding.isLinearOrder
+-/
 
+#print RelEmbedding.isStrictOrder /-
 protected theorem isStrictOrder : ∀ (f : r ↪r s) [IsStrictOrder β s], IsStrictOrder α r
   | f, H => { f.is_irrefl, f.is_trans with }
 #align rel_embedding.is_strict_order RelEmbedding.isStrictOrder
+-/
 
+#print RelEmbedding.isTrichotomous /-
 protected theorem isTrichotomous : ∀ (f : r ↪r s) [IsTrichotomous β s], IsTrichotomous α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b => (or_congr o (or_congr f.inj'.eq_iff o)).1 (H _ _)⟩
 #align rel_embedding.is_trichotomous RelEmbedding.isTrichotomous
+-/
 
+#print RelEmbedding.isStrictTotalOrder /-
 protected theorem isStrictTotalOrder :
     ∀ (f : r ↪r s) [IsStrictTotalOrder β s], IsStrictTotalOrder α r
   | f, H => { f.is_trichotomous, f.is_strict_order with }
 #align rel_embedding.is_strict_total_order RelEmbedding.isStrictTotalOrder
+-/
 
+#print RelEmbedding.acc /-
 protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a :=
   by
   generalize h : f a = b; intro ac
   induction' ac with _ H IH generalizing a; subst h
   exact ⟨_, fun a' h => IH (f a') (f.map_rel_iff.2 h) _ rfl⟩
 #align rel_embedding.acc RelEmbedding.acc
+-/
 
+#print RelEmbedding.wellFounded /-
 protected theorem wellFounded : ∀ (f : r ↪r s) (h : WellFounded s), WellFounded r
   | f, ⟨H⟩ => ⟨fun a => f.Acc _ (H _)⟩
 #align rel_embedding.well_founded RelEmbedding.wellFounded
+-/
 
+#print RelEmbedding.isWellFounded /-
 protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r :=
   ⟨f.WellFounded IsWellFounded.wf⟩
 #align rel_embedding.is_well_founded RelEmbedding.isWellFounded
+-/
 
+#print RelEmbedding.isWellOrder /-
 protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrder α r
   | f, H => { f.is_strict_total_order with wf := f.well_founded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
+-/
 
 end RelEmbedding
 
@@ -546,11 +626,13 @@ def ofMapRelIff (f : α → β) [IsAntisymm α r] [IsRefl β s] (hf : ∀ a b, s
 #align rel_embedding.of_map_rel_iff RelEmbedding.ofMapRelIff
 -/
 
+#print RelEmbedding.ofMapRelIff_coe /-
 @[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 :=
   rfl
 #align rel_embedding.of_map_rel_iff_coe RelEmbedding.ofMapRelIff_coe
+-/
 
 #print RelEmbedding.ofMonotone /-
 /-- It suffices to prove `f` is monotone between strict relations
@@ -568,11 +650,13 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
 #align rel_embedding.of_monotone RelEmbedding.ofMonotone
 -/
 
+#print RelEmbedding.ofMonotone_coe /-
 @[simp]
 theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
     (@ofMonotone _ _ r s _ _ f H : α → β) = f :=
   rfl
 #align rel_embedding.of_monotone_coe RelEmbedding.ofMonotone_coe
+-/
 
 #print RelEmbedding.ofIsEmpty /-
 /-- A relation embedding from an empty type. -/
@@ -689,7 +773,6 @@ structure RelIso {α β : Type _} (r : α → α → Prop) (s : β → β → Pr
 #align rel_iso RelIso
 -/
 
--- mathport name: «expr ≃r »
 infixl:25 " ≃r " => RelIso
 
 namespace RelIso
@@ -703,9 +786,11 @@ def toRelEmbedding (f : r ≃r s) : r ↪r s :=
 #align rel_iso.to_rel_embedding RelIso.toRelEmbedding
 -/
 
+#print RelIso.toEquiv_injective /-
 theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
   | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by congr; exact h
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
+-/
 
 instance : Coe (r ≃r s) (r ↪r s) :=
   ⟨toRelEmbedding⟩
@@ -730,34 +815,46 @@ theorem coe_coeFn (f : r ≃r s) : ((f : r ↪r s) : α → β) = f :=
   rfl
 #align rel_iso.coe_coe_fn RelIso.coe_coeFn
 
+#print RelIso.map_rel_iff /-
 theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_iso.map_rel_iff RelIso.map_rel_iff
+-/
 
+#print RelIso.coe_fn_mk /-
 @[simp]
 theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) : (RelIso.mk f o : α → β) = f :=
   rfl
 #align rel_iso.coe_fn_mk RelIso.coe_fn_mk
+-/
 
+#print RelIso.coe_fn_toEquiv /-
 @[simp]
 theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
   rfl
 #align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquiv
+-/
 
+#print RelIso.coe_fn_injective /-
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
 theorem coe_fn_injective : @Function.Injective (r ≃r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_iso.coe_fn_injective RelIso.coe_fn_injective
+-/
 
+#print RelIso.ext /-
 @[ext]
 theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align rel_iso.ext RelIso.ext
+-/
 
+#print RelIso.ext_iff /-
 theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_iso.ext_iff RelIso.ext_iff
+-/
 
 #print RelIso.symm /-
 /-- Inverse map of a relation isomorphism is a relation isomorphism. -/
@@ -852,45 +949,63 @@ protected def swap (f : r ≃r s) : swap r ≃r swap s :=
 #align rel_iso.swap RelIso.swap
 -/
 
+#print RelIso.coe_fn_symm_mk /-
 @[simp]
 theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.symm :=
   rfl
 #align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mk
+-/
 
+#print RelIso.apply_symm_apply /-
 @[simp]
 theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x :=
   e.toEquiv.apply_symm_apply x
 #align rel_iso.apply_symm_apply RelIso.apply_symm_apply
+-/
 
+#print RelIso.symm_apply_apply /-
 @[simp]
 theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x :=
   e.toEquiv.symm_apply_apply x
 #align rel_iso.symm_apply_apply RelIso.symm_apply_apply
+-/
 
+#print RelIso.rel_symm_apply /-
 theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.rel_symm_apply RelIso.rel_symm_apply
+-/
 
+#print RelIso.symm_apply_rel /-
 theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.symm_apply_rel RelIso.symm_apply_rel
+-/
 
+#print RelIso.bijective /-
 protected theorem bijective (e : r ≃r s) : Bijective e :=
   e.toEquiv.Bijective
 #align rel_iso.bijective RelIso.bijective
+-/
 
+#print RelIso.injective /-
 protected theorem injective (e : r ≃r s) : Injective e :=
   e.toEquiv.Injective
 #align rel_iso.injective RelIso.injective
+-/
 
+#print RelIso.surjective /-
 protected theorem surjective (e : r ≃r s) : Surjective e :=
   e.toEquiv.Surjective
 #align rel_iso.surjective RelIso.surjective
+-/
 
+#print RelIso.eq_iff_eq /-
 @[simp]
 theorem eq_iff_eq (f : r ≃r s) {a b} : f a = f b ↔ a = b :=
   f.Injective.eq_iff
 #align rel_iso.eq_iff_eq RelIso.eq_iff_eq
+-/
 
 #print RelIso.preimage /-
 /-- Any equivalence lifts to a relation isomorphism between `s` and its preimage. -/
@@ -913,11 +1028,13 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 #align rel_iso.is_well_order.ulift RelIso.IsWellOrder.ulift
 -/
 
+#print RelIso.ofSurjective /-
 /-- A surjective relation embedding is a relation isomorphism. -/
 @[simps apply]
 noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s :=
   ⟨Equiv.ofBijective f ⟨f.Injective, H⟩, fun a b => f.map_rel_iff⟩
 #align rel_iso.of_surjective RelIso.ofSurjective
+-/
 
 #print RelIso.sumLexCongr /-
 /-- Given relation isomorphisms `r₁ ≃r s₁` and `r₂ ≃r s₂`, construct a relation isomorphism for the
Diff
@@ -70,7 +70,7 @@ The relations `r` and `s` are `out_param`s since figuring them out from a goal i
 matching problem that Lean usually can't do unaided.
 -/
 class RelHomClass (F : Type _) {α β : outParam <| Type _} (r : outParam <| α → α → Prop)
-  (s : outParam <| β → β → Prop) extends FunLike F α fun _ => β where
+    (s : outParam <| β → β → Prop) extends FunLike F α fun _ => β where
   map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
 #align rel_hom_class RelHomClass
 -/
@@ -186,9 +186,9 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
   by
   intro x y hxy
   rcases trichotomous_of r x y with (h | h | h)
-  have := hf h; rw [hxy] at this; exfalso; exact irrefl_of s (f y) this
+  have := hf h; rw [hxy] at this ; exfalso; exact irrefl_of s (f y) this
   exact h
-  have := hf h; rw [hxy] at this; exfalso; exact irrefl_of s (f y) this
+  have := hf h; rw [hxy] at this ; exfalso; exact irrefl_of s (f y) this
 #align injective_of_increasing injective_of_increasing
 
 /-- An increasing function is injective -/
@@ -487,7 +487,7 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
   constructor
   · exact RelHomClass.acc (Quotient.mkRelHom H) a
   · intro ac
-    induction' ac with _ H IH; dsimp at IH
+    induction' ac with _ H IH; dsimp at IH 
     refine' ⟨_, fun q h => _⟩
     obtain ⟨a', rfl⟩ := q.exists_rep
     exact IH a' h
@@ -704,7 +704,7 @@ def toRelEmbedding (f : r ≃r s) : r ↪r s :=
 -/
 
 theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
-  | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by congr ; exact h
+  | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by congr; exact h
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
 
 instance : Coe (r ≃r s) (r ↪r s) :=
Diff
@@ -86,32 +86,14 @@ namespace RelHomClass
 
 variable {F : Type _}
 
-/- warning: rel_hom_class.is_irrefl -> RelHomClass.isIrrefl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u1, u2} F α β r s], F -> (forall [_inst_2 : IsIrrefl.{u2} β s], IsIrrefl.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s], F -> (forall [_inst_2 : IsIrrefl.{u1} β s], IsIrrefl.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_hom_class.is_irrefl RelHomClass.isIrreflₓ'. -/
 protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
   | ⟨H⟩ => ⟨fun a h => H _ (map_rel f h)⟩
 #align rel_hom_class.is_irrefl RelHomClass.isIrrefl
 
-/- warning: rel_hom_class.is_asymm -> RelHomClass.isAsymm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u1, u2} F α β r s], F -> (forall [_inst_2 : IsAsymm.{u2} β s], IsAsymm.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s], F -> (forall [_inst_2 : IsAsymm.{u1} β s], IsAsymm.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_hom_class.is_asymm RelHomClass.isAsymmₓ'. -/
 protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAsymm α r
   | ⟨H⟩ => ⟨fun a b h₁ h₂ => H _ _ (map_rel f h₁) (map_rel f h₂)⟩
 #align rel_hom_class.is_asymm RelHomClass.isAsymm
 
-/- warning: rel_hom_class.acc -> RelHomClass.acc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u1, u2} F α β r s] (f : F) (a : α), (Acc.{succ u2} β s (coeFn.{succ u3, max (succ u1) (succ u2)} F (fun (_x : F) => α -> β) (FunLike.hasCoeToFun.{succ u3, succ u1, succ u2} F α (fun (_x : α) => β) (RelHomClass.toFunLike.{u3, u1, u2} F α β r s _inst_1)) f a)) -> (Acc.{succ u1} α r a)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s] (f : F) (a : α), (Acc.{succ u1} β s (FunLike.coe.{succ u3, succ u2, succ u1} F α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{u3, u2, u1} F α β r s _inst_1) f a)) -> (Acc.{succ u2} α r a)
-Case conversion may be inaccurate. Consider using '#align rel_hom_class.acc RelHomClass.accₓ'. -/
 protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc r a :=
   by
   generalize h : f a = b; intro ac
@@ -119,12 +101,6 @@ protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc
   exact ⟨_, fun a' h => IH (f a') (map_rel f h) _ rfl⟩
 #align rel_hom_class.acc RelHomClass.acc
 
-/- warning: rel_hom_class.well_founded -> RelHomClass.wellFounded is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u1, u2} F α β r s], F -> (WellFounded.{succ u2} β s) -> (WellFounded.{succ u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s], F -> (WellFounded.{succ u1} β s) -> (WellFounded.{succ u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_hom_class.well_founded RelHomClass.wellFoundedₓ'. -/
 protected theorem wellFounded [RelHomClass F r s] (f : F) : ∀ h : WellFounded s, WellFounded r
   | ⟨H⟩ => ⟨fun a => RelHomClass.acc f _ (H _)⟩
 #align rel_hom_class.well_founded RelHomClass.wellFounded
@@ -144,12 +120,6 @@ instance : CoeFun (r →r s) fun _ => α → β :=
 
 initialize_simps_projections RelHom (toFun → apply)
 
-/- warning: rel_hom.map_rel -> RelHom.map_rel is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u1, u2} α β r s) {a : α} {b : α}, (r a b) -> (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s) {a : α} {b : α}, (r a b) -> (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f b))
-Case conversion may be inaccurate. Consider using '#align rel_hom.map_rel RelHom.map_relₓ'. -/
 protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b) :=
   f.map_rel'
 #align rel_hom.map_rel RelHom.map_rel
@@ -159,45 +129,21 @@ theorem coeFn_mk (f : α → β) (o) : (@RelHom.mk _ _ r s f o : α → β) = f
   rfl
 #align rel_hom.coe_fn_mk RelHom.coeFn_mk
 
-/- warning: rel_hom.coe_fn_to_fun -> RelHom.coe_fn_toFun is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} (α -> β) (RelHom.toFun.{u1, u2} α β r s f) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (α -> β) (RelHom.toFun.{u2, u1} α β r s f) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_hom.coe_fn_to_fun RelHom.coe_fn_toFunₓ'. -/
 @[simp]
 theorem coe_fn_toFun (f : r →r s) : (f.toFun : α → β) = f :=
   rfl
 #align rel_hom.coe_fn_to_fun RelHom.coe_fn_toFun
 
-/- warning: rel_hom.coe_fn_injective -> RelHom.coe_fn_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (ᾰ : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (fun (f : RelHom.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_hom.coe_fn_injective RelHom.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r →r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_hom.coe_fn_injective RelHom.coe_fn_injective
 
-/- warning: rel_hom.ext -> RelHom.ext is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelHom.{u1, u2} α β r s}} {{g : RelHom.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) f g)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelHom.{u2, u1} α β r s}} {{g : RelHom.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g)
-Case conversion may be inaccurate. Consider using '#align rel_hom.ext RelHom.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align rel_hom.ext RelHom.ext
 
-/- warning: rel_hom.ext_iff -> RelHom.ext_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelHom.{u1, u2} α β r s} {g : RelHom.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) g x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelHom.{u2, u1} α β r s} {g : RelHom.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x))
-Case conversion may be inaccurate. Consider using '#align rel_hom.ext_iff RelHom.ext_iffₓ'. -/
 theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_hom.ext_iff RelHom.ext_iff
@@ -234,12 +180,6 @@ def preimage (f : α → β) (s : β → β → Prop) : f ⁻¹'o s →r s :=
 
 end RelHom
 
-/- warning: injective_of_increasing -> injective_of_increasing is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (r : α -> α -> Prop) (s : β -> β -> Prop) [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsIrrefl.{u2} β s] (f : α -> β), (forall {x : α} {y : α}, (r x y) -> (s (f x) (f y))) -> (Function.Injective.{succ u1, succ u2} α β f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (r : α -> α -> Prop) (s : β -> β -> Prop) [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsIrrefl.{u1} β s] (f : α -> β), (forall {x : α} {y : α}, (r x y) -> (s (f x) (f y))) -> (Function.Injective.{succ u2, succ u1} α β f)
-Case conversion may be inaccurate. Consider using '#align injective_of_increasing injective_of_increasingₓ'. -/
 /-- 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 :=
@@ -251,24 +191,12 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
   have := hf h; rw [hxy] at this; exfalso; exact irrefl_of s (f y) this
 #align injective_of_increasing injective_of_increasing
 
-/- warning: rel_hom.injective_of_increasing -> RelHom.injective_of_increasing is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsIrrefl.{u2} β s] (f : RelHom.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsIrrefl.{u1} β s] (f : RelHom.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_hom.injective_of_increasing RelHom.injective_of_increasingₓ'. -/
 /-- An increasing function is injective -/
 theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f : r →r s) :
     Injective f :=
   injective_of_increasing r s f fun x y => f.map_rel
 #align rel_hom.injective_of_increasing RelHom.injective_of_increasing
 
-/- warning: surjective.well_founded_iff -> Surjective.wellFounded_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : α -> β}, (Function.Surjective.{succ u1, succ u2} α β f) -> (forall {a : α} {b : α}, Iff (r a b) (s (f a) (f b))) -> (Iff (WellFounded.{succ u1} α r) (WellFounded.{succ u2} β s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : α -> β}, (Function.Surjective.{succ u2, succ u1} α β f) -> (forall {a : α} {b : α}, Iff (r a b) (s (f a) (f b))) -> (Iff (WellFounded.{succ u2} α r) (WellFounded.{succ u1} β s))
-Case conversion may be inaccurate. Consider using '#align surjective.well_founded_iff Surjective.wellFounded_iffₓ'. -/
 -- TODO: define a `rel_iff_class` so we don't have to do all the `convert` trickery?
 theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
     (o : ∀ {a b}, r a b ↔ s (f a) (f b)) : WellFounded r ↔ WellFounded s :=
@@ -300,12 +228,6 @@ def Subtype.relEmbedding {X : Type _} (r : X → X → Prop) (p : X → Prop) :
 #align subtype.rel_embedding Subtype.relEmbedding
 -/
 
-/- warning: preimage_equivalence -> preimage_equivalence is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} (f : α -> β) {s : β -> β -> Prop}, (Equivalence.{u2} β s) -> (Equivalence.{u1} α (Order.Preimage.{u1, u2} α β f s))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} (f : α -> β) {s : β -> β -> Prop}, (Equivalence.{u1} β s) -> (Equivalence.{u2} α (Order.Preimage.{u2, u1} α β f s))
-Case conversion may be inaccurate. Consider using '#align preimage_equivalence preimage_equivalenceₓ'. -/
 theorem preimage_equivalence {α β} (f : α → β) {s : β → β → Prop} (hs : Equivalence s) :
     Equivalence (f ⁻¹'o s) :=
   ⟨fun a => hs.1 _, fun a b h => hs.2.1 h, fun a b c h₁ h₂ => hs.2.2 h₁ h₂⟩
@@ -355,87 +277,39 @@ theorem coe_coeFn (f : r ↪r s) : ((f : r →r s) : α → β) = f :=
   rfl
 #align rel_embedding.coe_coe_fn RelEmbedding.coe_coeFn
 
-/- warning: rel_embedding.injective -> RelEmbedding.injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.injective RelEmbedding.injectiveₓ'. -/
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
 #align rel_embedding.injective RelEmbedding.injective
 
-/- warning: rel_embedding.inj -> RelEmbedding.inj is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (Eq.{succ u1} α a b)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.inj RelEmbedding.injₓ'. -/
 @[simp]
 theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
   f.Injective.eq_iff
 #align rel_embedding.inj RelEmbedding.inj
 
-/- warning: rel_embedding.map_rel_iff -> RelEmbedding.map_rel_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (r a b)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (r a b)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.map_rel_iff RelEmbedding.map_rel_iffₓ'. -/
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_embedding.map_rel_iff RelEmbedding.map_rel_iff
 
-/- warning: rel_embedding.coe_fn_mk -> RelEmbedding.coe_mk is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Function.Embedding.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : Function.Embedding.{succ u2, succ u1} α β} {o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f b)) (r a b)}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.mk.{u2, u1} α β r s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_mk RelEmbedding.coe_mkₓ'. -/
 @[simp]
 theorem coe_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β) = f :=
   rfl
 #align rel_embedding.coe_fn_mk RelEmbedding.coe_mk
 
-/- warning: rel_embedding.coe_fn_to_embedding -> RelEmbedding.coe_toEmbedding is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbeddingₓ'. -/
 @[simp]
 theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
   rfl
 #align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbedding
 
-/- warning: rel_embedding.coe_fn_injective -> RelEmbedding.coe_fn_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (ᾰ : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (fun (f : RelEmbedding.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injective
 
-/- warning: rel_embedding.ext -> RelEmbedding.ext is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u1, u2} α β r s}} {{g : RelEmbedding.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u2, u1} α β r s}} {{g : RelEmbedding.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.ext RelEmbedding.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext _ _ h
 #align rel_embedding.ext RelEmbedding.ext
 
-/- warning: rel_embedding.ext_iff -> RelEmbedding.ext_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u1, u2} α β r s} {g : RelEmbedding.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s} {g : RelEmbedding.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x))
-Case conversion may be inaccurate. Consider using '#align rel_embedding.ext_iff RelEmbedding.ext_iffₓ'. -/
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_embedding.ext_iff RelEmbedding.ext_iff
@@ -459,22 +333,10 @@ protected def trans (f : r ↪r s) (g : s ↪r t) : r ↪r t :=
 instance (r : α → α → Prop) : Inhabited (r ↪r r) :=
   ⟨RelEmbedding.refl _⟩
 
-/- warning: rel_embedding.trans_apply -> RelEmbedding.trans_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t) (a : α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g) a) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t) (a : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) a) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f a))
-Case conversion may be inaccurate. Consider using '#align rel_embedding.trans_apply RelEmbedding.trans_applyₓ'. -/
 theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a) :=
   rfl
 #align rel_embedding.trans_apply RelEmbedding.trans_apply
 
-/- warning: rel_embedding.coe_trans -> RelEmbedding.coe_trans is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t), Eq.{max (succ u1) (succ u3)} (α -> γ) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g)) (Function.comp.{succ u1, succ u2, succ u3} α β γ (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t), Eq.{max (succ u3) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) ᾰ) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g)) (Function.comp.{succ u3, succ u2, succ u1} α β γ (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f))
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_trans RelEmbedding.coe_transₓ'. -/
 @[simp]
 theorem coe_trans (f : r ↪r s) (g : s ↪r t) : ⇑(f.trans g) = g ∘ f :=
   rfl
@@ -495,152 +357,62 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 #align rel_embedding.preimage RelEmbedding.preimage
 -/
 
-/- warning: rel_embedding.eq_preimage -> RelEmbedding.eq_preimage is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{succ u1} (α -> α -> Prop) r (Order.Preimage.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f) s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f) s)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.eq_preimage RelEmbedding.eq_preimageₓ'. -/
 theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by ext (a b); exact f.map_rel_iff.symm
 #align rel_embedding.eq_preimage RelEmbedding.eq_preimage
 
-/- warning: rel_embedding.is_irrefl -> RelEmbedding.isIrrefl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsIrrefl.{u2} β s], IsIrrefl.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsIrrefl.{u1} β s], IsIrrefl.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_irrefl RelEmbedding.isIrreflₓ'. -/
 protected theorem isIrrefl (f : r ↪r s) [IsIrrefl β s] : IsIrrefl α r :=
   ⟨fun a => mt f.map_rel_iff.2 (irrefl (f a))⟩
 #align rel_embedding.is_irrefl RelEmbedding.isIrrefl
 
-/- warning: rel_embedding.is_refl -> RelEmbedding.isRefl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsRefl.{u2} β s], IsRefl.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsRefl.{u1} β s], IsRefl.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_refl RelEmbedding.isReflₓ'. -/
 protected theorem isRefl (f : r ↪r s) [IsRefl β s] : IsRefl α r :=
   ⟨fun a => f.map_rel_iff.1 <| refl _⟩
 #align rel_embedding.is_refl RelEmbedding.isRefl
 
-/- warning: rel_embedding.is_symm -> RelEmbedding.isSymm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsSymm.{u2} β s], IsSymm.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsSymm.{u1} β s], IsSymm.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_symm RelEmbedding.isSymmₓ'. -/
 protected theorem isSymm (f : r ↪r s) [IsSymm β s] : IsSymm α r :=
   ⟨fun a b => imp_imp_imp f.map_rel_iff.2 f.map_rel_iff.1 symm⟩
 #align rel_embedding.is_symm RelEmbedding.isSymm
 
-/- warning: rel_embedding.is_asymm -> RelEmbedding.isAsymm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsAsymm.{u2} β s], IsAsymm.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsAsymm.{u1} β s], IsAsymm.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_asymm RelEmbedding.isAsymmₓ'. -/
 protected theorem isAsymm (f : r ↪r s) [IsAsymm β s] : IsAsymm α r :=
   ⟨fun a b h₁ h₂ => asymm (f.map_rel_iff.2 h₁) (f.map_rel_iff.2 h₂)⟩
 #align rel_embedding.is_asymm RelEmbedding.isAsymm
 
-/- warning: rel_embedding.is_antisymm -> RelEmbedding.isAntisymm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsAntisymm.{u2} β s], IsAntisymm.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsAntisymm.{u1} β s], IsAntisymm.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_antisymm RelEmbedding.isAntisymmₓ'. -/
 protected theorem isAntisymm : ∀ (f : r ↪r s) [IsAntisymm β s], IsAntisymm α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b h₁ h₂ => f.inj' (H _ _ (o.2 h₁) (o.2 h₂))⟩
 #align rel_embedding.is_antisymm RelEmbedding.isAntisymm
 
-/- warning: rel_embedding.is_trans -> RelEmbedding.isTrans is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsTrans.{u2} β s], IsTrans.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsTrans.{u1} β s], IsTrans.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_trans RelEmbedding.isTransₓ'. -/
 protected theorem isTrans : ∀ (f : r ↪r s) [IsTrans β s], IsTrans α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b c h₁ h₂ => o.1 (H _ _ _ (o.2 h₁) (o.2 h₂))⟩
 #align rel_embedding.is_trans RelEmbedding.isTrans
 
-/- warning: rel_embedding.is_total -> RelEmbedding.isTotal is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsTotal.{u2} β s], IsTotal.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsTotal.{u1} β s], IsTotal.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_total RelEmbedding.isTotalₓ'. -/
 protected theorem isTotal : ∀ (f : r ↪r s) [IsTotal β s], IsTotal α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b => (or_congr o o).1 (H _ _)⟩
 #align rel_embedding.is_total RelEmbedding.isTotal
 
-/- warning: rel_embedding.is_preorder -> RelEmbedding.isPreorder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsPreorder.{u2} β s], IsPreorder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsPreorder.{u1} β s], IsPreorder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_preorder RelEmbedding.isPreorderₓ'. -/
 protected theorem isPreorder : ∀ (f : r ↪r s) [IsPreorder β s], IsPreorder α r
   | f, H => { f.is_refl, f.is_trans with }
 #align rel_embedding.is_preorder RelEmbedding.isPreorder
 
-/- warning: rel_embedding.is_partial_order -> RelEmbedding.isPartialOrder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsPartialOrder.{u2} β s], IsPartialOrder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsPartialOrder.{u1} β s], IsPartialOrder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_partial_order RelEmbedding.isPartialOrderₓ'. -/
 protected theorem isPartialOrder : ∀ (f : r ↪r s) [IsPartialOrder β s], IsPartialOrder α r
   | f, H => { f.is_preorder, f.is_antisymm with }
 #align rel_embedding.is_partial_order RelEmbedding.isPartialOrder
 
-/- warning: rel_embedding.is_linear_order -> RelEmbedding.isLinearOrder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsLinearOrder.{u2} β s], IsLinearOrder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsLinearOrder.{u1} β s], IsLinearOrder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_linear_order RelEmbedding.isLinearOrderₓ'. -/
 protected theorem isLinearOrder : ∀ (f : r ↪r s) [IsLinearOrder β s], IsLinearOrder α r
   | f, H => { f.is_partial_order, f.is_total with }
 #align rel_embedding.is_linear_order RelEmbedding.isLinearOrder
 
-/- warning: rel_embedding.is_strict_order -> RelEmbedding.isStrictOrder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsStrictOrder.{u2} β s], IsStrictOrder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsStrictOrder.{u1} β s], IsStrictOrder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_strict_order RelEmbedding.isStrictOrderₓ'. -/
 protected theorem isStrictOrder : ∀ (f : r ↪r s) [IsStrictOrder β s], IsStrictOrder α r
   | f, H => { f.is_irrefl, f.is_trans with }
 #align rel_embedding.is_strict_order RelEmbedding.isStrictOrder
 
-/- warning: rel_embedding.is_trichotomous -> RelEmbedding.isTrichotomous is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsTrichotomous.{u2} β s], IsTrichotomous.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsTrichotomous.{u1} β s], IsTrichotomous.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_trichotomous RelEmbedding.isTrichotomousₓ'. -/
 protected theorem isTrichotomous : ∀ (f : r ↪r s) [IsTrichotomous β s], IsTrichotomous α r
   | ⟨f, o⟩, ⟨H⟩ => ⟨fun a b => (or_congr o (or_congr f.inj'.eq_iff o)).1 (H _ _)⟩
 #align rel_embedding.is_trichotomous RelEmbedding.isTrichotomous
 
-/- warning: rel_embedding.is_strict_total_order -> RelEmbedding.isStrictTotalOrder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsStrictTotalOrder.{u2} β s], IsStrictTotalOrder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsStrictTotalOrder.{u1} β s], IsStrictTotalOrder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_strict_total_order RelEmbedding.isStrictTotalOrderₓ'. -/
 protected theorem isStrictTotalOrder :
     ∀ (f : r ↪r s) [IsStrictTotalOrder β s], IsStrictTotalOrder α r
   | f, H => { f.is_trichotomous, f.is_strict_order with }
 #align rel_embedding.is_strict_total_order RelEmbedding.isStrictTotalOrder
 
-/- warning: rel_embedding.acc -> RelEmbedding.acc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (a : α), (Acc.{succ u2} β s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a)) -> (Acc.{succ u1} α r a)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) (a : α), (Acc.{succ u1} β s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a)) -> (Acc.{succ u2} α r a)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.acc RelEmbedding.accₓ'. -/
 protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a :=
   by
   generalize h : f a = b; intro ac
@@ -648,32 +420,14 @@ protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a :=
   exact ⟨_, fun a' h => IH (f a') (f.map_rel_iff.2 h) _ rfl⟩
 #align rel_embedding.acc RelEmbedding.acc
 
-/- warning: rel_embedding.well_founded -> RelEmbedding.wellFounded is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (WellFounded.{succ u2} β s) -> (WellFounded.{succ u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (WellFounded.{succ u1} β s) -> (WellFounded.{succ u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.well_founded RelEmbedding.wellFoundedₓ'. -/
 protected theorem wellFounded : ∀ (f : r ↪r s) (h : WellFounded s), WellFounded r
   | f, ⟨H⟩ => ⟨fun a => f.Acc _ (H _)⟩
 #align rel_embedding.well_founded RelEmbedding.wellFounded
 
-/- warning: rel_embedding.is_well_founded -> RelEmbedding.isWellFounded is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsWellFounded.{u2} β s], IsWellFounded.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsWellFounded.{u1} β s], IsWellFounded.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_well_founded RelEmbedding.isWellFoundedₓ'. -/
 protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r :=
   ⟨f.WellFounded IsWellFounded.wf⟩
 #align rel_embedding.is_well_founded RelEmbedding.isWellFounded
 
-/- warning: rel_embedding.is_well_order -> RelEmbedding.isWellOrder is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsWellOrder.{u2} β s], IsWellOrder.{u1} α r)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsWellOrder.{u1} β s], IsWellOrder.{u2} α r)
-Case conversion may be inaccurate. Consider using '#align rel_embedding.is_well_order RelEmbedding.isWellOrderₓ'. -/
 protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrder α r
   | f, H => { f.is_strict_total_order with wf := f.well_founded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
@@ -792,12 +546,6 @@ def ofMapRelIff (f : α → β) [IsAntisymm α r] [IsRefl β s] (hf : ∀ a b, s
 #align rel_embedding.of_map_rel_iff RelEmbedding.ofMapRelIff
 -/
 
-/- warning: rel_embedding.of_map_rel_iff_coe -> RelEmbedding.ofMapRelIff_coe is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u1} α r] [_inst_2 : IsRefl.{u2} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u1) (succ u2)} (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMapRelIff.{u1, u2} α β r s f _inst_1 _inst_2 hf)) f
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u2} α r] [_inst_2 : IsRefl.{u1} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMapRelIff.{u2, u1} α β r s f _inst_1 _inst_2 hf)) f
-Case conversion may be inaccurate. Consider using '#align rel_embedding.of_map_rel_iff_coe RelEmbedding.ofMapRelIff_coeₓ'. -/
 @[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 :=
@@ -820,12 +568,6 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
 #align rel_embedding.of_monotone RelEmbedding.ofMonotone
 -/
 
-/- warning: rel_embedding.of_monotone_coe -> RelEmbedding.ofMonotone_coe is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsAsymm.{u2} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) f
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsAsymm.{u1} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMonotone.{u2, u1} α β r s _inst_1 _inst_2 f H)) f
-Case conversion may be inaccurate. Consider using '#align rel_embedding.of_monotone_coe RelEmbedding.ofMonotone_coeₓ'. -/
 @[simp]
 theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
     (@ofMonotone _ _ r s _ _ f H : α → β) = f :=
@@ -961,12 +703,6 @@ def toRelEmbedding (f : r ≃r s) : r ↪r s :=
 #align rel_iso.to_rel_embedding RelIso.toRelEmbedding
 -/
 
-/- warning: rel_iso.to_equiv_injective -> RelIso.toEquiv_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1)} (RelIso.{u1, u2} α β r s) (Equiv.{succ u1, succ u2} α β) (RelIso.toEquiv.{u1, u2} α β r s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (Equiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s)
-Case conversion may be inaccurate. Consider using '#align rel_iso.to_equiv_injective RelIso.toEquiv_injectiveₓ'. -/
 theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
   | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by congr ; exact h
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
@@ -994,67 +730,31 @@ theorem coe_coeFn (f : r ≃r s) : ((f : r ↪r s) : α → β) = f :=
   rfl
 #align rel_iso.coe_coe_fn RelIso.coe_coeFn
 
-/- warning: rel_iso.map_rel_iff -> RelIso.map_rel_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s) {a : α} {b : α}, Iff (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f b)) (r a b)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f b)) (r a b)
-Case conversion may be inaccurate. Consider using '#align rel_iso.map_rel_iff RelIso.map_rel_iffₓ'. -/
 theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_iso.map_rel_iff RelIso.map_rel_iff
 
-/- warning: rel_iso.coe_fn_mk -> RelIso.coe_fn_mk is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (α -> β) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α β (fun (a : α) (b : α) => r a b) s (RelIso.instRelHomClassRelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s)) (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
-Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_mk RelIso.coe_fn_mkₓ'. -/
 @[simp]
 theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) : (RelIso.mk f o : α → β) = f :=
   rfl
 #align rel_iso.coe_fn_mk RelIso.coe_fn_mk
 
-/- warning: rel_iso.coe_fn_to_equiv -> RelIso.coe_fn_toEquiv is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquivₓ'. -/
 @[simp]
 theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
   rfl
 #align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquiv
 
-/- warning: rel_iso.coe_fn_injective -> RelIso.coe_fn_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (ᾰ : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8798 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
-Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_injective RelIso.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
 theorem coe_fn_injective : @Function.Injective (r ≃r s) (α → β) coeFn :=
   FunLike.coe_injective
 #align rel_iso.coe_fn_injective RelIso.coe_fn_injective
 
-/- warning: rel_iso.ext -> RelIso.ext is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelIso.{u1, u2} α β r s}} {{g : RelIso.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) f g)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelIso.{u2, u1} α β r s}} {{g : RelIso.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g)
-Case conversion may be inaccurate. Consider using '#align rel_iso.ext RelIso.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
   FunLike.ext f g h
 #align rel_iso.ext RelIso.ext
 
-/- warning: rel_iso.ext_iff -> RelIso.ext_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelIso.{u1, u2} α β r s} {g : RelIso.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) g x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelIso.{u2, u1} α β r s} {g : RelIso.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) g x))
-Case conversion may be inaccurate. Consider using '#align rel_iso.ext_iff RelIso.ext_iffₓ'. -/
 theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
 #align rel_iso.ext_iff RelIso.ext_iff
@@ -1152,95 +852,41 @@ protected def swap (f : r ≃r s) : swap r ≃r swap s :=
 #align rel_iso.swap RelIso.swap
 -/
 
-/- warning: rel_iso.coe_fn_symm_mk -> RelIso.coe_fn_symm_mk is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} ((fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max 1 (max (succ u2) (succ u1)) (succ u1) (succ u2), max (succ u2) (succ u1)} (Equiv.{succ u2, succ u1} β α) (fun (_x : Equiv.{succ u2, succ u1} β α) => β -> α) (Equiv.hasCoeToFun.{succ u2, succ u1} β α) (Equiv.symm.{succ u1, succ u2} α β f))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (β -> α) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
-Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mkₓ'. -/
 @[simp]
 theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.symm :=
   rfl
 #align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mk
 
-/- warning: rel_iso.apply_symm_apply -> RelIso.apply_symm_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) (x : β), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) x)) x
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : β), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) x)) x
-Case conversion may be inaccurate. Consider using '#align rel_iso.apply_symm_apply RelIso.apply_symm_applyₓ'. -/
 @[simp]
 theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x :=
   e.toEquiv.apply_symm_apply x
 #align rel_iso.apply_symm_apply RelIso.apply_symm_apply
 
-/- warning: rel_iso.symm_apply_apply -> RelIso.symm_apply_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) (x : α), Eq.{succ u1} α (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e x)) x
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : α), Eq.{succ u2} α (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e x)) x
-Case conversion may be inaccurate. Consider using '#align rel_iso.symm_apply_apply RelIso.symm_apply_applyₓ'. -/
 @[simp]
 theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x :=
   e.toEquiv.symm_apply_apply x
 #align rel_iso.symm_apply_apply RelIso.symm_apply_apply
 
-/- warning: rel_iso.rel_symm_apply -> RelIso.rel_symm_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) {x : α} {y : β}, Iff (r x (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) y)) (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e x) y)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : α} {y : β}, Iff (r x (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) y)) (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e x) y)
-Case conversion may be inaccurate. Consider using '#align rel_iso.rel_symm_apply RelIso.rel_symm_applyₓ'. -/
 theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.rel_symm_apply RelIso.rel_symm_apply
 
-/- warning: rel_iso.symm_apply_rel -> RelIso.symm_apply_rel is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) {x : β} {y : α}, Iff (r (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) x) y) (s x (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e y))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : β} {y : α}, Iff (r (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) x) y) (s x (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e y))
-Case conversion may be inaccurate. Consider using '#align rel_iso.symm_apply_rel RelIso.symm_apply_relₓ'. -/
 theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.symm_apply_rel RelIso.symm_apply_rel
 
-/- warning: rel_iso.bijective -> RelIso.bijective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Bijective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Bijective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
-Case conversion may be inaccurate. Consider using '#align rel_iso.bijective RelIso.bijectiveₓ'. -/
 protected theorem bijective (e : r ≃r s) : Bijective e :=
   e.toEquiv.Bijective
 #align rel_iso.bijective RelIso.bijective
 
-/- warning: rel_iso.injective -> RelIso.injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
-Case conversion may be inaccurate. Consider using '#align rel_iso.injective RelIso.injectiveₓ'. -/
 protected theorem injective (e : r ≃r s) : Injective e :=
   e.toEquiv.Injective
 #align rel_iso.injective RelIso.injective
 
-/- warning: rel_iso.surjective -> RelIso.surjective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Surjective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Surjective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
-Case conversion may be inaccurate. Consider using '#align rel_iso.surjective RelIso.surjectiveₓ'. -/
 protected theorem surjective (e : r ≃r s) : Surjective e :=
   e.toEquiv.Surjective
 #align rel_iso.surjective RelIso.surjective
 
-/- warning: rel_iso.eq_iff_eq -> RelIso.eq_iff_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s) {a : α} {b : α}, Iff (Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f b)) (Eq.{succ u1} α a b)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
-Case conversion may be inaccurate. Consider using '#align rel_iso.eq_iff_eq RelIso.eq_iff_eqₓ'. -/
 @[simp]
 theorem eq_iff_eq (f : r ≃r s) {a b} : f a = f b ↔ a = b :=
   f.Injective.eq_iff
@@ -1267,12 +913,6 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 #align rel_iso.is_well_order.ulift RelIso.IsWellOrder.ulift
 -/
 
-/- warning: rel_iso.of_surjective -> RelIso.ofSurjective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)) -> (RelIso.{u1, u2} α β r s)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelEmbedding.{u1, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelEmbedding.{u1, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u1, u2} α β r s)) f)) -> (RelIso.{u1, u2} α β r s)
-Case conversion may be inaccurate. Consider using '#align rel_iso.of_surjective RelIso.ofSurjectiveₓ'. -/
 /-- A surjective relation embedding is a relation isomorphism. -/
 @[simps apply]
 noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s :=
Diff
@@ -135,10 +135,7 @@ namespace RelHom
 
 instance : RelHomClass (r →r s) r s where
   coe o := o.toFun
-  coe_injective' f g h := by
-    cases f
-    cases g
-    congr
+  coe_injective' f g h := by cases f; cases g; congr
   map_rel := map_rel'
 
 /-- Auxiliary instance if `rel_hom_class.to_fun_like.to_has_coe_to_fun` isn't found -/
@@ -335,10 +332,7 @@ instance : CoeFun (r ↪r s) fun _ => α → β :=
 -- TODO: define and instantiate a `rel_embedding_class` when `embedding_like` is defined
 instance : RelHomClass (r ↪r s) r s where
   coe := coeFn
-  coe_injective' f g h := by
-    rcases f with ⟨⟨⟩⟩
-    rcases g with ⟨⟨⟩⟩
-    congr
+  coe_injective' f g h := by rcases f with ⟨⟨⟩⟩; rcases g with ⟨⟨⟩⟩; congr
   map_rel f a b := Iff.mpr (map_rel_iff' f)
 
 #print RelEmbedding.Simps.apply /-
@@ -507,10 +501,7 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f) s)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.eq_preimage RelEmbedding.eq_preimageₓ'. -/
-theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s :=
-  by
-  ext (a b)
-  exact f.map_rel_iff.symm
+theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by ext (a b); exact f.map_rel_iff.symm
 #align rel_embedding.eq_preimage RelEmbedding.eq_preimage
 
 /- warning: rel_embedding.is_irrefl -> RelEmbedding.isIrrefl is a dubious translation:
@@ -742,8 +733,7 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
   constructor
   · exact RelHomClass.acc (Quotient.mkRelHom H) a
   · intro ac
-    induction' ac with _ H IH
-    dsimp at IH
+    induction' ac with _ H IH; dsimp at IH
     refine' ⟨_, fun q h => _⟩
     obtain ⟨a', rfl⟩ := q.exists_rep
     exact IH a' h
@@ -825,8 +815,7 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
     refine' ((@trichotomous _ r _ a b).resolve_left _).resolve_right _ <;>
       exact fun h => @irrefl _ s _ _ (by simpa [e] using H _ _ h)
   · refine' (@trichotomous _ r _ a b).resolve_right (Or.ndrec (fun e => _) fun h' => _)
-    · subst e
-      exact irrefl _ h
+    · subst e; exact irrefl _ h
     · exact asymm (H _ _ h') h
 #align rel_embedding.of_monotone RelEmbedding.ofMonotone
 -/
@@ -979,9 +968,7 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (Equiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s)
 Case conversion may be inaccurate. Consider using '#align rel_iso.to_equiv_injective RelIso.toEquiv_injectiveₓ'. -/
 theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
-  | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by
-    congr
-    exact h
+  | ⟨e₁, o₁⟩, ⟨e₂, o₂⟩, h => by congr ; exact h
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
 
 instance : Coe (r ≃r s) (r ↪r s) :=
@@ -1129,10 +1116,7 @@ theorem default_def (r : α → α → Prop) : default = RelIso.refl r :=
 @[simps toEquiv apply]
 protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
     (h₂ : HEq r s) : r ≃r s :=
-  ⟨Equiv.cast h₁, fun a b => by
-    subst h₁
-    rw [eq_of_hEq h₂]
-    rfl⟩
+  ⟨Equiv.cast h₁, fun a b => by subst h₁; rw [eq_of_hEq h₂]; rfl⟩
 #align rel_iso.cast RelIso.cast
 -/
 
@@ -1157,9 +1141,7 @@ protected theorem cast_refl {α : Type u} {r : α → α → Prop} (h₁ : α =
 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₂') :=
-  ext fun x => by
-    subst h₁
-    rfl
+  ext fun x => by subst h₁; rfl
 #align rel_iso.cast_trans RelIso.cast_trans
 -/
 
Diff
@@ -110,7 +110,7 @@ protected theorem isAsymm [RelHomClass F r s] (f : F) : ∀ [IsAsymm β s], IsAs
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u1, u2} F α β r s] (f : F) (a : α), (Acc.{succ u2} β s (coeFn.{succ u3, max (succ u1) (succ u2)} F (fun (_x : F) => α -> β) (FunLike.hasCoeToFun.{succ u3, succ u1, succ u2} F α (fun (_x : α) => β) (RelHomClass.toFunLike.{u3, u1, u2} F α β r s _inst_1)) f a)) -> (Acc.{succ u1} α r a)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s] (f : F) (a : α), (Acc.{succ u1} β s (FunLike.coe.{succ u3, succ u2, succ u1} F α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{u3, u2, u1} F α β r s _inst_1) f a)) -> (Acc.{succ u2} α r a)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {F : Type.{u3}} [_inst_1 : RelHomClass.{u3, u2, u1} F α β r s] (f : F) (a : α), (Acc.{succ u1} β s (FunLike.coe.{succ u3, succ u2, succ u1} F α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{u3, u2, u1} F α β r s _inst_1) f a)) -> (Acc.{succ u2} α r a)
 Case conversion may be inaccurate. Consider using '#align rel_hom_class.acc RelHomClass.accₓ'. -/
 protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc r a :=
   by
@@ -151,7 +151,7 @@ initialize_simps_projections RelHom (toFun → apply)
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u1, u2} α β r s) {a : α} {b : α}, (r a b) -> (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f b))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s) {a : α} {b : α}, (r a b) -> (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f b))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s) {a : α} {b : α}, (r a b) -> (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f b))
 Case conversion may be inaccurate. Consider using '#align rel_hom.map_rel RelHom.map_relₓ'. -/
 protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b) :=
   f.map_rel'
@@ -166,7 +166,7 @@ theorem coeFn_mk (f : α → β) (o) : (@RelHom.mk _ _ r s f o : α → β) = f
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} (α -> β) (RelHom.toFun.{u1, u2} α β r s f) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (α -> β) (RelHom.toFun.{u2, u1} α β r s f) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelHom.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (α -> β) (RelHom.toFun.{u2, u1} α β r s f) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_hom.coe_fn_to_fun RelHom.coe_fn_toFunₓ'. -/
 @[simp]
 theorem coe_fn_toFun (f : r →r s) : (f.toFun : α → β) = f :=
@@ -177,7 +177,7 @@ theorem coe_fn_toFun (f : r →r s) : (f.toFun : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (ᾰ : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) ᾰ) (fun (f : RelHom.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (fun (f : RelHom.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_hom.coe_fn_injective RelHom.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r →r s) (α → β) coeFn :=
@@ -188,7 +188,7 @@ theorem coe_fn_injective : @Function.Injective (r →r s) (α → β) coeFn :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelHom.{u1, u2} α β r s}} {{g : RelHom.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) f g)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelHom.{u2, u1} α β r s}} {{g : RelHom.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelHom.{u2, u1} α β r s}} {{g : RelHom.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g)
 Case conversion may be inaccurate. Consider using '#align rel_hom.ext RelHom.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
@@ -199,7 +199,7 @@ theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelHom.{u1, u2} α β r s} {g : RelHom.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) g x))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelHom.{u2, u1} α β r s} {g : RelHom.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelHom.{u2, u1} α β r s} {g : RelHom.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelHom.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) g x))
 Case conversion may be inaccurate. Consider using '#align rel_hom.ext_iff RelHom.ext_iffₓ'. -/
 theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
@@ -258,7 +258,7 @@ theorem injective_of_increasing (r : α → α → Prop) (s : β → β → Prop
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsIrrefl.{u2} β s] (f : RelHom.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelHom.{u1, u2} α β r s) (fun (_x : RelHom.{u1, u2} α β r s) => α -> β) (RelHom.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsIrrefl.{u1} β s] (f : RelHom.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsIrrefl.{u1} β s] (f : RelHom.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelHom.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelHom.{u2, u1} α β r s) α β r s (RelHom.instRelHomClassRelHom.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_hom.injective_of_increasing RelHom.injective_of_increasingₓ'. -/
 /-- An increasing function is injective -/
 theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f : r →r s) :
@@ -365,7 +365,7 @@ theorem coe_coeFn (f : r ↪r s) : ((f : r →r s) : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.injective RelEmbedding.injectiveₓ'. -/
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
@@ -375,7 +375,7 @@ theorem injective (f : r ↪r s) : Injective f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (Eq.{succ u1} α a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.inj RelEmbedding.injₓ'. -/
 @[simp]
 theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
@@ -386,7 +386,7 @@ theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (r a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (r a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (r a b)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.map_rel_iff RelEmbedding.map_rel_iffₓ'. -/
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
@@ -396,7 +396,7 @@ theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Function.Embedding.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : Function.Embedding.{succ u2, succ u1} α β} {o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f b)) (r a b)}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.mk.{u2, u1} α β r s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : Function.Embedding.{succ u2, succ u1} α β} {o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f b)) (r a b)}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.mk.{u2, u1} α β r s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_mk RelEmbedding.coe_mkₓ'. -/
 @[simp]
 theorem coe_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β) = f :=
@@ -407,7 +407,7 @@ theorem coe_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β)
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbeddingₓ'. -/
 @[simp]
 theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
@@ -418,7 +418,7 @@ theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (ᾰ : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) ᾰ) (fun (f : RelEmbedding.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (fun (f : RelEmbedding.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
@@ -429,7 +429,7 @@ theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u1, u2} α β r s}} {{g : RelEmbedding.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u2, u1} α β r s}} {{g : RelEmbedding.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u2, u1} α β r s}} {{g : RelEmbedding.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.ext RelEmbedding.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
@@ -440,7 +440,7 @@ theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u1, u2} α β r s} {g : RelEmbedding.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s} {g : RelEmbedding.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s} {g : RelEmbedding.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.ext_iff RelEmbedding.ext_iffₓ'. -/
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
@@ -469,7 +469,7 @@ instance (r : α → α → Prop) : Inhabited (r ↪r r) :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t) (a : α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g) a) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t) (a : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) a) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f a))
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t) (a : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) a) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f a))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.trans_apply RelEmbedding.trans_applyₓ'. -/
 theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a) :=
   rfl
@@ -479,7 +479,7 @@ theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t), Eq.{max (succ u1) (succ u3)} (α -> γ) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g)) (Function.comp.{succ u1, succ u2, succ u3} α β γ (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t), Eq.{max (succ u3) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) ᾰ) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g)) (Function.comp.{succ u3, succ u2, succ u1} α β γ (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f))
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t), Eq.{max (succ u3) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) ᾰ) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g)) (Function.comp.{succ u3, succ u2, succ u1} α β γ (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_trans RelEmbedding.coe_transₓ'. -/
 @[simp]
 theorem coe_trans (f : r ↪r s) (g : s ↪r t) : ⇑(f.trans g) = g ∘ f :=
@@ -505,7 +505,7 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{succ u1} (α -> α -> Prop) r (Order.Preimage.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f) s)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f) s)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f) s)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.eq_preimage RelEmbedding.eq_preimageₓ'. -/
 theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s :=
   by
@@ -648,7 +648,7 @@ protected theorem isStrictTotalOrder :
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (a : α), (Acc.{succ u2} β s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a)) -> (Acc.{succ u1} α r a)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) (a : α), (Acc.{succ u1} β s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a)) -> (Acc.{succ u2} α r a)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) (a : α), (Acc.{succ u1} β s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a)) -> (Acc.{succ u2} α r a)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.acc RelEmbedding.accₓ'. -/
 protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a :=
   by
@@ -806,7 +806,7 @@ def ofMapRelIff (f : α → β) [IsAntisymm α r] [IsRefl β s] (hf : ∀ a b, s
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u1} α r] [_inst_2 : IsRefl.{u2} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u1) (succ u2)} (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMapRelIff.{u1, u2} α β r s f _inst_1 _inst_2 hf)) f
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u2} α r] [_inst_2 : IsRefl.{u1} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) ᾰ) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMapRelIff.{u2, u1} α β r s f _inst_1 _inst_2 hf)) f
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u2} α r] [_inst_2 : IsRefl.{u1} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) ᾰ) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMapRelIff.{u2, u1} α β r s f _inst_1 _inst_2 hf)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.of_map_rel_iff_coe RelEmbedding.ofMapRelIff_coeₓ'. -/
 @[simp]
 theorem ofMapRelIff_coe (f : α → β) [IsAntisymm α r] [IsRefl β s]
@@ -835,7 +835,7 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsAsymm.{u2} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) f
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsAsymm.{u1} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMonotone.{u2, u1} α β r s _inst_1 _inst_2 f H)) f
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsAsymm.{u1} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMonotone.{u2, u1} α β r s _inst_1 _inst_2 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.of_monotone_coe RelEmbedding.ofMonotone_coeₓ'. -/
 @[simp]
 theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
@@ -1021,7 +1021,7 @@ theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (α -> β) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α β (fun (a : α) (b : α) => r a b) s (RelIso.instRelHomClassRelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s)) (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (α -> β) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α β (fun (a : α) (b : α) => r a b) s (RelIso.instRelHomClassRelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s)) (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_mk RelIso.coe_fn_mkₓ'. -/
 @[simp]
 theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) : (RelIso.mk f o : α → β) = f :=
@@ -1032,7 +1032,7 @@ theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) :
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquivₓ'. -/
 @[simp]
 theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
@@ -1043,7 +1043,7 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (ᾰ : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8777 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8798 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_injective RelIso.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
@@ -1174,7 +1174,7 @@ protected def swap (f : r ≃r s) : swap r ≃r swap s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} ((fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max 1 (max (succ u2) (succ u1)) (succ u1) (succ u2), max (succ u2) (succ u1)} (Equiv.{succ u2, succ u1} β α) (fun (_x : Equiv.{succ u2, succ u1} β α) => β -> α) (Equiv.hasCoeToFun.{succ u2, succ u1} β α) (Equiv.symm.{succ u1, succ u2} α β f))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (β -> α) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (β -> α) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mkₓ'. -/
 @[simp]
 theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.symm :=
@@ -1289,7 +1289,7 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)) -> (RelIso.{u1, u2} α β r s)
 but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelEmbedding.{u1, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelEmbedding.{u1, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u1, u2} α β r s)) f)) -> (RelIso.{u1, u2} α β r s)
+  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelEmbedding.{u1, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : α) => β) _x) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelEmbedding.{u1, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u1, u2} α β r s)) f)) -> (RelIso.{u1, u2} α β r s)
 Case conversion may be inaccurate. Consider using '#align rel_iso.of_surjective RelIso.ofSurjectiveₓ'. -/
 /-- A surjective relation embedding is a relation isomorphism. -/
 @[simps apply]
Diff
@@ -1043,7 +1043,7 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (ᾰ : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8776 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8777 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_injective RelIso.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
Diff
@@ -365,7 +365,7 @@ theorem coe_coeFn (f : r ↪r s) : ((f : r →r s) : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.injective RelEmbedding.injectiveₓ'. -/
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
@@ -375,7 +375,7 @@ theorem injective (f : r ↪r s) : Injective f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (Eq.{succ u1} α a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) b)) (Eq.{succ u2} α a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.inj RelEmbedding.injₓ'. -/
 @[simp]
 theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
@@ -386,27 +386,39 @@ theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) {a : α} {b : α}, Iff (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f b)) (r a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) b)) (r a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f b)) (r a b)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.map_rel_iff RelEmbedding.map_rel_iffₓ'. -/
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_embedding.map_rel_iff RelEmbedding.map_rel_iff
 
+/- warning: rel_embedding.coe_fn_mk -> RelEmbedding.coe_mk is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Function.Embedding.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.mk.{u1, u2} α β r s f o)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) f)
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : Function.Embedding.{succ u2, succ u1} α β} {o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f b)) (r a b)}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.mk.{u2, u1} α β r s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) f)
+Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_mk RelEmbedding.coe_mkₓ'. -/
 @[simp]
-theorem coeFn_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β) = f :=
+theorem coe_mk (f : α ↪ β) (o) : (@RelEmbedding.mk _ _ r s f o : α → β) = f :=
   rfl
-#align rel_embedding.coe_fn_mk RelEmbedding.coeFn_mk
+#align rel_embedding.coe_fn_mk RelEmbedding.coe_mk
 
+/- warning: rel_embedding.coe_fn_to_embedding -> RelEmbedding.coe_toEmbedding is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max 1 (succ u1) (succ u2), max (succ u1) (succ u2)} (Function.Embedding.{succ u1, succ u2} α β) (fun (_x : Function.Embedding.{succ u1, succ u2} α β) => α -> β) (Function.Embedding.hasCoeToFun.{succ u1, succ u2} α β) (RelEmbedding.toEmbedding.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s}, Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
+Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbeddingₓ'. -/
 @[simp]
-theorem coeFn_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
+theorem coe_toEmbedding (f : r ↪r s) : (f.toEmbedding : α → β) = f :=
   rfl
-#align rel_embedding.coe_fn_to_embedding RelEmbedding.coeFn_toEmbedding
+#align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbedding
 
 /- warning: rel_embedding.coe_fn_injective -> RelEmbedding.coe_fn_injective is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (ᾰ : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) ᾰ) (fun (f : RelEmbedding.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (a : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) ᾰ) (fun (f : RelEmbedding.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (a : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
@@ -417,7 +429,7 @@ theorem coe_fn_injective : @Function.Injective (r ↪r s) (α → β) coeFn :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u1, u2} α β r s}} {{g : RelEmbedding.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u2, u1} α β r s}} {{g : RelEmbedding.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s g) x)) -> (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelEmbedding.{u2, u1} α β r s}} {{g : RelEmbedding.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.ext RelEmbedding.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
@@ -428,7 +440,7 @@ theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u1, u2} α β r s} {g : RelEmbedding.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) g x))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s} {g : RelEmbedding.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s g) x))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelEmbedding.{u2, u1} α β r s} {g : RelEmbedding.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelEmbedding.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) g x))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.ext_iff RelEmbedding.ext_iffₓ'. -/
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
@@ -457,7 +469,7 @@ instance (r : α → α → Prop) : Inhabited (r ↪r r) :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t) (a : α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g) a) (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t) (a : α), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => γ) a) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (Function.Embedding.{succ u3, succ u1} α γ) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u3) (succ u1), succ u3, succ u1} (Function.Embedding.{succ u3, succ u1} α γ) α γ (Function.instEmbeddingLikeEmbedding.{succ u3, succ u1} α γ)) (RelEmbedding.toEmbedding.{u3, u1} α γ r t (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g)) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} β γ) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} β γ) β γ (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} β γ)) (RelEmbedding.toEmbedding.{u2, u1} β γ s t g) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Function.Embedding.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u3) (succ u2), succ u3, succ u2} (Function.Embedding.{succ u3, succ u2} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u3, succ u2} α β)) (RelEmbedding.toEmbedding.{u3, u2} α β r s f) a))
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t) (a : α), Eq.{succ u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) a) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f a))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.trans_apply RelEmbedding.trans_applyₓ'. -/
 theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a) :=
   rfl
@@ -467,7 +479,7 @@ theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (g : RelEmbedding.{u2, u3} β γ s t), Eq.{max (succ u1) (succ u3)} (α -> γ) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RelEmbedding.{u1, u3} α γ r t) (fun (_x : RelEmbedding.{u1, u3} α γ r t) => α -> γ) (RelEmbedding.hasCoeToFun.{u1, u3} α γ r t) (RelEmbedding.trans.{u1, u2, u3} α β γ r s t f g)) (Function.comp.{succ u1, succ u2, succ u3} α β γ (coeFn.{max (succ u2) (succ u3), max (succ u2) (succ u3)} (RelEmbedding.{u2, u3} β γ s t) (fun (_x : RelEmbedding.{u2, u3} β γ s t) => β -> γ) (RelEmbedding.hasCoeToFun.{u2, u3} β γ s t) g) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t), Eq.{max (succ u3) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => γ) ᾰ) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (Function.Embedding.{succ u3, succ u1} α γ) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u3) (succ u1), succ u3, succ u1} (Function.Embedding.{succ u3, succ u1} α γ) α γ (Function.instEmbeddingLikeEmbedding.{succ u3, succ u1} α γ)) (RelEmbedding.toEmbedding.{u3, u1} α γ r t (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g))) (Function.comp.{succ u3, succ u2, succ u1} α β γ (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} β γ) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} β γ) β γ (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} β γ)) (RelEmbedding.toEmbedding.{u2, u1} β γ s t g)) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Function.Embedding.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u3) (succ u2), succ u3, succ u2} (Function.Embedding.{succ u3, succ u2} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u3, succ u2} α β)) (RelEmbedding.toEmbedding.{u3, u2} α β r s f)))
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : RelEmbedding.{u3, u2} α β r s) (g : RelEmbedding.{u2, u1} β γ s t), Eq.{max (succ u3) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) ᾰ) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RelEmbedding.{u3, u1} α γ r t) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => γ) _x) (RelHomClass.toFunLike.{max u3 u1, u3, u1} (RelEmbedding.{u3, u1} α γ r t) α γ r t (RelEmbedding.instRelHomClassRelEmbedding.{u3, u1} α γ r t)) (RelEmbedding.trans.{u3, u2, u1} α β γ r s t f g)) (Function.comp.{succ u3, succ u2, succ u1} α β γ (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} β γ s t) β (fun (_x : β) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : β) => γ) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} β γ s t) β γ s t (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} β γ s t)) g) (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (RelEmbedding.{u3, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u3 u2, u3, u2} (RelEmbedding.{u3, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u3, u2} α β r s)) f))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_trans RelEmbedding.coe_transₓ'. -/
 @[simp]
 theorem coe_trans (f : r ↪r s) (g : s ↪r t) : ⇑(f.trans g) = g ∘ f :=
@@ -493,7 +505,7 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), Eq.{succ u1} (α -> α -> Prop) r (Order.Preimage.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f) s)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f)) s)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s), Eq.{succ u2} (α -> α -> Prop) r (Order.Preimage.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f) s)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.eq_preimage RelEmbedding.eq_preimageₓ'. -/
 theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s :=
   by
@@ -636,7 +648,7 @@ protected theorem isStrictTotalOrder :
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s) (a : α), (Acc.{succ u2} β s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f a)) -> (Acc.{succ u1} α r a)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) (a : α), (Acc.{succ u1} β s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s f) a)) -> (Acc.{succ u2} α r a)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u2, u1} α β r s) (a : α), (Acc.{succ u1} β s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) f a)) -> (Acc.{succ u2} α r a)
 Case conversion may be inaccurate. Consider using '#align rel_embedding.acc RelEmbedding.accₓ'. -/
 protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a :=
   by
@@ -794,7 +806,7 @@ def ofMapRelIff (f : α → β) [IsAntisymm α r] [IsRefl β s] (hf : ∀ a b, s
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u1} α r] [_inst_2 : IsRefl.{u2} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u1) (succ u2)} (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMapRelIff.{u1, u2} α β r s f _inst_1 _inst_2 hf)) f
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u2} α r] [_inst_2 : IsRefl.{u1} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) ᾰ) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelEmbedding.ofMapRelIff.{u2, u1} α β r s f _inst_1 _inst_2 hf))) f
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β) [_inst_1 : IsAntisymm.{u2} α r] [_inst_2 : IsRefl.{u1} β s] (hf : forall (a : α) (b : α), Iff (s (f a) (f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (ᾰ : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) ᾰ) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMapRelIff.{u2, u1} α β r s f _inst_1 _inst_2 hf)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.of_map_rel_iff_coe RelEmbedding.ofMapRelIff_coeₓ'. -/
 @[simp]
 theorem ofMapRelIff_coe (f : α → β) [IsAntisymm α r] [IsRefl β s]
@@ -823,7 +835,7 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u1} α r] [_inst_2 : IsAsymm.{u2} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) (RelEmbedding.ofMonotone.{u1, u2} α β r s _inst_1 _inst_2 f H)) f
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsAsymm.{u1} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelEmbedding.ofMonotone.{u2, u1} α β r s _inst_1 _inst_2 f H))) f
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} [_inst_1 : IsTrichotomous.{u2} α r] [_inst_2 : IsAsymm.{u1} β s] (f : α -> β) (H : forall (a : α) (b : α), (r a b) -> (s (f a) (f b))), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelEmbedding.{u2, u1} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelEmbedding.{u2, u1} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u2, u1} α β r s)) (RelEmbedding.ofMonotone.{u2, u1} α β r s _inst_1 _inst_2 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.of_monotone_coe RelEmbedding.ofMonotone_coeₓ'. -/
 @[simp]
 theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
@@ -999,7 +1011,7 @@ theorem coe_coeFn (f : r ≃r s) : ((f : r ↪r s) : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s) {a : α} {b : α}, Iff (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f b)) (r a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) b)) (r a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f b)) (r a b)
 Case conversion may be inaccurate. Consider using '#align rel_iso.map_rel_iff RelIso.map_rel_iffₓ'. -/
 theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
@@ -1009,7 +1021,7 @@ theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.toRelEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (α -> β) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s) α β (fun (a : α) (b : α) => r a b) s (RelIso.instRelHomClassRelIso.{u2, u1} α β (fun (a : α) (b : α) => r a b) s)) (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_mk RelIso.coe_fn_mkₓ'. -/
 @[simp]
 theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) : (RelIso.mk f o : α → β) = f :=
@@ -1020,7 +1032,7 @@ theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) :
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquivₓ'. -/
 @[simp]
 theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
@@ -1031,7 +1043,7 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (α -> β) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (ᾰ : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (forall (ᾰ : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) ᾰ) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (a : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, Function.Injective.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) (α -> β) (fun (f : RelIso.{u2, u1} α β r s) => FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (a._@.Mathlib.Order.RelIso.Basic._hyg.8776 : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_injective RelIso.coe_fn_injectiveₓ'. -/
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
@@ -1043,7 +1055,7 @@ theorem coe_fn_injective : @Function.Injective (r ≃r s) (α → β) coeFn :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelIso.{u1, u2} α β r s}} {{g : RelIso.{u1, u2} α β r s}}, (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) g x)) -> (Eq.{max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) f g)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelIso.{u2, u1} α β r s}} {{g : RelIso.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s g)) x)) -> (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {{f : RelIso.{u2, u1} α β r s}} {{g : RelIso.{u2, u1} α β r s}}, (forall (x : α), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) g x)) -> (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g)
 Case conversion may be inaccurate. Consider using '#align rel_iso.ext RelIso.extₓ'. -/
 @[ext]
 theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
@@ -1054,7 +1066,7 @@ theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelIso.{u1, u2} α β r s} {g : RelIso.{u1, u2} α β r s}, Iff (Eq.{max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) f g) (forall (x : α), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f x) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) g x))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelIso.{u2, u1} α β r s} {g : RelIso.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s g)) x))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {f : RelIso.{u2, u1} α β r s} {g : RelIso.{u2, u1} α β r s}, Iff (Eq.{max (succ u2) (succ u1)} (RelIso.{u2, u1} α β r s) f g) (forall (x : α), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) g x))
 Case conversion may be inaccurate. Consider using '#align rel_iso.ext_iff RelIso.ext_iffₓ'. -/
 theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x :=
   FunLike.ext_iff
@@ -1162,7 +1174,7 @@ protected def swap (f : r ≃r s) : swap r ≃r swap s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} ((fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max 1 (max (succ u2) (succ u1)) (succ u1) (succ u2), max (succ u2) (succ u1)} (Equiv.{succ u2, succ u1} β α) (fun (_x : Equiv.{succ u2, succ u1} β α) => β -> α) (Equiv.hasCoeToFun.{succ u2, succ u1} β α) (Equiv.symm.{succ u1, succ u2} α β f))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : β), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) a) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (β -> α) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mkₓ'. -/
 @[simp]
 theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.symm :=
@@ -1173,7 +1185,7 @@ theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.s
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) (x : β), Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) x)) x
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : β), Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (a : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) a) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s e))) x)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s e))) x)) x
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : β), Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) x)) x
 Case conversion may be inaccurate. Consider using '#align rel_iso.apply_symm_apply RelIso.apply_symm_applyₓ'. -/
 @[simp]
 theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x :=
@@ -1184,7 +1196,7 @@ theorem apply_symm_apply (e : r ≃r s) (x : β) : e (e.symm x) = x :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) (x : α), Eq.{succ u1} α (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e x)) x
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : α), Eq.{succ u2} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (a : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)) x)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s e))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)) x)) x
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) (x : α), Eq.{succ u2} α (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e x)) x
 Case conversion may be inaccurate. Consider using '#align rel_iso.symm_apply_apply RelIso.symm_apply_applyₓ'. -/
 @[simp]
 theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x :=
@@ -1195,7 +1207,7 @@ theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) {x : α} {y : β}, Iff (r x (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) y)) (s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e x) y)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : α} {y : β}, Iff (r x (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s e))) y)) (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)) x) y)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : α} {y : β}, Iff (r x (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) y)) (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e x) y)
 Case conversion may be inaccurate. Consider using '#align rel_iso.rel_symm_apply RelIso.rel_symm_applyₓ'. -/
 theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
@@ -1205,7 +1217,7 @@ theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y := by
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s) {x : β} {y : α}, Iff (r (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s e) x) y) (s x (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e y))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : β} {y : α}, Iff (r (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s e))) x) y) (s x (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)) y))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s) {x : β} {y : α}, Iff (r (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelIso.{u1, u2} β α s r) β (fun (_x : β) => α) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelIso.{u1, u2} β α s r) β α s r (RelIso.instRelHomClassRelIso.{u1, u2} β α s r)) (RelIso.symm.{u2, u1} α β r s e) x) y) (s x (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e y))
 Case conversion may be inaccurate. Consider using '#align rel_iso.symm_apply_rel RelIso.symm_apply_relₓ'. -/
 theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
@@ -1215,7 +1227,7 @@ theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Bijective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Bijective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Bijective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
 Case conversion may be inaccurate. Consider using '#align rel_iso.bijective RelIso.bijectiveₓ'. -/
 protected theorem bijective (e : r ≃r s) : Bijective e :=
   e.toEquiv.Bijective
@@ -1225,7 +1237,7 @@ protected theorem bijective (e : r ≃r s) : Bijective e :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Injective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Injective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
 Case conversion may be inaccurate. Consider using '#align rel_iso.injective RelIso.injectiveₓ'. -/
 protected theorem injective (e : r ≃r s) : Injective e :=
   e.toEquiv.Injective
@@ -1235,7 +1247,7 @@ protected theorem injective (e : r ≃r s) : Injective e :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u1, u2} α β r s), Function.Surjective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) e)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Surjective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s e)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (e : RelIso.{u2, u1} α β r s), Function.Surjective.{succ u2, succ u1} α β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) e)
 Case conversion may be inaccurate. Consider using '#align rel_iso.surjective RelIso.surjectiveₓ'. -/
 protected theorem surjective (e : r ≃r s) : Surjective e :=
   e.toEquiv.Surjective
@@ -1245,7 +1257,7 @@ protected theorem surjective (e : r ≃r s) : Surjective e :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s) {a : α} {b : α}, Iff (Eq.{succ u2} β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f a) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f b)) (Eq.{succ u1} α a b)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)) b)) (Eq.{succ u2} α a b)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s) {a : α} {b : α}, Iff (Eq.{succ u1} β (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RelIso.{u2, u1} α β r s) α (fun (_x : α) => β) (RelHomClass.toFunLike.{max u2 u1, u2, u1} (RelIso.{u2, u1} α β r s) α β r s (RelIso.instRelHomClassRelIso.{u2, u1} α β r s)) f b)) (Eq.{succ u2} α a b)
 Case conversion may be inaccurate. Consider using '#align rel_iso.eq_iff_eq RelIso.eq_iff_eqₓ'. -/
 @[simp]
 theorem eq_iff_eq (f : r ≃r s) {a b} : f a = f b ↔ a = b :=
@@ -1277,7 +1289,7 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelEmbedding.{u1, u2} α β r s) (fun (_x : RelEmbedding.{u1, u2} α β r s) => α -> β) (RelEmbedding.hasCoeToFun.{u1, u2} α β r s) f)) -> (RelIso.{u1, u2} α β r s)
 but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} α β)) (RelEmbedding.toEmbedding.{u1, u2} α β r s f))) -> (RelIso.{u1, u2} α β r s)
+  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelEmbedding.{u1, u2} α β r s), (Function.Surjective.{succ u1, succ u2} α β (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RelEmbedding.{u1, u2} α β r s) α (fun (_x : α) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : α) => β) _x) (RelHomClass.toFunLike.{max u1 u2, u1, u2} (RelEmbedding.{u1, u2} α β r s) α β r s (RelEmbedding.instRelHomClassRelEmbedding.{u1, u2} α β r s)) f)) -> (RelIso.{u1, u2} α β r s)
 Case conversion may be inaccurate. Consider using '#align rel_iso.of_surjective RelIso.ofSurjectiveₓ'. -/
 /-- A surjective relation embedding is a relation isomorphism. -/
 @[simps apply]
Diff
@@ -655,6 +655,12 @@ protected theorem wellFounded : ∀ (f : r ↪r s) (h : WellFounded s), WellFoun
   | f, ⟨H⟩ => ⟨fun a => f.Acc _ (H _)⟩
 #align rel_embedding.well_founded RelEmbedding.wellFounded
 
+/- warning: rel_embedding.is_well_founded -> RelEmbedding.isWellFounded is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsWellFounded.{u2} β s], IsWellFounded.{u1} α r)
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u2, u1} α β r s) -> (forall [_inst_1 : IsWellFounded.{u1} β s], IsWellFounded.{u2} α r)
+Case conversion may be inaccurate. Consider using '#align rel_embedding.is_well_founded RelEmbedding.isWellFoundedₓ'. -/
 protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r :=
   ⟨f.WellFounded IsWellFounded.wf⟩
 #align rel_embedding.is_well_founded RelEmbedding.isWellFounded
@@ -671,15 +677,19 @@ protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrd
 
 end RelEmbedding
 
+#print Subtype.wellFoundedLT /-
 instance Subtype.wellFoundedLT [LT α] [WellFoundedLT α] (p : α → Prop) :
     WellFoundedLT (Subtype p) :=
   (Subtype.relEmbedding (· < ·) p).IsWellFounded
 #align subtype.well_founded_lt Subtype.wellFoundedLT
+-/
 
+#print Subtype.wellFoundedGT /-
 instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
     WellFoundedGT (Subtype p) :=
   (Subtype.relEmbedding (· > ·) p).IsWellFounded
 #align subtype.well_founded_gt Subtype.wellFoundedGT
+-/
 
 #print Quotient.mkRelHom /-
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
Diff
@@ -681,11 +681,13 @@ instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
   (Subtype.relEmbedding (· > ·) p).IsWellFounded
 #align subtype.well_founded_gt Subtype.wellFoundedGT
 
+#print Quotient.mkRelHom /-
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
 @[simps]
 def Quotient.mkRelHom [Setoid α] {r : α → α → Prop} (H) : r →r Quotient.lift₂ r H :=
   ⟨@Quotient.mk' α _, fun _ _ => id⟩
 #align quotient.mk_rel_hom Quotient.mkRelHom
+-/
 
 #print Quotient.outRelEmbedding /-
 /-- `quotient.out` as a relation embedding between the lift of a relation and the relation. -/
@@ -699,13 +701,18 @@ noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
 #align quotient.out_rel_embedding Quotient.outRelEmbedding
 -/
 
+/- warning: quotient.out'_rel_embedding clashes with rel_embedding.quotient.out'_rel_embedding -> Quotient.out'RelEmbedding
+Case conversion may be inaccurate. Consider using '#align quotient.out'_rel_embedding Quotient.out'RelEmbeddingₓ'. -/
+#print Quotient.out'RelEmbedding /-
 /-- `quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
 noncomputable def Quotient.out'RelEmbedding {s : Setoid α} {r : α → α → Prop} (H) :
     (fun a b => Quotient.liftOn₂' a b r H) ↪r r :=
   { Quotient.outRelEmbedding _ with toFun := Quotient.out' }
 #align quotient.out'_rel_embedding Quotient.out'RelEmbedding
+-/
 
+#print acc_lift₂_iff /-
 @[simp]
 theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
     Acc (Quotient.lift₂ r H) ⟦a⟧ ↔ Acc r a :=
@@ -719,12 +726,15 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
     obtain ⟨a', rfl⟩ := q.exists_rep
     exact IH a' h
 #align acc_lift₂_iff acc_lift₂_iff
+-/
 
+#print acc_liftOn₂'_iff /-
 @[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 :=
   acc_lift₂_iff
 #align acc_lift_on₂'_iff acc_liftOn₂'_iff
+-/
 
 #print wellFounded_lift₂_iff /-
 /-- A relation is well founded iff its lift to a quotient is. -/
@@ -743,11 +753,13 @@ alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.qu
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
+#print wellFounded_liftOn₂'_iff /-
 @[simp]
 theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
     (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r :=
   wellFounded_lift₂_iff
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
+-/
 
 alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
 #align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit 5923c4c7df633a157c9b752570a41ba5e8399289
+! leanprover-community/mathlib commit f29120f82f6e24a6f6579896dfa2de6769fec962
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -669,6 +669,8 @@ protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrd
   | f, H => { f.is_strict_total_order with wf := f.well_founded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
+end RelEmbedding
+
 instance Subtype.wellFoundedLT [LT α] [WellFoundedLT α] (p : α → Prop) :
     WellFoundedLT (Subtype p) :=
   (Subtype.relEmbedding (· < ·) p).IsWellFounded
@@ -737,8 +739,7 @@ theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop} {H} :
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 -/
 
-alias _root_.well_founded_lift₂_iff ↔
-  _root_.well_founded.of_quotient_lift₂ _root_.well_founded.quotient_lift₂
+alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.quotient_lift₂
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
@@ -748,11 +749,12 @@ theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H}
   wellFounded_lift₂_iff
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
 
-alias _root_.well_founded_lift_on₂'_iff ↔
-  _root_.well_founded.of_quotient_lift_on₂' _root_.well_founded.quotient_lift_on₂'
+alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
 #align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
 #align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
 
+namespace RelEmbedding
+
 #print RelEmbedding.ofMapRelIff /-
 /--
 To define an relation embedding from an antisymmetric relation `r` to a reflexive relation `s` it
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit 3353f661228bd27f632c600cd1a58b874d847c90
+! leanprover-community/mathlib commit 5923c4c7df633a157c9b752570a41ba5e8399289
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -655,6 +655,10 @@ protected theorem wellFounded : ∀ (f : r ↪r s) (h : WellFounded s), WellFoun
   | f, ⟨H⟩ => ⟨fun a => f.Acc _ (H _)⟩
 #align rel_embedding.well_founded RelEmbedding.wellFounded
 
+protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r :=
+  ⟨f.WellFounded IsWellFounded.wf⟩
+#align rel_embedding.is_well_founded RelEmbedding.isWellFounded
+
 /- warning: rel_embedding.is_well_order -> RelEmbedding.isWellOrder is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop}, (RelEmbedding.{u1, u2} α β r s) -> (forall [_inst_1 : IsWellOrder.{u2} β s], IsWellOrder.{u1} α r)
@@ -665,6 +669,16 @@ protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrd
   | f, H => { f.is_strict_total_order with wf := f.well_founded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
+instance Subtype.wellFoundedLT [LT α] [WellFoundedLT α] (p : α → Prop) :
+    WellFoundedLT (Subtype p) :=
+  (Subtype.relEmbedding (· < ·) p).IsWellFounded
+#align subtype.well_founded_lt Subtype.wellFoundedLT
+
+instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
+    WellFoundedGT (Subtype p) :=
+  (Subtype.relEmbedding (· > ·) p).IsWellFounded
+#align subtype.well_founded_gt Subtype.wellFoundedGT
+
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
 @[simps]
 def Quotient.mkRelHom [Setoid α] {r : α → α → Prop} (H) : r →r Quotient.lift₂ r H :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
+! leanprover-community/mathlib commit 3353f661228bd27f632c600cd1a58b874d847c90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -665,10 +665,16 @@ protected theorem isWellOrder : ∀ (f : r ↪r s) [IsWellOrder β s], IsWellOrd
   | f, H => { f.is_strict_total_order with wf := f.well_founded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
+/-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
+@[simps]
+def Quotient.mkRelHom [Setoid α] {r : α → α → Prop} (H) : r →r Quotient.lift₂ r H :=
+  ⟨@Quotient.mk' α _, fun _ _ => id⟩
+#align quotient.mk_rel_hom Quotient.mkRelHom
+
 #print Quotient.outRelEmbedding /-
 /-- `quotient.out` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
-noncomputable def Quotient.outRelEmbedding [s : Setoid α] {r : α → α → Prop} (H) :
+noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop} (H) :
     Quotient.lift₂ r H ↪r r :=
   ⟨Embedding.quotientOut α,
     by
@@ -677,17 +683,43 @@ noncomputable def Quotient.outRelEmbedding [s : Setoid α] {r : α → α → Pr
 #align quotient.out_rel_embedding Quotient.outRelEmbedding
 -/
 
+/-- `quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
+@[simps]
+noncomputable def Quotient.out'RelEmbedding {s : Setoid α} {r : α → α → Prop} (H) :
+    (fun a b => Quotient.liftOn₂' a b r H) ↪r r :=
+  { Quotient.outRelEmbedding _ with toFun := Quotient.out' }
+#align quotient.out'_rel_embedding Quotient.out'RelEmbedding
+
+@[simp]
+theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop} {H} {a} :
+    Acc (Quotient.lift₂ r H) ⟦a⟧ ↔ Acc r a :=
+  by
+  constructor
+  · exact RelHomClass.acc (Quotient.mkRelHom H) a
+  · intro ac
+    induction' ac with _ H IH
+    dsimp at IH
+    refine' ⟨_, fun q h => _⟩
+    obtain ⟨a', rfl⟩ := q.exists_rep
+    exact IH a' h
+#align acc_lift₂_iff acc_lift₂_iff
+
+@[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 :=
+  acc_lift₂_iff
+#align acc_lift_on₂'_iff acc_liftOn₂'_iff
+
 #print wellFounded_lift₂_iff /-
 /-- A relation is well founded iff its lift to a quotient is. -/
-@[simp]
-theorem wellFounded_lift₂_iff [s : Setoid α] {r : α → α → Prop} {H} :
+theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop} {H} :
     WellFounded (Quotient.lift₂ r H) ↔ WellFounded r :=
-  ⟨fun hr =>
-    by
-    suffices ∀ {x : Quotient s} {a : α}, ⟦a⟧ = x → Acc r a by exact ⟨fun a => this rfl⟩
-    · refine' fun x => hr.induction x _
-      rintro x IH a rfl
-      exact ⟨_, fun b hb => IH ⟦b⟧ hb rfl⟩, (Quotient.outRelEmbedding H).WellFounded⟩
+  by
+  constructor
+  · exact RelHomClass.wellFounded (Quotient.mkRelHom H)
+  · refine' fun wf => ⟨fun q => _⟩
+    obtain ⟨a, rfl⟩ := q.exists_rep
+    exact acc_lift₂_iff.2 (wf.apply a)
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 -/
 
@@ -696,6 +728,17 @@ alias _root_.well_founded_lift₂_iff ↔
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
+@[simp]
+theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
+    (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r :=
+  wellFounded_lift₂_iff
+#align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
+
+alias _root_.well_founded_lift_on₂'_iff ↔
+  _root_.well_founded.of_quotient_lift_on₂' _root_.well_founded.quotient_lift_on₂'
+#align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
+#align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
+
 #print RelEmbedding.ofMapRelIff /-
 /--
 To define an relation embedding from an antisymmetric relation `r` to a reflexive relation `s` it
Diff
@@ -928,7 +928,7 @@ theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u1) (succ u2)} ((fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (fun (_x : RelIso.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β (fun (a : α) (b : α) => r a b) s) (RelIso.mk.{u1, u2} α β (fun (a : α) (b : α) => r a b) s f o)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.toRelEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {{a : α}} {{b : α}}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.toRelEmbedding.{u2, u1} α β (fun (a : α) (b : α) => r a b) s (RelIso.mk.{u2, u1} α β (fun (a : α) (b : α) => r a b) s f o)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f)
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_mk RelIso.coe_fn_mkₓ'. -/
 @[simp]
 theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) : (RelIso.mk f o : α → β) = f :=
@@ -939,7 +939,7 @@ theorem coe_fn_mk (f : α ≃ β) (o : ∀ ⦃a b⦄, s (f a) (f b) ↔ r a b) :
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u1, u2} α β r s), Eq.{max (succ u1) (succ u2)} ((fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (RelIso.toEquiv.{u1, u2} α β r s f)) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RelIso.{u1, u2} α β r s) (fun (_x : RelIso.{u1, u2} α β r s) => α -> β) (RelIso.hasCoeToFun.{u1, u2} α β r s) f)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : RelIso.{u2, u1} α β r s), Eq.{max (succ u2) (succ u1)} (forall (a : α), (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (RelIso.toEquiv.{u2, u1} α β r s f)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : α) => β) _x) (EmbeddingLike.toFunLike.{max (succ u2) (succ u1), succ u2, succ u1} (Function.Embedding.{succ u2, succ u1} α β) α β (Function.instEmbeddingLikeEmbedding.{succ u2, succ u1} α β)) (RelEmbedding.toEmbedding.{u2, u1} α β r s (RelIso.toRelEmbedding.{u2, u1} α β r s f)))
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquivₓ'. -/
 @[simp]
 theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
@@ -1081,7 +1081,7 @@ protected def swap (f : r ≃r s) : swap r ≃r swap s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u1, succ u2} α β) (o : forall {a : α} {b : α}, Iff (s (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f a) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} ((fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (RelIso.{u2, u1} β α s r) (fun (_x : RelIso.{u2, u1} β α s r) => β -> α) (RelIso.hasCoeToFun.{u2, u1} β α s r) (RelIso.symm.{u1, u2} α β r s (RelIso.mk.{u1, u2} α β r s f o))) (coeFn.{max 1 (max (succ u2) (succ u1)) (succ u1) (succ u2), max (succ u2) (succ u1)} (Equiv.{succ u2, succ u1} β α) (fun (_x : Equiv.{succ u2, succ u1} β α) => β -> α) (Equiv.hasCoeToFun.{succ u2, succ u1} β α) (Equiv.symm.{succ u1, succ u2} α β f))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : β), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) a) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
+  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : Equiv.{succ u2, succ u1} α β) (o : forall {a : α} {b : α}, Iff (s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f a) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) f b)) (r a b)), Eq.{max (succ u2) (succ u1)} (forall (a : β), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) a) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => α) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u2), succ u1, succ u2} (Function.Embedding.{succ u1, succ u2} β α) β α (Function.instEmbeddingLikeEmbedding.{succ u1, succ u2} β α)) (RelEmbedding.toEmbedding.{u1, u2} β α s r (RelIso.toRelEmbedding.{u1, u2} β α s r (RelIso.symm.{u2, u1} α β r s (RelIso.mk.{u2, u1} α β r s f o))))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (Equiv.{succ u1, succ u2} β α) β (fun (_x : β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : β) => α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} β α) (Equiv.symm.{succ u2, succ u1} α β f))
 Case conversion may be inaccurate. Consider using '#align rel_iso.coe_fn_symm_mk RelIso.coe_fn_symm_mkₓ'. -/
 @[simp]
 theorem coe_fn_symm_mk (f o) : ((@RelIso.mk _ _ r s f o).symm : β → α) = f.symm :=
Diff
@@ -995,11 +995,11 @@ def Simps.apply (h : r ≃r s) : α → β :=
 #align rel_iso.simps.apply RelIso.Simps.apply
 -/
 
-#print RelIso.Simps.symmApply /-
+#print RelIso.Simps.symm_apply /-
 /-- See Note [custom simps projection]. -/
-def Simps.symmApply (h : r ≃r s) : β → α :=
+def Simps.symm_apply (h : r ≃r s) : β → α :=
   h.symm
-#align rel_iso.simps.symm_apply RelIso.Simps.symmApply
+#align rel_iso.simps.symm_apply RelIso.Simps.symm_apply
 -/
 
 initialize_simps_projections RelIso (to_equiv_to_fun → apply, to_equiv_inv_fun → symm_apply,

Changes in mathlib4

mathlib3
mathlib4
Feat: Add some operations and lemmas on closure operators/order homs (#10348)

This adds conjugation of order homomorphisms & closure operators by order isos, as well as two new extensionality lemmas for closure operators, a proof that the inf of a closed family is closed, and that the closure of an element is the GLB of all closed elements larger than it. There is also includes some minor refactoring, moving Set.image_sSup from Mathlib/Order/Hom/CompleteLattice to Mathlib/Data/Set/Lattice and adding some common lemmas for EquivLike-things to OrderIso.

Diff
@@ -798,6 +798,14 @@ theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
   rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.symm_apply_rel RelIso.symm_apply_rel
 
+@[simp]
+theorem self_trans_symm (e : r ≃r s) : e.trans e.symm = RelIso.refl r :=
+  ext e.symm_apply_apply
+
+@[simp]
+theorem symm_trans_self (e : r ≃r s) : e.symm.trans e = RelIso.refl s :=
+  ext e.apply_symm_apply
+
 protected theorem bijective (e : r ≃r s) : Bijective e :=
   e.toEquiv.bijective
 #align rel_iso.bijective RelIso.bijective
chore: replace λ by fun (#11301)

Per the style guidelines, λ is disallowed in mathlib. This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes

  • In lines I was modifying anyway, I also converted => to .
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax λ x, , which I also replaced.
Diff
@@ -685,7 +685,7 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 #align rel_iso.coe_fn_to_equiv RelIso.coe_fn_toEquiv
 
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
-`function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
+`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 : α → β) :=
   DFunLike.coe_injective
 #align rel_iso.coe_fn_injective RelIso.coe_fn_injective
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -228,7 +228,7 @@ def toRelHom (f : r ↪r s) : r →r s where
 instance : Coe (r ↪r s) (r →r s) :=
   ⟨toRelHom⟩
 
---Porting note: removed
+-- Porting note: removed
 -- see Note [function coercion]
 -- instance : CoeFun (r ↪r s) fun _ => α → β :=
 --   ⟨fun o => o.toEmbedding⟩
@@ -656,7 +656,7 @@ instance : EquivLike (r ≃r s) α β where
   right_inv f := f.right_inv
   coe_injective' _ _ hf _ := DFunLike.ext' hf
 
---Porting note: helper instance
+-- Porting note: helper instance
 -- see Note [function coercion]
 instance : CoeFun (r ≃r s) fun _ => α → β :=
   ⟨DFunLike.coe⟩
refactor(Data/FunLike): use unbundled inheritance from FunLike (#8386)

The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike is EquivLike, since that has a custom coe_injective' field that is easier to implement. All other classes should take FunLike or EquivLike as a parameter.

Zulip thread

Important changes

Previously, morphism classes would be Type-valued and extend FunLike:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

After this PR, they should be Prop-valued and take FunLike as a parameter:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  [FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

(Note that A B stay marked as outParam even though they are not purely required to be so due to the FunLike parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam is slightly faster.)

Similarly, MyEquivClass should take EquivLike as a parameter.

As a result, every mention of [MyHomClass F A B] should become [FunLike F A B] [MyHomClass F A B].

Remaining issues

Slower (failing) search

While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul is more expensive. This is due to suboptimal processing of arguments. For example:

variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)

theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y

example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _

Before this PR, applying map_mul f gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Since M and N are out_params, [MulHomClass F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found.

After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Now [FunLike F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found, before trying MulHomClass F M N which fails. Since the Mul hierarchy is very big, this can be slow to fail, especially when there is no such Mul instance.

A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N] because MulHomClass fails or succeeds much faster than the others.

As a consequence, the simpNF linter is much slower since by design it tries and fails to apply many map_ lemmas. The same issue occurs a few times in existing calls to simp [map_mul], where map_mul is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.

simp not firing sometimes

This affects map_smulₛₗ and related definitions. For simp lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw can find every argument to map_smulₛₗ successfully but simp can't: leanprover/lean4#3701.

Missing instances due to unification failing

Especially in the category theory library, we might sometimes have a type A which is also accessible as a synonym (Bundled A hA).1. Instance synthesis doesn't always work if we have f : A →* B but x * y : (Bundled A hA).1 or vice versa. This seems to be mostly fixed by keeping A B as outParams in MulHomClass F A B. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1 instead of using the syntax in the discrimination tree.)

Workaround for issues

The timeouts can be worked around for now by specifying which map_mul we mean, either as map_mul f for some explicit f, or as e.g. MonoidHomClass.map_mul.

map_smulₛₗ not firing as simp lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ a simp lemma instead of the generic map_smulₛₗ. Writing simp [map_smulₛₗ _] also works.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -65,8 +65,8 @@ 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*) {α β : outParam <| Type*} (r : outParam <| α → α → Prop)
-  (s : outParam <| β → β → Prop) extends DFunLike F α fun _ => β where
+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)
 #align rel_hom_class RelHomClass
@@ -77,7 +77,7 @@ end
 
 namespace RelHomClass
 
-variable {F : Type*}
+variable {F : Type*} [FunLike F α β]
 
 protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
   | ⟨H⟩ => ⟨fun _ h => H _ (map_rel f h)⟩
@@ -103,12 +103,14 @@ end RelHomClass
 
 namespace RelHom
 
-instance : RelHomClass (r →r s) r s where
+instance : FunLike (r →r s) α β where
   coe o := o.toFun
   coe_injective' f g h := by
     cases f
     cases g
     congr
+
+instance : RelHomClass (r →r s) r s where
   map_rel := map_rel'
 
 initialize_simps_projections RelHom (toFun → apply)
@@ -231,14 +233,17 @@ instance : Coe (r ↪r s) (r →r s) :=
 -- instance : CoeFun (r ↪r s) fun _ => α → β :=
 --   ⟨fun o => o.toEmbedding⟩
 
--- TODO: define and instantiate a `RelEmbeddingClass`
-instance : RelHomClass (r ↪r s) r s where
+-- TODO: define and instantiate a `RelEmbeddingClass` when `EmbeddingLike` is defined
+instance : FunLike (r ↪r s) α β where
   coe := fun x => x.toFun
   coe_injective' f g h := by
     rcases f with ⟨⟨⟩⟩
     rcases g with ⟨⟨⟩⟩
     congr
-  map_rel f a b := Iff.mpr (map_rel_iff' f)
+
+-- TODO: define and instantiate a `RelEmbeddingClass` when `EmbeddingLike` is defined
+instance : RelHomClass (r ↪r s) r s where
+  map_rel f _ _ := Iff.mpr (map_rel_iff' f)
 
 initialize_simps_projections RelEmbedding (toFun → apply)
 
@@ -635,10 +640,13 @@ instance : CoeOut (r ≃r s) (r ↪r s) :=
 -- instance : CoeFun (r ≃r s) fun _ => α → β :=
 --   ⟨fun f => f⟩
 
--- TODO: define and instantiate a `RelIsoClass`
-instance : RelHomClass (r ≃r s) r s where
+-- TODO: define and instantiate a `RelIsoClass` when `EquivLike` is defined
+instance : FunLike (r ≃r s) α β where
   coe := fun x => x
   coe_injective' := Equiv.coe_fn_injective.comp toEquiv_injective
+
+-- TODO: define and instantiate a `RelIsoClass` when `EquivLike` is defined
+instance : RelHomClass (r ≃r s) r s where
   map_rel f _ _ := Iff.mpr (map_rel_iff' f)
 
 instance : EquivLike (r ≃r s) α β where
feat: add lake exe shake to CI (#9751)

This checks files for unused imports. The output here is piped through gh-problem-matcher-wrap so that it will show up as annotations.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -3,6 +3,7 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 -/
+import Mathlib.Init.Algebra.Classes
 import Mathlib.Data.FunLike.Basic
 import Mathlib.Logic.Embedding.Basic
 import Mathlib.Order.RelClasses
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -65,7 +65,7 @@ The relations `r` and `s` are `outParam`s since figuring them out from a goal is
 matching problem that Lean usually can't do unaided.
 -/
 class RelHomClass (F : Type*) {α β : outParam <| Type*} (r : outParam <| α → α → Prop)
-  (s : outParam <| β → β → Prop) extends FunLike F α fun _ => β where
+  (s : outParam <| β → β → Prop) extends DFunLike F α fun _ => β where
   /-- A `RelHomClass` sends related elements to related elements -/
   map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
 #align rel_hom_class RelHomClass
@@ -123,16 +123,16 @@ theorem coe_fn_toFun (f : r →r s) : f.toFun = (f : α → β) :=
 
 /-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : Injective fun (f : r →r s) => (f : α → β) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_hom.coe_fn_injective RelHom.coe_fn_injective
 
 @[ext]
 theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align rel_hom.ext RelHom.ext
 
 theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_hom.ext_iff RelHom.ext_iff
 
 /-- Identity map is a relation homomorphism. -/
@@ -271,16 +271,16 @@ theorem coe_mk : ⇑(⟨f, h⟩ : r ↪r s) = f :=
 
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : Injective fun f : r ↪r s => (f : α → β) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_embedding.coe_fn_injective RelEmbedding.coe_fn_injective
 
 @[ext]
 theorem ext ⦃f g : r ↪r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext _ _ h
+  DFunLike.ext _ _ h
 #align rel_embedding.ext RelEmbedding.ext
 
 theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_embedding.ext_iff RelEmbedding.ext_iff
 
 /-- Identity map is a relation embedding. -/
@@ -630,7 +630,7 @@ theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
 instance : CoeOut (r ≃r s) (r ↪r s) :=
   ⟨toRelEmbedding⟩
 
--- Porting note: moved to after `RelHomClass` instance and redefined as `FunLike.coe`
+-- Porting note: moved to after `RelHomClass` instance and redefined as `DFunLike.coe`
 -- instance : CoeFun (r ≃r s) fun _ => α → β :=
 --   ⟨fun f => f⟩
 
@@ -645,12 +645,12 @@ instance : EquivLike (r ≃r s) α β where
   inv f := f.toEquiv.symm
   left_inv f := f.left_inv
   right_inv f := f.right_inv
-  coe_injective' _ _ hf _ := FunLike.ext' hf
+  coe_injective' _ _ hf _ := DFunLike.ext' hf
 
 --Porting note: helper instance
 -- see Note [function coercion]
 instance : CoeFun (r ≃r s) fun _ => α → β :=
-  ⟨FunLike.coe⟩
+  ⟨DFunLike.coe⟩
 
 @[simp]
 theorem coe_toRelEmbedding (f : r ≃r s) : (f.toRelEmbedding : α → β) = f :=
@@ -678,16 +678,16 @@ theorem coe_fn_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
 /-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
 `function.injective (λ 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 : α → β) :=
-  FunLike.coe_injective
+  DFunLike.coe_injective
 #align rel_iso.coe_fn_injective RelIso.coe_fn_injective
 
 @[ext]
 theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=
-  FunLike.ext f g h
+  DFunLike.ext f g h
 #align rel_iso.ext RelIso.ext
 
 theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x :=
-  FunLike.ext_iff
+  DFunLike.ext_iff
 #align rel_iso.ext_iff RelIso.ext_iff
 
 /-- Inverse map of a relation isomorphism is a relation isomorphism. -/
@@ -696,7 +696,7 @@ protected def symm (f : r ≃r s) : s ≃r r :=
 #align rel_iso.symm RelIso.symm
 
 /-- 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 `FunLike`. -/
+  because `RelIso` defines custom coercions other than the ones given by `DFunLike`. -/
 def Simps.apply (h : r ≃r s) : α → β :=
   h
 #align rel_iso.simps.apply RelIso.Simps.apply
chore(*): use α → β instead of ∀ _ : α, β (#9529)
Diff
@@ -94,7 +94,7 @@ protected theorem acc [RelHomClass F r s] (f : F) (a : α) : Acc s (f a) → Acc
   exact ⟨_, fun a' h => IH (f a') (map_rel f h) _ rfl⟩
 #align rel_hom_class.acc RelHomClass.acc
 
-protected theorem wellFounded [RelHomClass F r s] (f : F) : ∀ _ : WellFounded s, WellFounded r
+protected theorem wellFounded [RelHomClass F r s] (f : F) : WellFounded s → WellFounded r
   | ⟨H⟩ => ⟨fun _ => RelHomClass.acc f _ (H _)⟩
 #align rel_hom_class.well_founded RelHomClass.wellFounded
 
feat(Order/RelIso): define missing instances (#9170)

Define EmbeddingLike (r ↪r s) α β and EquivLike (r ≃r s) α β.

Diff
@@ -230,7 +230,7 @@ instance : Coe (r ↪r s) (r →r s) :=
 -- instance : CoeFun (r ↪r s) fun _ => α → β :=
 --   ⟨fun o => o.toEmbedding⟩
 
--- TODO: define and instantiate a `RelEmbeddingClass` when `EmbeddingLike` is defined
+-- TODO: define and instantiate a `RelEmbeddingClass`
 instance : RelHomClass (r ↪r s) r s where
   coe := fun x => x.toFun
   coe_injective' f g h := by
@@ -239,15 +239,11 @@ instance : RelHomClass (r ↪r s) r s where
     congr
   map_rel f a b := Iff.mpr (map_rel_iff' f)
 
-
-/-- See Note [custom simps projection]. We specify this explicitly because we have a coercion not
-given by the `FunLike` instance. Todo: remove that instance?
--/
-def Simps.apply (h : r ↪r s) : α → β :=
-  h
-
 initialize_simps_projections RelEmbedding (toFun → apply)
 
+instance : EmbeddingLike (r ↪r s) α β where
+  injective' f := f.inj'
+
 @[simp]
 theorem coe_toEmbedding : ((f : r ↪r s).toEmbedding : α → β) = f :=
   rfl
@@ -261,7 +257,7 @@ theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
 #align rel_embedding.injective RelEmbedding.injective
 
-@[simp] theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b := f.injective.eq_iff
+theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b := f.injective.eq_iff
 #align rel_embedding.inj RelEmbedding.inj
 
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
@@ -638,12 +634,19 @@ instance : CoeOut (r ≃r s) (r ↪r s) :=
 -- instance : CoeFun (r ≃r s) fun _ => α → β :=
 --   ⟨fun f => f⟩
 
--- TODO: define and instantiate a `RelIsoClass` when `EquivLike` is defined
+-- TODO: define and instantiate a `RelIsoClass`
 instance : RelHomClass (r ≃r s) r s where
   coe := fun x => x
   coe_injective' := Equiv.coe_fn_injective.comp toEquiv_injective
   map_rel f _ _ := Iff.mpr (map_rel_iff' f)
 
+instance : EquivLike (r ≃r s) α β where
+  coe f := f
+  inv f := f.toEquiv.symm
+  left_inv f := f.left_inv
+  right_inv f := f.right_inv
+  coe_injective' _ _ hf _ := FunLike.ext' hf
+
 --Porting note: helper instance
 -- see Note [function coercion]
 instance : CoeFun (r ≃r s) fun _ => α → β :=
chore(Order/RelIso): drop a duplicate lemma (#2390)

Duplicate of coe_fn_toEquiv several lines below.

Diff
@@ -657,10 +657,6 @@ theorem coe_toRelEmbedding (f : r ≃r s) : (f.toRelEmbedding : α → β) = f :
 theorem coe_toEmbedding (f : r ≃r s) : (f.toEmbedding : α → β) = f :=
   rfl
 
-@[simp]
-theorem coe_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
-  rfl
-
 theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_iso.map_rel_iff RelIso.map_rel_iff
chore(Order): restore missing simp attribute (#8162)

This lemma was marked simp in mathlib3, and the attribute seems to have gone missing during the port.

Diff
@@ -261,8 +261,7 @@ theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
 #align rel_embedding.injective RelEmbedding.injective
 
-theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b :=
-  f.injective.eq_iff
+@[simp] theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b := f.injective.eq_iff
 #align rel_embedding.inj RelEmbedding.inj
 
 theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
chore(Order/RelIso): golf, fix NS (#7114)
  • Rename Surjective.wellFounded_iff to Function.Surjective.wellFounded_iff.
  • Golf the proof.
Diff
@@ -183,20 +183,14 @@ theorem RelHom.injective_of_increasing [IsTrichotomous α r] [IsIrrefl β s] (f
   _root_.injective_of_increasing r s f f.map_rel
 #align rel_hom.injective_of_increasing RelHom.injective_of_increasing
 
--- TODO: define a `RelIffClass` so we don't have to do all the `convert` trickery?
-theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
+theorem Function.Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
     (o : ∀ {a b}, r a b ↔ s (f a) (f b)) :
     WellFounded r ↔ WellFounded s :=
   Iff.intro
-    (by
-      refine RelHomClass.wellFounded (RelHom.mk ?_ ?_ : s →r r)
-      · exact Classical.choose hf.hasRightInverse
-      intro a b h
-      apply o.2
-      convert h
-      iterate 2 apply Classical.choose_spec hf.hasRightInverse)
+    (RelHomClass.wellFounded (⟨surjInv hf,
+      fun h => by simpa only [o, surjInv_eq hf] using h⟩ : s →r r))
     (RelHomClass.wellFounded (⟨f, o.1⟩ : r →r s))
-#align surjective.well_founded_iff Surjective.wellFounded_iff
+#align surjective.well_founded_iff Function.Surjective.wellFounded_iff
 
 /-- 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)`. -/
feat: patch for new alias command (#6172)
Diff
@@ -475,7 +475,7 @@ theorem wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop}
     exact acc_lift₂_iff.2 (wf.apply a)
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 
-alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.quotient_lift₂
+alias ⟨WellFounded.of_quotient_lift₂, WellFounded.quotient_lift₂⟩ := wellFounded_lift₂_iff
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
@@ -485,7 +485,7 @@ theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H}
   wellFounded_lift₂_iff (H := H)
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
 
-alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
+alias ⟨WellFounded.of_quotient_liftOn₂', WellFounded.quotient_liftOn₂'⟩ := wellFounded_liftOn₂'_iff
 #align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
 #align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
 
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -452,7 +452,6 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop}
   · exact RelHomClass.acc (Quotient.mkRelHom H) a
   · intro ac
     induction' ac with _ _ IH
-    dsimp at IH
     refine' ⟨_, fun q h => _⟩
     obtain ⟨a', rfl⟩ := q.exists_rep
     exact IH a' h
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -33,6 +33,8 @@ isomorphisms.
 * `≃r`: `RelIso`
 -/
 
+set_option autoImplicit true
+
 
 open Function
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -38,12 +38,12 @@ open Function
 
 universe u v w
 
-variable {α β γ δ : Type _} {r : α → α → Prop} {s : β → β → Prop}
+variable {α β γ δ : Type*} {r : α → α → Prop} {s : β → β → Prop}
   {t : γ → γ → Prop} {u : δ → δ → Prop}
 
 /-- 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
+structure RelHom {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) where
   /-- The underlying function of a `RelHom` -/
   toFun : α → β
   /-- A `RelHom` sends related elements to related elements -/
@@ -62,7 +62,7 @@ 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 _) {α β : outParam <| Type _} (r : outParam <| α → α → Prop)
+class RelHomClass (F : Type*) {α β : outParam <| Type*} (r : outParam <| α → α → Prop)
   (s : outParam <| β → β → Prop) extends FunLike F α fun _ => β where
   /-- A `RelHomClass` sends related elements to related elements -/
   map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)
@@ -74,7 +74,7 @@ end
 
 namespace RelHomClass
 
-variable {F : Type _}
+variable {F : Type*}
 
 protected theorem isIrrefl [RelHomClass F r s] (f : F) : ∀ [IsIrrefl β s], IsIrrefl α r
   | ⟨H⟩ => ⟨fun _ h => H _ (map_rel f h)⟩
@@ -198,7 +198,7 @@ theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
 
 /-- 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
+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
 #align rel_embedding RelEmbedding
@@ -208,7 +208,7 @@ is an embedding `f : α ↪ β` such that `r a b ↔ s (f a) (f b)`. -/
 infixl:25 " ↪r " => RelEmbedding
 
 /-- 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) :
+def Subtype.relEmbedding {X : Type*} (r : X → X → Prop) (p : X → Prop) :
     (Subtype.val : Subtype p → X) ⁻¹'o r ↪r r :=
   ⟨Embedding.subtype p, Iff.rfl⟩
 #align subtype.rel_embedding Subtype.relEmbedding
@@ -616,7 +616,7 @@ def prodLexMap (f : r ↪r s) (g : t ↪r u) : Prod.Lex r t ↪r Prod.Lex s u wh
 end RelEmbedding
 
 /-- A relation isomorphism is an equivalence that is also a relation embedding. -/
-structure RelIso {α β : Type _} (r : α → α → Prop) (s : β → β → Prop) extends α ≃ β where
+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
 #align rel_iso RelIso
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2017 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit f29120f82f6e24a6f6579896dfa2de6769fec962
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.FunLike.Basic
 import Mathlib.Logic.Embedding.Basic
 import Mathlib.Order.RelClasses
 
+#align_import order.rel_iso.basic from "leanprover-community/mathlib"@"f29120f82f6e24a6f6579896dfa2de6769fec962"
+
 /-!
 # Relation homomorphisms, embeddings, isomorphisms
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -256,7 +256,7 @@ def Simps.apply (h : r ↪r s) : α → β :=
 initialize_simps_projections RelEmbedding (toFun → apply)
 
 @[simp]
-theorem coe_toEmbedding : ((f : r ↪r s).toEmbedding : α → β)  = f :=
+theorem coe_toEmbedding : ((f : r ↪r s).toEmbedding : α → β) = f :=
   rfl
 #align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbedding
 
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -843,7 +843,7 @@ 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₂ :=
   ⟨Equiv.sumCongr e₁.toEquiv e₂.toEquiv, @fun a b => by
-    cases' e₁ with f hf ; cases' e₂ with g hg ; cases a <;> cases b <;> simp [hf, hg]⟩
+    cases' e₁ with f hf; cases' e₂ with g hg; cases a <;> cases b <;> simp [hf, hg]⟩
 #align rel_iso.sum_lex_congr RelIso.sumLexCongr
 
 /-- Given relation isomorphisms `r₁ ≃r s₁` and `r₂ ≃r s₂`, construct a relation isomorphism for the
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -331,7 +331,7 @@ def preimage (f : α ↪ β) (s : β → β → Prop) : f ⁻¹'o s ↪r s :=
 #align rel_embedding.preimage RelEmbedding.preimage
 
 theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s := by
-  ext (a b)
+  ext a b
   exact f.map_rel_iff.symm
 #align rel_embedding.eq_preimage RelEmbedding.eq_preimage
 
chore: convert lambda in docs to fun (#5045)

Found with git grep -n "λ [a-zA-Z_ ]*,"

Diff
@@ -589,7 +589,7 @@ def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u where
 #align rel_embedding.sum_lex_map RelEmbedding.sumLexMap
 #align rel_embedding.sum_lex_map_apply RelEmbedding.sumLexMap_apply
 
-/-- `λ b, Prod.mk a b` as a relation embedding. -/
+/-- `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 where
   toFun := Prod.mk a
@@ -598,7 +598,7 @@ def prodLexMkLeft (s : β → β → Prop) {a : α} (h : ¬r a a) : s ↪r Prod.
 #align rel_embedding.prod_lex_mk_left RelEmbedding.prodLexMkLeft
 #align rel_embedding.prod_lex_mk_left_apply RelEmbedding.prodLexMkLeft_apply
 
-/-- `λ a, Prod.mk a b` as a relation embedding. -/
+/-- `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 where
   toFun a := (a, b)
chore: fix grammar 3/3 (#5003)

Part 3 of #5001

Diff
@@ -493,7 +493,7 @@ alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFoun
 
 namespace RelEmbedding
 
-/-- To define an relation embedding from an antisymmetric relation `r` to a reflexive relation `s`
+/-- 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) :
@@ -629,7 +629,7 @@ infixl:25 " ≃r " => RelIso
 
 namespace RelIso
 
-/-- Convert an `RelIso` to a `RelEmbedding`. This function is also available as a coercion
+/-- 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 :=
chore: fix upper/lowercase in comments (#4360)
  • Run a non-interactive version of fix-comments.py on all files.
  • Go through the diff and manually add/discard/edit chunks.
Diff
@@ -420,7 +420,7 @@ instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
   (Subtype.relEmbedding (· > ·) p).isWellFounded
 #align subtype.well_founded_gt Subtype.wellFoundedGT
 
-/-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
+/-- `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 :=
chore: reenable eta, bump to nightly 2023-05-16 (#3414)

Now that leanprover/lean4#2210 has been merged, this PR:

  • removes all the set_option synthInstance.etaExperiment true commands (and some etaExperiment% term elaborators)
  • removes many but not quite all set_option maxHeartbeats commands
  • makes various other changes required to cope with leanprover/lean4#2210.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>

Diff
@@ -442,7 +442,7 @@ noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
 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 :=
-  { Quotient.outRelEmbedding _ with toFun := Quotient.out' }
+  { Quotient.outRelEmbedding H with toFun := Quotient.out' }
 #align rel_embedding.quotient.out'_rel_embedding Quotient.out'RelEmbedding
 
 @[simp]
@@ -462,7 +462,7 @@ theorem acc_lift₂_iff [Setoid α] {r : α → α → Prop}
 @[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 :=
-  acc_lift₂_iff
+  acc_lift₂_iff (H := H)
 #align acc_lift_on₂'_iff acc_liftOn₂'_iff
 
 /-- A relation is well founded iff its lift to a quotient is. -/
@@ -484,7 +484,7 @@ alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.qu
 @[simp]
 theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
     (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r :=
-  wellFounded_lift₂_iff
+  wellFounded_lift₂_iff (H := H)
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
 
 alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
@@ -607,7 +607,6 @@ def prodLexMkRight (r : α → α → Prop) {b : β} (h : ¬s b b) : r ↪r Prod
 #align rel_embedding.prod_lex_mk_right RelEmbedding.prodLexMkRight
 #align rel_embedding.prod_lex_mk_right_apply RelEmbedding.prodLexMkRight_apply
 
-set_option synthInstance.etaExperiment true
 /-- `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 where
chore: use FunLike.coe as coercion for OrderIso and RelEmbedding (#3082)

The changes I made were.

Use FunLike.coe instead of the previous definition for the coercion from RelEmbedding To functions and OrderIso to functions. The previous definition was

instance : CoeFun (r ↪r s) fun _ => α → β :=
--   ⟨fun o => o.toEmbedding⟩

This does not display nicely.

I also restored the simp attributes on a few lemmas that had their simp attributes removed during the port. Eventually we might want a RelEmbeddingLike class, but this PR does not implement that.

I also added a few lemmas that proved that coercions to function commute with RelEmbedding.toRelHom or similar.

The other changes are just fixing the build. One strange issue is that the lemma Finset.mapEmbedding_apply seems to be harder to use, it has to be used with rw instead of simp

Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>

Diff
@@ -232,13 +232,14 @@ def toRelHom (f : r ↪r s) : r →r s where
 instance : Coe (r ↪r s) (r →r s) :=
   ⟨toRelHom⟩
 
+--Porting note: removed
 -- see Note [function coercion]
-instance : CoeFun (r ↪r s) fun _ => α → β :=
-  ⟨fun o => o.toEmbedding⟩
+-- instance : CoeFun (r ↪r s) fun _ => α → β :=
+--   ⟨fun o => o.toEmbedding⟩
 
 -- TODO: define and instantiate a `RelEmbeddingClass` when `EmbeddingLike` is defined
 instance : RelHomClass (r ↪r s) r s where
-  coe := fun x => x
+  coe := fun x => x.toFun
   coe_injective' f g h := by
     rcases f with ⟨⟨⟩⟩
     rcases g with ⟨⟨⟩⟩
@@ -254,6 +255,15 @@ def Simps.apply (h : r ↪r s) : α → β :=
 
 initialize_simps_projections RelEmbedding (toFun → apply)
 
+@[simp]
+theorem coe_toEmbedding : ((f : r ↪r s).toEmbedding : α → β)  = f :=
+  rfl
+#align rel_embedding.coe_fn_to_embedding RelEmbedding.coe_toEmbedding
+
+@[simp]
+theorem coe_toRelHom : ((f : r ↪r s).toRelHom : α → β) = f :=
+  rfl
+
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
 #align rel_embedding.injective RelEmbedding.injective
@@ -266,8 +276,10 @@ theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_embedding.map_rel_iff RelEmbedding.map_rel_iff
 
-#noalign coe_fn_mk
-#noalign coe_fn_to_embedding
+@[simp]
+theorem coe_mk : ⇑(⟨f, h⟩ : r ↪r s) = f :=
+  rfl
+#align rel_embedding.coe_fn_mk RelEmbedding.coe_mk
 
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : Injective fun f : r ↪r s => (f : α → β) :=
@@ -595,12 +607,13 @@ def prodLexMkRight (r : α → α → Prop) {b : β} (h : ¬s b b) : r ↪r Prod
 #align rel_embedding.prod_lex_mk_right RelEmbedding.prodLexMkRight
 #align rel_embedding.prod_lex_mk_right_apply RelEmbedding.prodLexMkRight_apply
 
+set_option synthInstance.etaExperiment true
 /-- `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 where
   toFun := Prod.map f g
   inj' := f.injective.Prod_map g.injective
-  map_rel_iff' := by simp [Prod.lex_def, f.map_rel_iff, g.map_rel_iff]
+  map_rel_iff' := by simp [Prod.lex_def, f.map_rel_iff, g.map_rel_iff, f.inj]
 #align rel_embedding.prod_lex_map RelEmbedding.prodLexMap
 #align rel_embedding.prod_lex_map_apply RelEmbedding.prodLexMap_apply
 
@@ -631,9 +644,9 @@ theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
 instance : CoeOut (r ≃r s) (r ↪r s) :=
   ⟨toRelEmbedding⟩
 
--- see Note [function coercion]
-instance : CoeFun (r ≃r s) fun _ => α → β :=
-  ⟨fun f => f⟩
+-- Porting note: moved to after `RelHomClass` instance and redefined as `FunLike.coe`
+-- instance : CoeFun (r ≃r s) fun _ => α → β :=
+--   ⟨fun f => f⟩
 
 -- TODO: define and instantiate a `RelIsoClass` when `EquivLike` is defined
 instance : RelHomClass (r ≃r s) r s where
@@ -641,6 +654,23 @@ instance : RelHomClass (r ≃r s) r s where
   coe_injective' := Equiv.coe_fn_injective.comp toEquiv_injective
   map_rel f _ _ := Iff.mpr (map_rel_iff' f)
 
+--Porting note: helper instance
+-- see Note [function coercion]
+instance : CoeFun (r ≃r s) fun _ => α → β :=
+  ⟨FunLike.coe⟩
+
+@[simp]
+theorem coe_toRelEmbedding (f : r ≃r s) : (f.toRelEmbedding : α → β) = f :=
+  rfl
+
+@[simp]
+theorem coe_toEmbedding (f : r ≃r s) : (f.toEmbedding : α → β) = f :=
+  rfl
+
+@[simp]
+theorem coe_toEquiv (f : r ≃r s) : (f.toEquiv : α → β) = f :=
+  rfl
+
 theorem map_rel_iff (f : r ≃r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_iso.map_rel_iff RelIso.map_rel_iff
@@ -822,7 +852,8 @@ 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₂ :=
-  ⟨Equiv.prodCongr e₁.toEquiv e₂.toEquiv, by simp [Prod.lex_def, e₁.map_rel_iff, e₂.map_rel_iff]⟩
+  ⟨Equiv.prodCongr e₁.toEquiv e₂.toEquiv, by simp [Prod.lex_def, e₁.map_rel_iff, e₂.map_rel_iff,
+    e₁.injective.eq_iff]⟩
 #align rel_iso.prod_lex_congr RelIso.prodLexCongr
 
 /-- Two relations on empty types are isomorphic. -/
chore: update SHA for mathlib#18268, #18771, RelIso/Basic (#3362)

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit 3353f661228bd27f632c600cd1a58b874d847c90
+! leanprover-community/mathlib commit f29120f82f6e24a6f6579896dfa2de6769fec962
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -192,7 +192,6 @@ theorem Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
     (by
       refine RelHomClass.wellFounded (RelHom.mk ?_ ?_ : s →r r)
       · exact Classical.choose hf.hasRightInverse
-
       intro a b h
       apply o.2
       convert h
@@ -389,20 +388,36 @@ protected theorem wellFounded : ∀ (_ : r ↪r s) (_ : WellFounded s), WellFoun
   | f, ⟨H⟩ => ⟨fun _ => f.acc _ (H _)⟩
 #align rel_embedding.well_founded RelEmbedding.wellFounded
 
+protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r :=
+  ⟨f.wellFounded IsWellFounded.wf⟩
+#align rel_embedding.is_well_founded RelEmbedding.isWellFounded
+
 protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrder α r
   | f, H => { f.isStrictTotalOrder with wf := f.wellFounded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
+end RelEmbedding
+
+instance Subtype.wellFoundedLT [LT α] [WellFoundedLT α] (p : α → Prop) :
+    WellFoundedLT (Subtype p) :=
+  (Subtype.relEmbedding (· < ·) p).isWellFounded
+#align subtype.well_founded_lt Subtype.wellFoundedLT
+
+instance Subtype.wellFoundedGT [LT α] [WellFoundedGT α] (p : α → Prop) :
+    WellFoundedGT (Subtype p) :=
+  (Subtype.relEmbedding (· > ·) p).isWellFounded
+#align subtype.well_founded_gt Subtype.wellFoundedGT
+
 /-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
 @[simps]
-def _root_.Quotient.mkRelHom [Setoid α] {r : α → α → Prop}
+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 :=
   ⟨@Quotient.mk' α _, id⟩
 #align quotient.mk_rel_hom Quotient.mkRelHom
 
 /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
 @[simps!]
-noncomputable def _root_.Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
+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 :=
   ⟨Embedding.quotientOut α, by
     refine' @fun x y => Quotient.inductionOn₂ x y fun a b => _
@@ -412,14 +427,14 @@ noncomputable def _root_.Quotient.outRelEmbedding [Setoid α] {r : α → α →
 
 /-- `Quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
-noncomputable def _root_.Quotient.out'RelEmbedding {_ : Setoid α} {r : α → α → Prop}
+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 :=
   { Quotient.outRelEmbedding _ with toFun := Quotient.out' }
 #align rel_embedding.quotient.out'_rel_embedding Quotient.out'RelEmbedding
 
 @[simp]
-theorem _root_.acc_lift₂_iff [Setoid α] {r : α → α → Prop}
+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 := by
   constructor
@@ -433,17 +448,16 @@ theorem _root_.acc_lift₂_iff [Setoid α] {r : α → α → Prop}
 #align acc_lift₂_iff acc_lift₂_iff
 
 @[simp]
-theorem _root_.acc_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} {a} :
+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 :=
   acc_lift₂_iff
 #align acc_lift_on₂'_iff acc_liftOn₂'_iff
 
 /-- A relation is well founded iff its lift to a quotient is. -/
 @[simp]
-theorem _root_.wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop}
+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 :=
-  by
+    WellFounded (Quotient.lift₂ r H) ↔ WellFounded r := by
   constructor
   · exact RelHomClass.wellFounded (Quotient.mkRelHom H)
   · refine' fun wf => ⟨fun q => _⟩
@@ -451,22 +465,22 @@ theorem _root_.wellFounded_lift₂_iff [Setoid α] {r : α → α → Prop}
     exact acc_lift₂_iff.2 (wf.apply a)
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 
-alias _root_.wellFounded_lift₂_iff ↔
-  _root_.WellFounded.of_quotient_lift₂ _root_.WellFounded.quotient_lift₂
+alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.quotient_lift₂
 #align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
 #align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
 
 @[simp]
-theorem _root_.wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
+theorem wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
     (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r :=
   wellFounded_lift₂_iff
 #align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
 
-alias _root_.wellFounded_liftOn₂'_iff ↔
-  _root_.WellFounded.of_quotient_liftOn₂' _root_.WellFounded.quotient_liftOn₂'
+alias wellFounded_liftOn₂'_iff ↔ WellFounded.of_quotient_liftOn₂' WellFounded.quotient_liftOn₂'
 #align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
 #align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
 
+namespace RelEmbedding
+
 /-- To define an 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`.
 -/
@@ -492,14 +506,10 @@ def ofMonotone [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H : ∀ a b
   refine' ⟨⟨f, fun a b e => _⟩, @fun a b => ⟨fun h => _, H _ _⟩⟩
   · refine' ((@trichotomous _ r _ a b).resolve_left _).resolve_right _ <;>
       exact fun h => @irrefl _ s _ _ (by simpa [e] using H _ _ h)
-
   · refine' (@trichotomous _ r _ a b).resolve_right (Or.rec (fun e => _) fun h' => _)
     · subst e
       exact irrefl _ h
-
     · exact asymm (H _ _ h') h
-
-
 #align rel_embedding.of_monotone RelEmbedding.ofMonotone
 
 @[simp]
@@ -615,8 +625,7 @@ def toRelEmbedding (f : r ≃r s) : r ↪r s :=
 #align rel_iso.to_rel_embedding RelIso.toRelEmbedding
 
 theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
-  | ⟨e₁, o₁⟩, ⟨e₂, _⟩, h => by
-    congr
+  | ⟨e₁, o₁⟩, ⟨e₂, _⟩, h => by congr
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
 
 instance : CoeOut (r ≃r s) (r ↪r s) :=
@@ -716,22 +725,19 @@ protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β →
 
 @[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 :=
+    (h₂ : HEq r s) : (RelIso.cast h₁ h₂).symm = RelIso.cast h₁.symm h₂.symm :=
   rfl
 #align rel_iso.cast_symm RelIso.cast_symm
 
 @[simp]
 protected theorem cast_refl {α : Type u} {r : α → α → Prop} (h₁ : α = α := rfl)
-    (h₂ : HEq r r := HEq.rfl) :
-    RelIso.cast h₁ h₂ = RelIso.refl r :=
+    (h₂ : HEq r r := HEq.rfl) : RelIso.cast h₁ h₂ = RelIso.refl r :=
   rfl
 #align rel_iso.cast_refl RelIso.cast_refl
 
 @[simp]
 protected theorem cast_trans {α β γ : Type u} {r : α → α → Prop} {s : β → β → Prop}
-    {t : γ → γ → Prop} (h₁ : α = β)
-    (h₁' : β = γ) (h₂ : HEq r s) (h₂' : HEq s t) :
+    {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₂') :=
   ext fun x => by subst h₁; rfl
 #align rel_iso.cast_trans RelIso.cast_trans
@@ -756,12 +762,12 @@ theorem symm_apply_apply (e : r ≃r s) (x : α) : e.symm (e x) = x :=
   e.toEquiv.symm_apply_apply x
 #align rel_iso.symm_apply_apply RelIso.symm_apply_apply
 
-theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y :=
-  by rw [← e.map_rel_iff, e.apply_symm_apply]
+theorem rel_symm_apply (e : r ≃r s) {x y} : r x (e.symm y) ↔ s (e x) y := by
+  rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.rel_symm_apply RelIso.rel_symm_apply
 
-theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) :=
-  by rw [← e.map_rel_iff, e.apply_symm_apply]
+theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y) := by
+  rw [← e.map_rel_iff, e.apply_symm_apply]
 #align rel_iso.symm_apply_rel RelIso.symm_apply_rel
 
 protected theorem bijective (e : r ≃r s) : Bijective e :=
feat: port #18526 (#3207)

Mathlib 3: https://github.com/leanprover-community/mathlib/pull/18526/files

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.rel_iso.basic
-! leanprover-community/mathlib commit 76171581280d5b5d1e2d1f4f37e5420357bdc636
+! leanprover-community/mathlib commit 3353f661228bd27f632c600cd1a58b874d847c90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -393,9 +393,16 @@ protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrd
   | f, H => { f.isStrictTotalOrder with wf := f.wellFounded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
+/-- `quotient.mk` as a relation homomorphism between the relation and the lift of a relation. -/
+@[simps]
+def _root_.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 :=
+  ⟨@Quotient.mk' α _, id⟩
+#align quotient.mk_rel_hom Quotient.mkRelHom
+
 /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
 @[simps!]
-noncomputable def _root_.Quotient.outRelEmbedding [s : Setoid α] {r : α → α → Prop}
+noncomputable def _root_.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 :=
   ⟨Embedding.quotientOut α, by
     refine' @fun x y => Quotient.inductionOn₂ x y fun a b => _
@@ -403,22 +410,62 @@ noncomputable def _root_.Quotient.outRelEmbedding [s : Setoid α] {r : α → α
 #align quotient.out_rel_embedding Quotient.outRelEmbedding
 #align quotient.out_rel_embedding_apply Quotient.outRelEmbedding_apply
 
+/-- `Quotient.out'` as a relation embedding between the lift of a relation and the relation. -/
+@[simps]
+noncomputable def _root_.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 :=
+  { Quotient.outRelEmbedding _ with toFun := Quotient.out' }
+#align rel_embedding.quotient.out'_rel_embedding Quotient.out'RelEmbedding
+
+@[simp]
+theorem _root_.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 := by
+  constructor
+  · exact RelHomClass.acc (Quotient.mkRelHom H) a
+  · intro ac
+    induction' ac with _ _ IH
+    dsimp at IH
+    refine' ⟨_, fun q h => _⟩
+    obtain ⟨a', rfl⟩ := q.exists_rep
+    exact IH a' h
+#align acc_lift₂_iff acc_lift₂_iff
+
+@[simp]
+theorem _root_.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 :=
+  acc_lift₂_iff
+#align acc_lift_on₂'_iff acc_liftOn₂'_iff
+
 /-- A relation is well founded iff its lift to a quotient is. -/
 @[simp]
-theorem _root_.wellFounded_lift₂_iff [s : Setoid α] {r : α → α → Prop}
+theorem _root_.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 :=
-  ⟨fun hr => by
-    suffices ∀ {x : Quotient s} {a : α}, ⟦a⟧ = x → Acc r a by exact ⟨fun a => this rfl⟩
-    · refine' @fun x => @WellFounded.induction _ _ hr
-         (fun y => ∀ (a : α), Quotient.mk s a = y → Acc r a) x _
-      rintro x IH a rfl
-      exact ⟨_, @fun b hb => IH ⟦b⟧ hb _ rfl⟩
-      ,
-    (Quotient.outRelEmbedding H).wellFounded⟩
+  by
+  constructor
+  · exact RelHomClass.wellFounded (Quotient.mkRelHom H)
+  · refine' fun wf => ⟨fun q => _⟩
+    obtain ⟨a, rfl⟩ := q.exists_rep
+    exact acc_lift₂_iff.2 (wf.apply a)
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 
-alias wellFounded_lift₂_iff ↔ _root_.WellFounded.of_quotient_lift₂ _root_.WellFounded.quotient_lift₂
+alias _root_.wellFounded_lift₂_iff ↔
+  _root_.WellFounded.of_quotient_lift₂ _root_.WellFounded.quotient_lift₂
+#align well_founded.of_quotient_lift₂ WellFounded.of_quotient_lift₂
+#align well_founded.quotient_lift₂ WellFounded.quotient_lift₂
+
+@[simp]
+theorem _root_.wellFounded_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} :
+    (WellFounded fun x y : Quotient s => Quotient.liftOn₂' x y r H) ↔ WellFounded r :=
+  wellFounded_lift₂_iff
+#align well_founded_lift_on₂'_iff wellFounded_liftOn₂'_iff
+
+alias _root_.wellFounded_liftOn₂'_iff ↔
+  _root_.WellFounded.of_quotient_liftOn₂' _root_.WellFounded.quotient_liftOn₂'
+#align well_founded.of_quotient_lift_on₂' WellFounded.of_quotient_liftOn₂'
+#align well_founded.quotient_lift_on₂' WellFounded.quotient_liftOn₂'
 
 /-- To define an 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`.
feat: port changes to order/game_add (#2532)

Simultaneously ports various PRs on this file.

This also fixes a mis-ported alias in Mathlib/Order/RelIso/Basic.lean

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Diff
@@ -418,7 +418,7 @@ theorem _root_.wellFounded_lift₂_iff [s : Setoid α] {r : α → α → Prop}
     (Quotient.outRelEmbedding H).wellFounded⟩
 #align well_founded_lift₂_iff wellFounded_lift₂_iff
 
-alias wellFounded_lift₂_iff ↔ WellFounded.of_quotient_lift₂ WellFounded.quotient_lift₂
+alias wellFounded_lift₂_iff ↔ _root_.WellFounded.of_quotient_lift₂ _root_.WellFounded.quotient_lift₂
 
 /-- To define an 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`.
feat: initialize_simps_projections automatically finds coercions (#2045)
  • initialize_simps_projections automatically find coercions if there is a Funlike or SetLike instance defined by one of the projections.
  • Some improvements compared to Lean 3:
    • Find coercions even if it is defined by a field of a parent structure
    • Find SetLike coercions

Not yet implemented (and rarely - if ever - used in mathlib3):

  • Automatic custom projections for algebraic notation (like +,*,...)

Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -111,9 +111,6 @@ instance : RelHomClass (r →r s) r s where
     congr
   map_rel := map_rel'
 
-/-- See Note [custom simps projection] -/
-def Simps.apply (f : r →r s) : α → β := f
-
 initialize_simps_projections RelHom (toFun → apply)
 
 protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b) :=
@@ -249,11 +246,12 @@ instance : RelHomClass (r ↪r s) r s where
     congr
   map_rel f a b := Iff.mpr (map_rel_iff' f)
 
-/-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
-because it is a composition of multiple projections. -/
+
+/-- See Note [custom simps projection]. We specify this explicitly because we have a coercion not
+given by the `FunLike` instance. Todo: remove that instance?
+-/
 def Simps.apply (h : r ↪r s) : α → β :=
   h
-#align rel_embedding.simps.apply RelEmbedding.Simps.apply
 
 initialize_simps_projections RelEmbedding (toFun → apply)
 
@@ -623,7 +621,7 @@ protected def symm (f : r ≃r s) : s ≃r r :=
 #align rel_iso.symm RelIso.symm
 
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
-  because it is a composition of multiple projections. -/
+  because `RelIso` defines custom coercions other than the ones given by `FunLike`. -/
 def Simps.apply (h : r ≃r s) : α → β :=
   h
 #align rel_iso.simps.apply RelIso.Simps.apply
fix: replace symmApply by symm_apply (#2560)
Diff
@@ -629,11 +629,11 @@ def Simps.apply (h : r ≃r s) : α → β :=
 #align rel_iso.simps.apply RelIso.Simps.apply
 
 /-- See Note [custom simps projection]. -/
-def Simps.symmApply (h : r ≃r s) : β → α :=
+def Simps.symm_apply (h : r ≃r s) : β → α :=
   h.symm
-#align rel_iso.simps.symm_apply RelIso.Simps.symmApply
+#align rel_iso.simps.symm_apply RelIso.Simps.symm_apply
 
-initialize_simps_projections RelIso (toFun → apply, invFun → symmApply)
+initialize_simps_projections RelIso (toFun → apply, invFun → symm_apply)
 
 /-- Identity map is a relation isomorphism. -/
 @[refl, simps! apply]
feat: simps uses fields of parent structures (#2042)
  • initialize_simps_projections now by default generates all projections of all parent structures, and doesn't generate the projections to those parent structures.
  • You can also rename a nested projection directly, without having to specify intermediate parent structures
  • Added the option to turn the default behavior off (done in e.g. TwoPointed)

Internal changes:

  • Move most declarations to the Simps namespace, and shorten their names
  • Restructure ParsedProjectionData to avoid the bug reported here (and to another bug where it seemed that the wrong data was inserted in ParsedProjectionData, but it was hard to minimize because of all the crashes). If we manage to fix the bug in that Zulip thread, I'll see if I can track down the other bug in commit 97454284

Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -255,7 +255,7 @@ def Simps.apply (h : r ↪r s) : α → β :=
   h
 #align rel_embedding.simps.apply RelEmbedding.Simps.apply
 
-initialize_simps_projections RelEmbedding (toEmbedding_toFun → apply, -toEmbedding)
+initialize_simps_projections RelEmbedding (toFun → apply)
 
 theorem injective (f : r ↪r s) : Injective f :=
   f.inj'
@@ -633,7 +633,7 @@ def Simps.symmApply (h : r ≃r s) : β → α :=
   h.symm
 #align rel_iso.simps.symm_apply RelIso.Simps.symmApply
 
-initialize_simps_projections RelIso (toEquiv_toFun → apply, toEquiv_invFun → symmApply, -toEquiv)
+initialize_simps_projections RelIso (toFun → apply, invFun → symmApply)
 
 /-- Identity map is a relation isomorphism. -/
 @[refl, simps! apply]
feat: require @[simps!] if simps runs in expensive mode (#1885)
  • This does not change the behavior of simps, just raises a linter error if you run simps in a more expensive mode without writing !.
  • Fixed some incorrect occurrences of to_additive, simps. Will do that systematically in future PR.
  • Fix port of OmegaCompletePartialOrder.ContinuousHom.ofMono a bit

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -287,7 +287,7 @@ theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
 #align rel_embedding.ext_iff RelEmbedding.ext_iff
 
 /-- Identity map is a relation embedding. -/
-@[refl, simps]
+@[refl, simps!]
 protected def refl (r : α → α → Prop) : r ↪r r :=
   ⟨Embedding.refl _, Iff.rfl⟩
 #align rel_embedding.refl RelEmbedding.refl
@@ -396,7 +396,7 @@ protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrd
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
 /-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
-@[simps]
+@[simps!]
 noncomputable def _root_.Quotient.outRelEmbedding [s : Setoid α] {r : α → α → Prop}
     (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r :=
   ⟨Embedding.quotientOut α, by
@@ -636,14 +636,14 @@ def Simps.symmApply (h : r ≃r s) : β → α :=
 initialize_simps_projections RelIso (toEquiv_toFun → apply, toEquiv_invFun → symmApply, -toEquiv)
 
 /-- Identity map is a relation isomorphism. -/
-@[refl, simps apply]
+@[refl, simps! apply]
 protected def refl (r : α → α → Prop) : r ≃r r :=
   ⟨Equiv.refl _, Iff.rfl⟩
 #align rel_iso.refl RelIso.refl
 #align rel_iso.refl_apply RelIso.refl_apply
 
 /-- Composition of two relation isomorphisms is a relation isomorphism. -/
-@[simps apply]
+@[simps! apply]
 protected def trans (f₁ : r ≃r s) (f₂ : s ≃r t) : r ≃r t :=
   ⟨f₁.toEquiv.trans f₂.toEquiv, f₂.map_rel_iff.trans f₁.map_rel_iff⟩
 #align rel_iso.trans RelIso.trans
@@ -658,7 +658,7 @@ theorem default_def (r : α → α → Prop) : default = RelIso.refl r :=
 #align rel_iso.default_def RelIso.default_def
 
 /-- A relation isomorphism between equal relations on equal types. -/
-@[simps toEquiv apply]
+@[simps! toEquiv apply]
 protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
     (h₂ : HEq r s) : r ≃r s :=
   ⟨Equiv.cast h₁, @fun a b => by
@@ -751,7 +751,7 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 #align rel_iso.is_well_order.ulift RelIso.IsWellOrder.ulift
 
 /-- A surjective relation embedding is a relation isomorphism. -/
-@[simps apply]
+@[simps! apply]
 noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s :=
   ⟨Equiv.ofBijective f ⟨f.injective, H⟩, f.map_rel_iff⟩
 #align rel_iso.of_surjective RelIso.ofSurjective
feat: port Algebra.BigOperators.Fin (#1848)

Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>

Diff
@@ -269,6 +269,9 @@ theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b :=
   f.map_rel_iff'
 #align rel_embedding.map_rel_iff RelEmbedding.map_rel_iff
 
+#noalign coe_fn_mk
+#noalign coe_fn_to_embedding
+
 /-- The map `coe_fn : (r ↪r s) → (α → β)` is injective. -/
 theorem coe_fn_injective : Injective fun f : r ↪r s => (f : α → β) :=
   FunLike.coe_injective
chore: add missing #align statements (#1902)

This PR is the result of a slight variant on the following "algorithm"

  • take all mathlib 3 names, remove _ and make all uppercase letters into lowercase
  • take all mathlib 4 names, remove _ and make all uppercase letters into lowercase
  • look for matches, and create pairs (original_lean3_name, OriginalLean4Name)
  • for pairs that do not have an align statement:
    • use Lean 4 to lookup the file + position of the Lean 4 name
    • add an #align statement just before the next empty line
  • manually fix some tiny mistakes (e.g., empty lines in proofs might cause the #align statement to have been inserted too early)
Diff
@@ -144,12 +144,14 @@ theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x :=
 protected def id (r : α → α → Prop) : r →r r :=
   ⟨fun x => x, fun x => x⟩
 #align rel_hom.id RelHom.id
+#align rel_hom.id_apply RelHom.id_apply
 
 /-- Composition of two relation homomorphisms is a relation homomorphism. -/
 @[simps]
 protected def comp (g : s →r t) (f : r →r s) : r →r t :=
   ⟨fun x => g (f x), fun h => g.2 (f.2 h)⟩
 #align rel_hom.comp RelHom.comp
+#align rel_hom.comp_apply RelHom.comp_apply
 
 /-- A relation homomorphism is also a relation homomorphism between dual relations. -/
 protected def swap (f : r →r s) : swap r →r swap s :=
@@ -286,6 +288,7 @@ theorem ext_iff {f g : r ↪r s} : f = g ↔ ∀ x, f x = g x :=
 protected def refl (r : α → α → Prop) : r ↪r r :=
   ⟨Embedding.refl _, Iff.rfl⟩
 #align rel_embedding.refl RelEmbedding.refl
+#align rel_embedding.refl_apply RelEmbedding.refl_apply
 
 /-- Composition of two relation embeddings is a relation embedding. -/
 protected def trans (f : r ↪r s) (g : s ↪r t) : r ↪r t :=
@@ -397,6 +400,7 @@ noncomputable def _root_.Quotient.outRelEmbedding [s : Setoid α] {r : α → α
     refine' @fun x y => Quotient.inductionOn₂ x y fun a b => _
     apply iff_iff_eq.2 (H _ _ _ _ _ _) <;> apply Quotient.mk_out⟩
 #align quotient.out_rel_embedding Quotient.outRelEmbedding
+#align quotient.out_rel_embedding_apply Quotient.outRelEmbedding_apply
 
 /-- A relation is well founded iff its lift to a quotient is. -/
 @[simp]
@@ -468,6 +472,7 @@ def sumLiftRelInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum
   inj' := Sum.inl_injective
   map_rel_iff' := Sum.liftRel_inl_inl
 #align rel_embedding.sum_lift_rel_inl RelEmbedding.sumLiftRelInl
+#align rel_embedding.sum_lift_rel_inl_apply RelEmbedding.sumLiftRelInl_apply
 
 /-- `Sum.inr` as a relation embedding into `Sum.LiftRel r s`. -/
 @[simps]
@@ -476,6 +481,7 @@ def sumLiftRelInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum
   inj' := Sum.inr_injective
   map_rel_iff' := Sum.liftRel_inr_inr
 #align rel_embedding.sum_lift_rel_inr RelEmbedding.sumLiftRelInr
+#align rel_embedding.sum_lift_rel_inr_apply RelEmbedding.sumLiftRelInr_apply
 
 /-- `Sum.map` as a relation embedding between `Sum.LiftRel` relations. -/
 @[simps]
@@ -484,6 +490,7 @@ def sumLiftRelMap (f : r ↪r s) (g : t ↪r u) : Sum.LiftRel r t ↪r Sum.LiftR
   inj' := f.injective.sum_map g.injective
   map_rel_iff' := by rintro (a | b) (c | d) <;> simp [f.map_rel_iff, g.map_rel_iff]
 #align rel_embedding.sum_lift_rel_map RelEmbedding.sumLiftRelMap
+#align rel_embedding.sum_lift_rel_map_apply RelEmbedding.sumLiftRelMap_apply
 
 /-- `Sum.inl` as a relation embedding into `Sum.Lex r s`. -/
 @[simps]
@@ -492,6 +499,7 @@ def sumLexInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.Lex
   inj' := Sum.inl_injective
   map_rel_iff' := Sum.lex_inl_inl
 #align rel_embedding.sum_lex_inl RelEmbedding.sumLexInl
+#align rel_embedding.sum_lex_inl_apply RelEmbedding.sumLexInl_apply
 
 /-- `Sum.inr` as a relation embedding into `Sum.Lex r s`. -/
 @[simps]
@@ -500,6 +508,7 @@ def sumLexInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.Lex
   inj' := Sum.inr_injective
   map_rel_iff' := Sum.lex_inr_inr
 #align rel_embedding.sum_lex_inr RelEmbedding.sumLexInr
+#align rel_embedding.sum_lex_inr_apply RelEmbedding.sumLexInr_apply
 
 /-- `Sum.map` as a relation embedding between `Sum.Lex` relations. -/
 @[simps]
@@ -508,6 +517,7 @@ def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u where
   inj' := f.injective.sum_map g.injective
   map_rel_iff' := by rintro (a | b) (c | d) <;> simp [f.map_rel_iff, g.map_rel_iff]
 #align rel_embedding.sum_lex_map RelEmbedding.sumLexMap
+#align rel_embedding.sum_lex_map_apply RelEmbedding.sumLexMap_apply
 
 /-- `λ b, Prod.mk a b` as a relation embedding. -/
 @[simps]
@@ -516,6 +526,7 @@ def prodLexMkLeft (s : β → β → Prop) {a : α} (h : ¬r a a) : s ↪r Prod.
   inj' := Prod.mk.inj_left a
   map_rel_iff' := by simp [Prod.lex_def, h]
 #align rel_embedding.prod_lex_mk_left RelEmbedding.prodLexMkLeft
+#align rel_embedding.prod_lex_mk_left_apply RelEmbedding.prodLexMkLeft_apply
 
 /-- `λ a, Prod.mk a b` as a relation embedding. -/
 @[simps]
@@ -524,6 +535,7 @@ def prodLexMkRight (r : α → α → Prop) {b : β} (h : ¬s b b) : r ↪r Prod
   inj' := Prod.mk.inj_right b
   map_rel_iff' := by simp [Prod.lex_def, h]
 #align rel_embedding.prod_lex_mk_right RelEmbedding.prodLexMkRight
+#align rel_embedding.prod_lex_mk_right_apply RelEmbedding.prodLexMkRight_apply
 
 /-- `Prod.map` as a relation embedding. -/
 @[simps]
@@ -532,6 +544,7 @@ def prodLexMap (f : r ↪r s) (g : t ↪r u) : Prod.Lex r t ↪r Prod.Lex s u wh
   inj' := f.injective.Prod_map g.injective
   map_rel_iff' := by simp [Prod.lex_def, f.map_rel_iff, g.map_rel_iff]
 #align rel_embedding.prod_lex_map RelEmbedding.prodLexMap
+#align rel_embedding.prod_lex_map_apply RelEmbedding.prodLexMap_apply
 
 end RelEmbedding
 
@@ -624,12 +637,14 @@ initialize_simps_projections RelIso (toEquiv_toFun → apply, toEquiv_invFun →
 protected def refl (r : α → α → Prop) : r ≃r r :=
   ⟨Equiv.refl _, Iff.rfl⟩
 #align rel_iso.refl RelIso.refl
+#align rel_iso.refl_apply RelIso.refl_apply
 
 /-- 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 :=
   ⟨f₁.toEquiv.trans f₂.toEquiv, f₂.map_rel_iff.trans f₁.map_rel_iff⟩
 #align rel_iso.trans RelIso.trans
+#align rel_iso.trans_apply RelIso.trans_apply
 
 instance (r : α → α → Prop) : Inhabited (r ≃r r) :=
   ⟨RelIso.refl _⟩
@@ -648,6 +663,8 @@ protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β →
     rw [eq_of_heq h₂]
     rfl⟩
 #align rel_iso.cast RelIso.cast
+#align rel_iso.cast_apply RelIso.cast_apply
+#align rel_iso.cast_to_equiv RelIso.cast_toEquiv
 
 @[simp]
 protected theorem cast_symm {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
@@ -735,6 +752,7 @@ instance IsWellOrder.ulift {α : Type u} (r : α → α → Prop) [IsWellOrder 
 noncomputable def ofSurjective (f : r ↪r s) (H : Surjective f) : r ≃r s :=
   ⟨Equiv.ofBijective f ⟨f.injective, H⟩, f.map_rel_iff⟩
 #align rel_iso.of_surjective RelIso.ofSurjective
+#align rel_iso.of_surjective_apply RelIso.ofSurjective_apply
 
 /-- Given relation isomorphisms `r₁ ≃r s₁` and `r₂ ≃r s₂`, construct a relation isomorphism for the
 lexicographic orders on the sum.
chore: fix casing per naming scheme (#1183)

Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2, add_monoid_hom --> AddMonoidHom

Remove \n from to_additive docstrings that were inserted by mathport.

Move files and directories with Gcd and Smul to GCD and SMul

Diff
@@ -389,7 +389,7 @@ protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrd
   | f, H => { f.isStrictTotalOrder with wf := f.wellFounded H.wf }
 #align rel_embedding.is_well_order RelEmbedding.isWellOrder
 
-/-- `quotient.out` as a relation embedding between the lift of a relation and the relation. -/
+/-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
 @[simps]
 noncomputable def _root_.Quotient.outRelEmbedding [s : Setoid α] {r : α → α → Prop}
     (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r :=
chore: bump to 2022-12-22 (#1157)
Diff
@@ -558,7 +558,7 @@ theorem toEquiv_injective : Injective (toEquiv : r ≃r s → α ≃ β)
     congr
 #align rel_iso.to_equiv_injective RelIso.toEquiv_injective
 
-instance : Coe (r ≃r s) (r ↪r s) :=
+instance : CoeOut (r ≃r s) (r ↪r s) :=
   ⟨toRelEmbedding⟩
 
 -- see Note [function coercion]
chore: add source headers to ported theory files (#1094)

The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2017 Mario Carneiro. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Mario Carneiro
+
+! This file was ported from Lean 3 source module order.rel_iso.basic
+! leanprover-community/mathlib commit 76171581280d5b5d1e2d1f4f37e5420357bdc636
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Data.FunLike.Basic
 import Mathlib.Logic.Embedding.Basic

Dependencies 22

23 files ported (100.0%)
11232 lines ported (100.0%)

All dependencies are ported!