order.order_iso_natMathlib.Order.OrderIsoNat

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

refactor(order/well_founded): ditch well_founded_iff_has_min' and well_founded_iff_has_max' (#15071)

The predicate x ≤ y → y = x is no more convenient than ¬ x < y. For this reason, we ditch well_founded.well_founded_iff_has_min' and well_founded.well_founded_iff_has_max' in favor of well_founded.well_founded_iff_has_min (or in some cases, just well_founded.has_min. We also remove the misplaced lemma well_founded.eq_iff_not_lt_of_le, and we golf the theorems that used the removed theorems.

The lemma well_founded.well_founded_iff_has_min has a misleading name when applied on well_founded (>), and mildly screws over dot notation and rewriting by virtue of using >, but a future refactor will fix this.

Diff
@@ -226,17 +226,9 @@ a (monotonic_sequence_limit_index a)
 lemma well_founded.supr_eq_monotonic_sequence_limit [complete_lattice α]
   (h : well_founded ((>) : α → α → Prop)) (a : ℕ →o α) : supr a = monotonic_sequence_limit a :=
 begin
-  suffices : (⨆ (m : ℕ), a m) ≤ monotonic_sequence_limit a,
-  { exact le_antisymm this (le_supr a _), },
-  apply supr_le,
-  intros m,
-  by_cases hm : m ≤ monotonic_sequence_limit_index a,
-  { exact a.monotone hm, },
-  { replace hm := le_of_not_le hm,
-    let S := { n | ∀ m, n ≤ m → a n = a m },
-    have hInf : Inf S ∈ S,
-    { refine nat.Inf_mem _, rw well_founded.monotone_chain_condition at h, exact h a, },
-    change Inf S ≤ m at hm,
-    change a m ≤ a (Inf S),
-    rw hInf m hm, },
+  apply (supr_le (λ m, _)).antisymm (le_supr a _),
+  cases le_or_lt m (monotonic_sequence_limit_index a) with hm hm,
+  { exact a.monotone hm },
+  { cases well_founded.monotone_chain_condition'.1 h a with n hn,
+    exact (nat.Inf_mem ⟨n, λ k hk, (a.mono hk).eq_of_not_lt (hn k hk)⟩ m hm.le).ge }
 end

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

fix(*): add missing classical tactics and decidable arguments (#18277)

As discussed in this Zulip thread, the classical tactic is buggy in Mathlib3, and "leaks" into subsequent declarations.

This doesn't port well, as the bug is fixed in lean 4.

This PR installs a temporary hack to contain these leaks, fixes all of the correponding breakages, then reverts the hack.

The result is that the new classical tactics in the diff are not needed in Lean 3, but will be needed in Lean 4.

In a future PR, I will try committing the hack itself; but in the meantime, these files are very close to (if not beyond) the port, so the sooner they are fixed the better.

Diff
@@ -107,17 +107,21 @@ by { classical, exact rel_iso.of_surjective (rel_embedding.order_embedding_of_lt
 variable {s}
 
 @[simp]
-lemma coe_order_embedding_of_set : ⇑(order_embedding_of_set s) = coe ∘ subtype.of_nat s := rfl
+lemma coe_order_embedding_of_set [decidable_pred (∈ s)] :
+  ⇑(order_embedding_of_set s) = coe ∘ subtype.of_nat s := rfl
 
-lemma order_embedding_of_set_apply {n : ℕ} : order_embedding_of_set s n = subtype.of_nat s n := rfl
+lemma order_embedding_of_set_apply [decidable_pred (∈ s)] {n : ℕ} :
+  order_embedding_of_set s n = subtype.of_nat s n := rfl
 
 @[simp]
-lemma subtype.order_iso_of_nat_apply {n : ℕ} : subtype.order_iso_of_nat s n = subtype.of_nat s n :=
-by simp [subtype.order_iso_of_nat]
+lemma subtype.order_iso_of_nat_apply [decidable_pred (∈ s)] {n : ℕ} :
+  subtype.order_iso_of_nat s n = subtype.of_nat s n :=
+by { simp [subtype.order_iso_of_nat], congr }
 
 variable (s)
 
-lemma order_embedding_of_set_range : set.range (nat.order_embedding_of_set s) = s :=
+lemma order_embedding_of_set_range [decidable_pred (∈ s)] :
+  set.range (nat.order_embedding_of_set s) = s :=
 subtype.coe_comp_of_nat_range
 
 theorem exists_subseq_of_forall_mem_union {s t : set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -208,9 +208,9 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
   · haveI := hbad
     refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
     have h := Set.mem_range_self m
-    rw [Nat.orderEmbeddingOfSet_range bad] at h 
+    rw [Nat.orderEmbeddingOfSet_range bad] at h
     exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
-  · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
+  · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad
     obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
       by
       by_cases he : hbad.to_finset.nonempty
@@ -224,7 +224,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       by
       intro n
       have h := hm _ (le_add_of_nonneg_left n.zero_le)
-      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, Classical.not_forall] at h 
+      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, Classical.not_forall] at h
       obtain ⟨n', hn1, hn2⟩ := h
       obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
       refine' ⟨n + x, add_lt_add_left hpos n, _⟩
Diff
@@ -140,7 +140,12 @@ def orderEmbeddingOfSet [DecidablePred (· ∈ s)] : ℕ ↪o ℕ :=
 #print Nat.Subtype.orderIsoOfNat /-
 /-- `nat.subtype.of_nat` as an order isomorphism between `ℕ` and an infinite subset. See also
 `nat.nth` for a version where the subset may be finite. -/
-noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by classical
+noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
+  classical exact
+    RelIso.ofSurjective
+      (RelEmbedding.orderEmbeddingOfLTEmbedding
+        (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
+      Nat.Subtype.ofNat_surjective
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 -/
 
@@ -179,7 +184,14 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 
 #print Nat.exists_subseq_of_forall_mem_union /-
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
-    ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by classical
+    ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
+  classical
+  have : Infinite (e ⁻¹' s) ∨ Infinite (e ⁻¹' t) := by
+    simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
+      Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
+  cases this
+  exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
+    ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
 -/
 
@@ -189,7 +201,40 @@ end Nat
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
       (∀ n : ℕ, r (f (g n)) (f (g (n + 1)))) ∨ ∀ m n : ℕ, m < n → ¬r (f (g m)) (f (g n)) :=
-  by classical
+  by
+  classical
+  let bad : Set ℕ := {m | ∀ n, m < n → ¬r (f m) (f n)}
+  by_cases hbad : Infinite bad
+  · haveI := hbad
+    refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
+    have h := Set.mem_range_self m
+    rw [Nat.orderEmbeddingOfSet_range bad] at h 
+    exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
+  · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
+    obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
+      by
+      by_cases he : hbad.to_finset.nonempty
+      ·
+        refine'
+          ⟨(hbad.to_finset.max' he).succ, fun n hn nbad =>
+            Nat.not_succ_le_self _
+              (hn.trans (hbad.to_finset.le_max' n (hbad.mem_to_finset.2 nbad)))⟩
+      · exact ⟨0, fun n hn nbad => he ⟨n, hbad.mem_to_finset.2 nbad⟩⟩
+    have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) :=
+      by
+      intro n
+      have h := hm _ (le_add_of_nonneg_left n.zero_le)
+      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, Classical.not_forall] at h 
+      obtain ⟨n', hn1, hn2⟩ := h
+      obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
+      refine' ⟨n + x, add_lt_add_left hpos n, _⟩
+      rw [add_assoc, add_comm x m, ← add_assoc]
+      exact hn2
+    let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
+    exact
+      ⟨(RelEmbedding.natLT (fun n => g' n + m) fun n =>
+            Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
+        Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
 -/
 
Diff
@@ -140,12 +140,7 @@ def orderEmbeddingOfSet [DecidablePred (· ∈ s)] : ℕ ↪o ℕ :=
 #print Nat.Subtype.orderIsoOfNat /-
 /-- `nat.subtype.of_nat` as an order isomorphism between `ℕ` and an infinite subset. See also
 `nat.nth` for a version where the subset may be finite. -/
-noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
-  classical exact
-    RelIso.ofSurjective
-      (RelEmbedding.orderEmbeddingOfLTEmbedding
-        (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
-      Nat.Subtype.ofNat_surjective
+noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by classical
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 -/
 
@@ -184,14 +179,7 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 
 #print Nat.exists_subseq_of_forall_mem_union /-
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
-    ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
-  classical
-  have : Infinite (e ⁻¹' s) ∨ Infinite (e ⁻¹' t) := by
-    simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
-      Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
-  cases this
-  exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
-    ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
+    ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by classical
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
 -/
 
@@ -201,40 +189,7 @@ end Nat
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
       (∀ n : ℕ, r (f (g n)) (f (g (n + 1)))) ∨ ∀ m n : ℕ, m < n → ¬r (f (g m)) (f (g n)) :=
-  by
-  classical
-  let bad : Set ℕ := {m | ∀ n, m < n → ¬r (f m) (f n)}
-  by_cases hbad : Infinite bad
-  · haveI := hbad
-    refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
-    have h := Set.mem_range_self m
-    rw [Nat.orderEmbeddingOfSet_range bad] at h 
-    exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
-  · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
-    obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
-      by
-      by_cases he : hbad.to_finset.nonempty
-      ·
-        refine'
-          ⟨(hbad.to_finset.max' he).succ, fun n hn nbad =>
-            Nat.not_succ_le_self _
-              (hn.trans (hbad.to_finset.le_max' n (hbad.mem_to_finset.2 nbad)))⟩
-      · exact ⟨0, fun n hn nbad => he ⟨n, hbad.mem_to_finset.2 nbad⟩⟩
-    have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) :=
-      by
-      intro n
-      have h := hm _ (le_add_of_nonneg_left n.zero_le)
-      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, Classical.not_forall] at h 
-      obtain ⟨n', hn1, hn2⟩ := h
-      obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
-      refine' ⟨n + x, add_lt_add_left hpos n, _⟩
-      rw [add_assoc, add_comm x m, ← add_assoc]
-      exact hn2
-    let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
-    exact
-      ⟨(RelEmbedding.natLT (fun n => g' n + m) fun n =>
-            Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
-        Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
+  by classical
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
 -/
 
Diff
@@ -224,7 +224,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       by
       intro n
       have h := hm _ (le_add_of_nonneg_left n.zero_le)
-      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, not_forall] at h 
+      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, Classical.not_forall] at h 
       obtain ⟨n', hn1, hn2⟩ := h
       obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
       refine' ⟨n + x, add_lt_add_left hpos n, _⟩
Diff
@@ -3,11 +3,11 @@ 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.Nat.Lattice
-import Mathbin.Logic.Denumerable
-import Mathbin.Logic.Function.Iterate
-import Mathbin.Order.Hom.Basic
-import Mathbin.Tactic.Congrm
+import Data.Nat.Lattice
+import Logic.Denumerable
+import Logic.Function.Iterate
+import Order.Hom.Basic
+import Tactic.Congrm
 
 #align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
 
Diff
@@ -35,33 +35,33 @@ namespace RelEmbedding
 
 variable {r : α → α → Prop} [IsStrictOrder α r]
 
-#print RelEmbedding.natLt /-
+#print RelEmbedding.natLT /-
 /-- If `f` is a strictly `r`-increasing sequence, then this returns `f` as an order embedding. -/
-def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) : ℕ → ℕ → Prop) ↪r r :=
+def natLT (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) : ℕ → ℕ → Prop) ↪r r :=
   ofMonotone f <| Nat.rel_of_forall_rel_succ_of_lt r H
-#align rel_embedding.nat_lt RelEmbedding.natLt
+#align rel_embedding.nat_lt RelEmbedding.natLT
 -/
 
-#print RelEmbedding.coe_natLt /-
+#print RelEmbedding.coe_natLT /-
 @[simp]
-theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
+theorem coe_natLT {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLT f H) = f :=
   rfl
-#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLt
+#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLT
 -/
 
-#print RelEmbedding.natGt /-
+#print RelEmbedding.natGT /-
 /-- If `f` is a strictly `r`-decreasing sequence, then this returns `f` as an order embedding. -/
-def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) : ℕ → ℕ → Prop) ↪r r :=
+def natGT (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) : ℕ → ℕ → Prop) ↪r r :=
   haveI := IsStrictOrder.swap r
   RelEmbedding.swap (nat_lt f H)
-#align rel_embedding.nat_gt RelEmbedding.natGt
+#align rel_embedding.nat_gt RelEmbedding.natGT
 -/
 
-#print RelEmbedding.coe_natGt /-
+#print RelEmbedding.coe_natGT /-
 @[simp]
-theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
+theorem coe_natGT {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGT f H) = f :=
   rfl
-#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGt
+#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGT
 -/
 
 #print RelEmbedding.exists_not_acc_lt_of_not_acc /-
@@ -132,7 +132,7 @@ variable (s : Set ℕ) [Infinite s]
 /-- An order embedding from `ℕ` to itself with a specified range -/
 def orderEmbeddingOfSet [DecidablePred (· ∈ s)] : ℕ ↪o ℕ :=
   (RelEmbedding.orderEmbeddingOfLTEmbedding
-        (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _)).trans
+        (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _)).trans
     (OrderEmbedding.subtype s)
 #align nat.order_embedding_of_set Nat.orderEmbeddingOfSet
 -/
@@ -144,7 +144,7 @@ noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
   classical exact
     RelIso.ofSurjective
       (RelEmbedding.orderEmbeddingOfLTEmbedding
-        (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
+        (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
       Nat.Subtype.ofNat_surjective
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 -/
@@ -232,7 +232,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       exact hn2
     let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
     exact
-      ⟨(RelEmbedding.natLt (fun n => g' n + m) fun n =>
+      ⟨(RelEmbedding.natLT (fun n => g' n + m) fun n =>
             Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
         Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
Diff
@@ -2,11 +2,6 @@
 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.order_iso_nat
-! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Nat.Lattice
 import Mathbin.Logic.Denumerable
@@ -14,6 +9,8 @@ import Mathbin.Logic.Function.Iterate
 import Mathbin.Order.Hom.Basic
 import Mathbin.Tactic.Congrm
 
+#align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
+
 /-!
 # Relation embeddings from the naturals
 
Diff
@@ -45,10 +45,12 @@ def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) :
 #align rel_embedding.nat_lt RelEmbedding.natLt
 -/
 
+#print RelEmbedding.coe_natLt /-
 @[simp]
 theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
   rfl
 #align rel_embedding.coe_nat_lt RelEmbedding.coe_natLt
+-/
 
 #print RelEmbedding.natGt /-
 /-- If `f` is a strictly `r`-decreasing sequence, then this returns `f` as an order embedding. -/
@@ -58,10 +60,12 @@ def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) :
 #align rel_embedding.nat_gt RelEmbedding.natGt
 -/
 
+#print RelEmbedding.coe_natGt /-
 @[simp]
 theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
   rfl
 #align rel_embedding.coe_nat_gt RelEmbedding.coe_natGt
+-/
 
 #print RelEmbedding.exists_not_acc_lt_of_not_acc /-
 theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc r b ∧ r b a :=
@@ -73,6 +77,7 @@ theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc
 #align rel_embedding.exists_not_acc_lt_of_not_acc RelEmbedding.exists_not_acc_lt_of_not_acc
 -/
 
+#print RelEmbedding.acc_iff_no_decreasing_seq /-
 /-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
 theorem acc_iff_no_decreasing_seq {x} :
     Acc r x ↔ IsEmpty { f : ((· > ·) : ℕ → ℕ → Prop) ↪r r // x ∈ Set.range f } :=
@@ -93,10 +98,13 @@ theorem acc_iff_no_decreasing_seq {x} :
     rw [Function.iterate_succ']
     apply h
 #align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seq
+-/
 
+#print RelEmbedding.not_acc_of_decreasing_seq /-
 theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) := by
   rw [acc_iff_no_decreasing_seq, not_isEmpty_iff]; exact ⟨⟨f, k, rfl⟩⟩
 #align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seq
+-/
 
 #print RelEmbedding.wellFounded_iff_no_descending_seq /-
 /-- A relation is well-founded iff it doesn't have any infinite decreasing sequence. -/
@@ -146,29 +154,38 @@ noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
 
 variable {s}
 
+#print Nat.coe_orderEmbeddingOfSet /-
 @[simp]
 theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
     ⇑(orderEmbeddingOfSet s) = coe ∘ Subtype.ofNat s :=
   rfl
 #align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSet
+-/
 
+#print Nat.orderEmbeddingOfSet_apply /-
 theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     orderEmbeddingOfSet s n = Subtype.ofNat s n :=
   rfl
 #align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_apply
+-/
 
+#print Nat.Subtype.orderIsoOfNat_apply /-
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by simp [subtype.order_iso_of_nat]; congr
 #align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_apply
+-/
 
 variable (s)
 
+#print Nat.orderEmbeddingOfSet_range /-
 theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
     Set.range (Nat.orderEmbeddingOfSet s) = s :=
   Subtype.coe_comp_ofNat_range
 #align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_range
+-/
 
+#print Nat.exists_subseq_of_forall_mem_union /-
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
   classical
@@ -179,9 +196,11 @@ theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he :
   exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
     ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
+-/
 
 end Nat
 
+#print exists_increasing_or_nonincreasing_subseq' /-
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
       (∀ n : ℕ, r (f (g n)) (f (g (n + 1)))) ∨ ∀ m n : ℕ, m < n → ¬r (f (g m)) (f (g n)) :=
@@ -220,7 +239,9 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
             Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
         Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
+-/
 
+#print exists_increasing_or_nonincreasing_subseq /-
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
     Bolzano-Weierstrass for `ℝ`. -/
 theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTrans α r] (f : ℕ → α) :
@@ -236,6 +257,7 @@ theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTr
       exact ih (lt_of_lt_of_le m.lt_succ_self (Nat.le_add_right _ _))
   · exact ⟨g, Or.intro_right _ hnr⟩
 #align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseq
+-/
 
 #print WellFounded.monotone_chain_condition' /-
 theorem WellFounded.monotone_chain_condition' [Preorder α] :
@@ -283,6 +305,7 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 #align monotonic_sequence_limit monotonicSequenceLimit
 -/
 
+#print WellFounded.iSup_eq_monotonicSequenceLimit /-
 theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : iSup a = monotonicSequenceLimit a :=
   by
@@ -292,4 +315,5 @@ theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
   · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
     exact (Nat.sInf_mem ⟨n, fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)⟩ m hm.le).ge
 #align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimit
+-/
 
Diff
@@ -137,10 +137,10 @@ def orderEmbeddingOfSet [DecidablePred (· ∈ s)] : ℕ ↪o ℕ :=
 `nat.nth` for a version where the subset may be finite. -/
 noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
   classical exact
-      RelIso.ofSurjective
-        (RelEmbedding.orderEmbeddingOfLTEmbedding
-          (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
-        Nat.Subtype.ofNat_surjective
+    RelIso.ofSurjective
+      (RelEmbedding.orderEmbeddingOfLTEmbedding
+        (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
+      Nat.Subtype.ofNat_surjective
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 -/
 
@@ -172,12 +172,12 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
   classical
-    have : Infinite (e ⁻¹' s) ∨ Infinite (e ⁻¹' t) := by
-      simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
-        Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
-    cases this
-    exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
-      ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
+  have : Infinite (e ⁻¹' s) ∨ Infinite (e ⁻¹' t) := by
+    simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
+      Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
+  cases this
+  exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
+    ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
 
 end Nat
@@ -187,38 +187,38 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       (∀ n : ℕ, r (f (g n)) (f (g (n + 1)))) ∨ ∀ m n : ℕ, m < n → ¬r (f (g m)) (f (g n)) :=
   by
   classical
-    let bad : Set ℕ := { m | ∀ n, m < n → ¬r (f m) (f n) }
-    by_cases hbad : Infinite bad
-    · haveI := hbad
-      refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
-      have h := Set.mem_range_self m
-      rw [Nat.orderEmbeddingOfSet_range bad] at h 
-      exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
-    · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
-      obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
-        by
-        by_cases he : hbad.to_finset.nonempty
-        ·
-          refine'
-            ⟨(hbad.to_finset.max' he).succ, fun n hn nbad =>
-              Nat.not_succ_le_self _
-                (hn.trans (hbad.to_finset.le_max' n (hbad.mem_to_finset.2 nbad)))⟩
-        · exact ⟨0, fun n hn nbad => he ⟨n, hbad.mem_to_finset.2 nbad⟩⟩
-      have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) :=
-        by
-        intro n
-        have h := hm _ (le_add_of_nonneg_left n.zero_le)
-        simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, not_forall] at h 
-        obtain ⟨n', hn1, hn2⟩ := h
-        obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
-        refine' ⟨n + x, add_lt_add_left hpos n, _⟩
-        rw [add_assoc, add_comm x m, ← add_assoc]
-        exact hn2
-      let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
-      exact
-        ⟨(RelEmbedding.natLt (fun n => g' n + m) fun n =>
-              Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
-          Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
+  let bad : Set ℕ := {m | ∀ n, m < n → ¬r (f m) (f n)}
+  by_cases hbad : Infinite bad
+  · haveI := hbad
+    refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
+    have h := Set.mem_range_self m
+    rw [Nat.orderEmbeddingOfSet_range bad] at h 
+    exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
+  · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
+    obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
+      by
+      by_cases he : hbad.to_finset.nonempty
+      ·
+        refine'
+          ⟨(hbad.to_finset.max' he).succ, fun n hn nbad =>
+            Nat.not_succ_le_self _
+              (hn.trans (hbad.to_finset.le_max' n (hbad.mem_to_finset.2 nbad)))⟩
+      · exact ⟨0, fun n hn nbad => he ⟨n, hbad.mem_to_finset.2 nbad⟩⟩
+    have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) :=
+      by
+      intro n
+      have h := hm _ (le_add_of_nonneg_left n.zero_le)
+      simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, not_forall] at h 
+      obtain ⟨n', hn1, hn2⟩ := h
+      obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
+      refine' ⟨n + x, add_lt_add_left hpos n, _⟩
+      rw [add_assoc, add_comm x m, ← add_assoc]
+      exact hn2
+    let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
+    exact
+      ⟨(RelEmbedding.natLt (fun n => g' n + m) fun n =>
+            Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
+        Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
 
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
@@ -271,7 +271,7 @@ type, `monotonic_sequence_limit_index a` is the least natural number `n` for whi
 constant value. For sequences that are not eventually constant, `monotonic_sequence_limit_index a`
 is defined, but is a junk value. -/
 noncomputable def monotonicSequenceLimitIndex [Preorder α] (a : ℕ →o α) : ℕ :=
-  sInf { n | ∀ m, n ≤ m → a n = a m }
+  sInf {n | ∀ m, n ≤ m → a n = a m}
 #align monotonic_sequence_limit_index monotonicSequenceLimitIndex
 -/
 
Diff
@@ -176,7 +176,7 @@ theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he :
       simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
         Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
     cases this
-    exacts[⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
+    exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
       ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
 
@@ -192,9 +192,9 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
     · haveI := hbad
       refine' ⟨Nat.orderEmbeddingOfSet bad, Or.intro_right _ fun m n mn => _⟩
       have h := Set.mem_range_self m
-      rw [Nat.orderEmbeddingOfSet_range bad] at h
+      rw [Nat.orderEmbeddingOfSet_range bad] at h 
       exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
-    · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad
+    · rw [Set.infinite_coe_iff, Set.Infinite, Classical.not_not] at hbad 
       obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
         by
         by_cases he : hbad.to_finset.nonempty
@@ -208,7 +208,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
         by
         intro n
         have h := hm _ (le_add_of_nonneg_left n.zero_le)
-        simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, not_forall] at h
+        simp only [exists_prop, Classical.not_not, Set.mem_setOf_eq, not_forall] at h 
         obtain ⟨n', hn1, hn2⟩ := h
         obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
         refine' ⟨n + x, add_lt_add_left hpos n, _⟩
Diff
@@ -237,6 +237,7 @@ theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTr
   · exact ⟨g, Or.intro_right _ hnr⟩
 #align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseq
 
+#print WellFounded.monotone_chain_condition' /-
 theorem WellFounded.monotone_chain_condition' [Preorder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → ¬a n < a m :=
   by
@@ -248,8 +249,10 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
     obtain ⟨n, hn⟩ := h (a.swap : ((· < ·) : ℕ → ℕ → Prop) →r ((· < ·) : α → α → Prop)).toOrderHom
     exact hn n.succ n.lt_succ_self.le ((RelEmbedding.map_rel_iff _).2 n.lt_succ_self)
 #align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]] -/
+#print WellFounded.monotone_chain_condition /-
 /-- The "monotone chain condition" below is sometimes a convenient form of well foundedness. -/
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → a n = a m :=
@@ -260,6 +263,7 @@ theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     rw [lt_iff_le_and_ne]
     simp [a.mono h]
 #align well_founded.monotone_chain_condition WellFounded.monotone_chain_condition
+-/
 
 #print monotonicSequenceLimitIndex /-
 /-- Given an eventually-constant monotone sequence `a₀ ≤ a₁ ≤ a₂ ≤ ...` in a partially-ordered
Diff
@@ -45,12 +45,6 @@ def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) :
 #align rel_embedding.nat_lt RelEmbedding.natLt
 -/
 
-/- warning: rel_embedding.coe_nat_lt -> RelEmbedding.coe_natLt is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r)) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLtₓ'. -/
 @[simp]
 theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
   rfl
@@ -64,12 +58,6 @@ def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) :
 #align rel_embedding.nat_gt RelEmbedding.natGt
 -/
 
-/- warning: rel_embedding.coe_nat_gt -> RelEmbedding.coe_natGt is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f n)}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r)) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
-Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGtₓ'. -/
 @[simp]
 theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
   rfl
@@ -85,12 +73,6 @@ theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc
 #align rel_embedding.exists_not_acc_lt_of_not_acc RelEmbedding.exists_not_acc_lt_of_not_acc
 -/
 
-/- warning: rel_embedding.acc_iff_no_decreasing_seq -> RelEmbedding.acc_iff_no_decreasing_seq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x (Set.range.{u1, 1} α Nat (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f)))))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r)) f)))))
-Case conversion may be inaccurate. Consider using '#align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seqₓ'. -/
 /-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
 theorem acc_iff_no_decreasing_seq {x} :
     Acc r x ↔ IsEmpty { f : ((· > ·) : ℕ → ℕ → Prop) ↪r r // x ∈ Set.range f } :=
@@ -112,12 +94,6 @@ theorem acc_iff_no_decreasing_seq {x} :
     apply h
 #align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seq
 
-/- warning: rel_embedding.not_acc_of_decreasing_seq -> RelEmbedding.not_acc_of_decreasing_seq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (k : Nat), Not (Acc.{succ u1} α r (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f k))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r)) f k))
-Case conversion may be inaccurate. Consider using '#align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seqₓ'. -/
 theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) := by
   rw [acc_iff_no_decreasing_seq, not_isEmpty_iff]; exact ⟨⟨f, k, rfl⟩⟩
 #align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seq
@@ -170,35 +146,17 @@ noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
 
 variable {s}
 
-/- warning: nat.coe_order_embedding_of_set -> Nat.coe_orderEmbeddingOfSet is a dubious translation:
-lean 3 declaration is
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Nat -> Nat) (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
-but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
-Case conversion may be inaccurate. Consider using '#align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSetₓ'. -/
 @[simp]
 theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
     ⇑(orderEmbeddingOfSet s) = coe ∘ Subtype.ofNat s :=
   rfl
 #align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSet
 
-/- warning: nat.order_embedding_of_set_apply -> Nat.orderEmbeddingOfSet_apply is a dubious translation:
-lean 3 declaration is
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
-but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
-Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_applyₓ'. -/
 theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     orderEmbeddingOfSet s n = Subtype.ofNat s n :=
   rfl
 #align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_apply
 
-/- warning: nat.subtype.order_iso_of_nat_apply -> Nat.Subtype.orderIsoOfNat_apply is a dubious translation:
-lean 3 declaration is
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (coeFn.{1, 1} (OrderIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat.hasLe (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))) (fun (_x : RelIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) => Nat -> (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)) (RelIso.hasCoeToFun.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
-but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} (Set.Elem.{0} Nat s) (FunLike.coe.{1, 1, 1} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302)) Nat (fun (_x : Nat) => Set.Elem.{0} Nat s) (RelHomClass.toFunLike.{0, 0, 0} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302)) Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302) (RelIso.instRelHomClassRelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
-Case conversion may be inaccurate. Consider using '#align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_applyₓ'. -/
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by simp [subtype.order_iso_of_nat]; congr
@@ -206,23 +164,11 @@ theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
 
 variable (s)
 
-/- warning: nat.order_embedding_of_set_range -> Nat.orderEmbeddingOfSet_range is a dubious translation:
-lean 3 declaration is
-  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
-but is expected to have type
-  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
-Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_rangeₓ'. -/
 theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
     Set.range (Nat.orderEmbeddingOfSet s) = s :=
   Subtype.coe_comp_ofNat_range
 #align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_range
 
-/- warning: nat.exists_subseq_of_forall_mem_union -> Nat.exists_subseq_of_forall_mem_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) s) (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) t)))
-but is expected to have type
-  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) t)))
-Case conversion may be inaccurate. Consider using '#align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_unionₓ'. -/
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
   classical
@@ -236,12 +182,6 @@ theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he :
 
 end Nat
 
-/- warning: exists_increasing_or_nonincreasing_subseq' -> exists_increasing_or_nonincreasing_subseq' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
-but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n))))))
-Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'ₓ'. -/
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
       (∀ n : ℕ, r (f (g n)) (f (g (n + 1)))) ∨ ∀ m n : ℕ, m < n → ¬r (f (g m)) (f (g n)) :=
@@ -281,12 +221,6 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
           Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
 
-/- warning: exists_increasing_or_nonincreasing_subseq -> exists_increasing_or_nonincreasing_subseq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
-but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n))))))
-Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseqₓ'. -/
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
     Bolzano-Weierstrass for `ℝ`. -/
 theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTrans α r] (f : ℕ → α) :
@@ -303,12 +237,6 @@ theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTr
   · exact ⟨g, Or.intro_right _ hnr⟩
 #align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseq
 
-/- warning: well_founded.monotone_chain_condition' -> WellFounded.monotone_chain_condition' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α], Iff (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α _inst_1))) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat Nat.hasLe n m) -> (Not (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) a n) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) a m)))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α], Iff (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2241 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2243 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α _inst_1) x._@.Mathlib.Order.OrderIsoNat._hyg.2241 x._@.Mathlib.Order.OrderIsoNat._hyg.2243)) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat instLENat n m) -> (Not (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 a n) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 a m)))))
-Case conversion may be inaccurate. Consider using '#align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'ₓ'. -/
 theorem WellFounded.monotone_chain_condition' [Preorder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → ¬a n < a m :=
   by
@@ -321,12 +249,6 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
     exact hn n.succ n.lt_succ_self.le ((RelEmbedding.map_rel_iff _).2 n.lt_succ_self)
 #align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'
 
-/- warning: well_founded.monotone_chain_condition -> WellFounded.monotone_chain_condition is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)))) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat Nat.hasLe n m) -> (Eq.{succ u1} α (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) a n) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) a m))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2465 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2467 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) x._@.Mathlib.Order.OrderIsoNat._hyg.2465 x._@.Mathlib.Order.OrderIsoNat._hyg.2467)) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1)), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat instLENat n m) -> (Eq.{succ u1} α (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1) a n) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1) a m))))
-Case conversion may be inaccurate. Consider using '#align well_founded.monotone_chain_condition WellFounded.monotone_chain_conditionₓ'. -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]] -/
 /-- The "monotone chain condition" below is sometimes a convenient form of well foundedness. -/
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
@@ -357,12 +279,6 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 #align monotonic_sequence_limit monotonicSequenceLimit
 -/
 
-/- warning: well_founded.supr_eq_monotonic_sequence_limit -> WellFounded.iSup_eq_monotonicSequenceLimit is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2645 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2647 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2645 x._@.Mathlib.Order.OrderIsoNat._hyg.2647)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
-Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimitₓ'. -/
 theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : iSup a = monotonicSequenceLimit a :=
   by
Diff
@@ -118,10 +118,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r)) f k))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seqₓ'. -/
-theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) :=
-  by
-  rw [acc_iff_no_decreasing_seq, not_isEmpty_iff]
-  exact ⟨⟨f, k, rfl⟩⟩
+theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) := by
+  rw [acc_iff_no_decreasing_seq, not_isEmpty_iff]; exact ⟨⟨f, k, rfl⟩⟩
 #align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seq
 
 #print RelEmbedding.wellFounded_iff_no_descending_seq /-
@@ -138,10 +136,8 @@ theorem wellFounded_iff_no_descending_seq :
 -/
 
 #print RelEmbedding.not_wellFounded_of_decreasing_seq /-
-theorem not_wellFounded_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) : ¬WellFounded r :=
-  by
-  rw [well_founded_iff_no_descending_seq, not_isEmpty_iff]
-  exact ⟨f⟩
+theorem not_wellFounded_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) : ¬WellFounded r := by
+  rw [well_founded_iff_no_descending_seq, not_isEmpty_iff]; exact ⟨f⟩
 #align rel_embedding.not_well_founded_of_decreasing_seq RelEmbedding.not_wellFounded_of_decreasing_seq
 -/
 
@@ -205,10 +201,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_applyₓ'. -/
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
-    Subtype.orderIsoOfNat s n = Subtype.ofNat s n :=
-  by
-  simp [subtype.order_iso_of_nat]
-  congr
+    Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by simp [subtype.order_iso_of_nat]; congr
 #align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_apply
 
 variable (s)
Diff
@@ -49,7 +49,7 @@ def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r)) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r)) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLtₓ'. -/
 @[simp]
 theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
@@ -68,7 +68,7 @@ def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f n)}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r)) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r)) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGtₓ'. -/
 @[simp]
 theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
@@ -89,7 +89,7 @@ theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x (Set.range.{u1, 1} α Nat (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f)))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r)) f)))))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r)) f)))))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seqₓ'. -/
 /-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
 theorem acc_iff_no_decreasing_seq {x} :
@@ -116,7 +116,7 @@ theorem acc_iff_no_decreasing_seq {x} :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (k : Nat), Not (Acc.{succ u1} α r (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f k))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r)) f k))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r)) f k))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seqₓ'. -/
 theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) :=
   by
@@ -178,7 +178,7 @@ variable {s}
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Nat -> Nat) (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 Case conversion may be inaccurate. Consider using '#align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSetₓ'. -/
 @[simp]
 theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
@@ -190,7 +190,7 @@ theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_applyₓ'. -/
 theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     orderEmbeddingOfSet s n = Subtype.ofNat s n :=
@@ -201,7 +201,7 @@ theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (coeFn.{1, 1} (OrderIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat.hasLe (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))) (fun (_x : RelIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) => Nat -> (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)) (RelIso.hasCoeToFun.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} (Set.Elem.{0} Nat s) (FunLike.coe.{1, 1, 1} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298)) Nat (fun (_x : Nat) => Set.Elem.{0} Nat s) (RelHomClass.toFunLike.{0, 0, 0} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298)) Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298) (RelIso.instRelHomClassRelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} (Set.Elem.{0} Nat s) (FunLike.coe.{1, 1, 1} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302)) Nat (fun (_x : Nat) => Set.Elem.{0} Nat s) (RelHomClass.toFunLike.{0, 0, 0} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302)) Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302) (RelIso.instRelHomClassRelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1285 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1287 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1285 x._@.Mathlib.Order.Hom.Basic._hyg.1287) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1300 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1302 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1300 x._@.Mathlib.Order.Hom.Basic._hyg.1302))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
 Case conversion may be inaccurate. Consider using '#align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_applyₓ'. -/
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
@@ -217,7 +217,7 @@ variable (s)
 lean 3 declaration is
   forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 but is expected to have type
-  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
+  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_rangeₓ'. -/
 theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
     Set.range (Nat.orderEmbeddingOfSet s) = s :=
@@ -228,7 +228,7 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) s) (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) t)))
 but is expected to have type
-  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) t)))
+  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) t)))
 Case conversion may be inaccurate. Consider using '#align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_unionₓ'. -/
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
@@ -247,7 +247,7 @@ end Nat
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'ₓ'. -/
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
@@ -292,7 +292,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.684 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.682 x._@.Mathlib.Order.Hom.Basic._hyg.684) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.699 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.697 x._@.Mathlib.Order.Hom.Basic._hyg.699))))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseqₓ'. -/
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
     Bolzano-Weierstrass for `ℝ`. -/
Diff
@@ -310,7 +310,12 @@ theorem exists_increasing_or_nonincreasing_subseq (r : α → α → Prop) [IsTr
   · exact ⟨g, Or.intro_right _ hnr⟩
 #align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseq
 
-#print WellFounded.monotone_chain_condition' /-
+/- warning: well_founded.monotone_chain_condition' -> WellFounded.monotone_chain_condition' is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α], Iff (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α _inst_1))) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat Nat.hasLe n m) -> (Not (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) a n) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1) a m)))))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α], Iff (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2241 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2243 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α _inst_1) x._@.Mathlib.Order.OrderIsoNat._hyg.2241 x._@.Mathlib.Order.OrderIsoNat._hyg.2243)) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat instLENat n m) -> (Not (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 a n) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 a m)))))
+Case conversion may be inaccurate. Consider using '#align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'ₓ'. -/
 theorem WellFounded.monotone_chain_condition' [Preorder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → ¬a n < a m :=
   by
@@ -322,10 +327,14 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
     obtain ⟨n, hn⟩ := h (a.swap : ((· < ·) : ℕ → ℕ → Prop) →r ((· < ·) : α → α → Prop)).toOrderHom
     exact hn n.succ n.lt_succ_self.le ((RelEmbedding.map_rel_iff _).2 n.lt_succ_self)
 #align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'
--/
 
+/- warning: well_founded.monotone_chain_condition -> WellFounded.monotone_chain_condition is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)))) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat Nat.hasLe n m) -> (Eq.{succ u1} α (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) a n) (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α _inst_1)) a m))))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2465 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2467 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) x._@.Mathlib.Order.OrderIsoNat._hyg.2465 x._@.Mathlib.Order.OrderIsoNat._hyg.2467)) (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1)), Exists.{1} Nat (fun (n : Nat) => forall (m : Nat), (LE.le.{0} Nat instLENat n m) -> (Eq.{succ u1} α (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1) a n) (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α _inst_1) a m))))
+Case conversion may be inaccurate. Consider using '#align well_founded.monotone_chain_condition WellFounded.monotone_chain_conditionₓ'. -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]] -/
-#print WellFounded.monotone_chain_condition /-
 /-- The "monotone chain condition" below is sometimes a convenient form of well foundedness. -/
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → a n = a m :=
@@ -336,7 +345,6 @@ theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     rw [lt_iff_le_and_ne]
     simp [a.mono h]
 #align well_founded.monotone_chain_condition WellFounded.monotone_chain_condition
--/
 
 #print monotonicSequenceLimitIndex /-
 /-- Given an eventually-constant monotone sequence `a₀ ≤ a₁ ≤ a₂ ≤ ...` in a partially-ordered
@@ -358,7 +366,7 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 
 /- warning: well_founded.supr_eq_monotonic_sequence_limit -> WellFounded.iSup_eq_monotonicSequenceLimit is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2645 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2647 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2645 x._@.Mathlib.Order.OrderIsoNat._hyg.2647)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimitₓ'. -/
Diff
@@ -344,7 +344,7 @@ type, `monotonic_sequence_limit_index a` is the least natural number `n` for whi
 constant value. For sequences that are not eventually constant, `monotonic_sequence_limit_index a`
 is defined, but is a junk value. -/
 noncomputable def monotonicSequenceLimitIndex [Preorder α] (a : ℕ →o α) : ℕ :=
-  infₛ { n | ∀ m, n ≤ m → a n = a m }
+  sInf { n | ∀ m, n ≤ m → a n = a m }
 #align monotonic_sequence_limit_index monotonicSequenceLimitIndex
 -/
 
@@ -356,19 +356,19 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 #align monotonic_sequence_limit monotonicSequenceLimit
 -/
 
-/- warning: well_founded.supr_eq_monotonic_sequence_limit -> WellFounded.supᵢ_eq_monotonicSequenceLimit is a dubious translation:
+/- warning: well_founded.supr_eq_monotonic_sequence_limit -> WellFounded.iSup_eq_monotonicSequenceLimit is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2645 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2647 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2645 x._@.Mathlib.Order.OrderIsoNat._hyg.2647)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
-Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimitₓ'. -/
-theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
-    (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2645 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2647 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2645 x._@.Mathlib.Order.OrderIsoNat._hyg.2647)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (iSup.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimitₓ'. -/
+theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
+    (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : iSup a = monotonicSequenceLimit a :=
   by
-  apply (supᵢ_le fun m => _).antisymm (le_supᵢ a _)
+  apply (iSup_le fun m => _).antisymm (le_iSup a _)
   cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
   · exact a.monotone hm
   · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
-    exact (Nat.infₛ_mem ⟨n, fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)⟩ m hm.le).ge
-#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimit
+    exact (Nat.sInf_mem ⟨n, fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)⟩ m hm.le).ge
+#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimit
 
Diff
@@ -178,7 +178,7 @@ variable {s}
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Nat -> Nat) (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 Case conversion may be inaccurate. Consider using '#align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSetₓ'. -/
 @[simp]
 theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
@@ -190,7 +190,7 @@ theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_applyₓ'. -/
 theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     orderEmbeddingOfSet s n = Subtype.ofNat s n :=
@@ -217,7 +217,7 @@ variable (s)
 lean 3 declaration is
   forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 but is expected to have type
-  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
+  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_rangeₓ'. -/
 theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
     Set.range (Nat.orderEmbeddingOfSet s) = s :=
@@ -228,7 +228,7 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) s) (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) t)))
 but is expected to have type
-  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) t)))
+  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) t)))
 Case conversion may be inaccurate. Consider using '#align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_unionₓ'. -/
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
@@ -247,7 +247,7 @@ end Nat
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'ₓ'. -/
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
@@ -292,7 +292,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.Hom.Lattice._hyg.494 : Nat) => Nat) _x) (InfHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (Lattice.toInf.{0} Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder))) (Lattice.toInf.{0} Nat Nat.instLatticeNat) (LatticeHomClass.toInfHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (DistribLattice.toLattice.{0} Nat (instDistribLattice.{0} Nat Nat.linearOrder)) Nat.instLatticeNat (OrderHomClass.toLatticeHomClass.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat Nat.linearOrder Nat.instLatticeNat (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseqₓ'. -/
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
     Bolzano-Weierstrass for `ℝ`. -/
Diff
@@ -49,7 +49,7 @@ def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (LT.lt.{0} Nat Nat.hasLt) r) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r (RelEmbedding.natLt.{u1} α r _inst_1 f H))) f
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f n) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.75 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.77 : Nat) => LT.lt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.75 x._@.Mathlib.Order.OrderIsoNat._hyg.77) r)) (RelEmbedding.natLt.{u1} α r _inst_1 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLtₓ'. -/
 @[simp]
 theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
@@ -68,7 +68,7 @@ def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f n)}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.natGt.{u1} α r _inst_1 f H))) f
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r)) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGtₓ'. -/
 @[simp]
 theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
@@ -89,7 +89,7 @@ theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x (Set.range.{u1, 1} α Nat (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f)))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r f))))))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r)) f)))))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seqₓ'. -/
 /-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
 theorem acc_iff_no_decreasing_seq {x} :
@@ -116,7 +116,7 @@ theorem acc_iff_no_decreasing_seq {x} :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (k : Nat), Not (Acc.{succ u1} α r (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f k))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r f) k))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) _x) (RelHomClass.toFunLike.{u1, 0, u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r)) f k))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seqₓ'. -/
 theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) :=
   by
@@ -178,7 +178,7 @@ variable {s}
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Nat -> Nat) (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) ᾰ) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) (Function.comp.{1, 1, 1} Nat (Set.Elem.{0} Nat s) Nat (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1))
 Case conversion may be inaccurate. Consider using '#align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSetₓ'. -/
 @[simp]
 theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
@@ -190,7 +190,7 @@ theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (HasLiftT.mk.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (CoeTCₓ.coe.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeBase.{1, 1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat (coeSubtype.{1} Nat (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))))) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) n) (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)) n) (Subtype.val.{1} Nat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n))
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_applyₓ'. -/
 theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
     orderEmbeddingOfSet s n = Subtype.ofNat s n :=
@@ -201,7 +201,7 @@ theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
 lean 3 declaration is
   forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)] {n : Nat}, Eq.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (coeFn.{1, 1} (OrderIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) Nat.hasLe (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s))) (fun (_x : RelIso.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) => Nat -> (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)) (RelIso.hasCoeToFun.{0, 0} Nat (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s) (Subtype.hasLe.{0} Nat Nat.hasLe (fun (x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) x s)))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
 but is expected to have type
-  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Set.Elem.{0} Nat s) n) (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat (Set.Elem.{0} Nat s)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Set.Elem.{0} Nat s) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat (Set.Elem.{0} Nat s)) Nat (Set.Elem.{0} Nat s) (Function.instEmbeddingLikeEmbedding.{1, 1} Nat (Set.Elem.{0} Nat s))) (RelEmbedding.toEmbedding.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298) (RelIso.toRelEmbedding.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298) (Nat.Subtype.orderIsoOfNat s _inst_1))) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
+  forall {s : Set.{0} Nat} [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)] {n : Nat}, Eq.{1} (Set.Elem.{0} Nat s) (FunLike.coe.{1, 1, 1} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298)) Nat (fun (_x : Nat) => Set.Elem.{0} Nat s) (RelHomClass.toFunLike.{0, 0, 0} (RelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298)) Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298) (RelIso.instRelHomClassRelIso.{0, 0} Nat (Set.Elem.{0} Nat s) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1281 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.1283 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.1281 x._@.Mathlib.Order.Hom.Basic._hyg.1283) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.1296 : Set.Elem.{0} Nat s) (x._@.Mathlib.Order.Hom.Basic._hyg.1298 : Set.Elem.{0} Nat s) => LE.le.{0} (Set.Elem.{0} Nat s) (Subtype.le.{0} Nat instLENat (fun (x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) x s)) x._@.Mathlib.Order.Hom.Basic._hyg.1296 x._@.Mathlib.Order.Hom.Basic._hyg.1298))) (Nat.Subtype.orderIsoOfNat s _inst_1) n) (Nat.Subtype.ofNat s (fun (a : Nat) => _inst_2 a) _inst_1 n)
 Case conversion may be inaccurate. Consider using '#align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_applyₓ'. -/
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [DecidablePred (· ∈ s)] {n : ℕ} :
@@ -217,7 +217,7 @@ variable (s)
 lean 3 declaration is
   forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (coeSort.{1, 2} (Set.{0} Nat) Type (Set.hasCoeToSort.{0} Nat) s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.Mem.{0, 0} Nat (Set.{0} Nat) (Set.hasMem.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 but is expected to have type
-  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a))))) s
+  forall (s : Set.{0} Nat) [_inst_1 : Infinite.{1} (Set.Elem.{0} Nat s)] [_inst_2 : DecidablePred.{1} Nat (fun (_x : Nat) => Membership.mem.{0, 0} Nat (Set.{0} Nat) (Set.instMembershipSet.{0} Nat) _x s)], Eq.{1} (Set.{0} Nat) (Set.range.{0, 1} Nat Nat (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) (Nat.orderEmbeddingOfSet s _inst_1 (fun (a : Nat) => _inst_2 a)))) s
 Case conversion may be inaccurate. Consider using '#align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_rangeₓ'. -/
 theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
     Set.range (Nat.orderEmbeddingOfSet s) = s :=
@@ -228,7 +228,7 @@ theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
 lean 3 declaration is
   forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) s) (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (e (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) t)))
 but is expected to have type
-  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n)) t)))
+  forall {α : Type.{u1}} {s : Set.{u1} α} {t : Set.{u1} α} (e : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e n) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) s) (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (e (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) t)))
 Case conversion may be inaccurate. Consider using '#align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_unionₓ'. -/
 theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he : ∀ n, e n ∈ s ∪ t) :
     ∃ g : ℕ ↪o ℕ, (∀ n, e (g n) ∈ s) ∨ ∀ n, e (g n) ∈ t := by
@@ -247,7 +247,7 @@ end Nat
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (n : Nat), r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n)) (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) m)) (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (n : Nat), r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'ₓ'. -/
 theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f : ℕ → α) :
     ∃ g : ℕ ↪o ℕ,
@@ -292,7 +292,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
 lean 3 declaration is
   forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat Nat.hasLt m n) -> (Not (r (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g m)) (f (coeFn.{1, 1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (_x : RelEmbedding.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) => Nat -> Nat) (RelEmbedding.hasCoeToFun.{0, 0} Nat Nat (LE.le.{0} Nat Nat.hasLe) (LE.le.{0} Nat Nat.hasLe)) g n))))))
 but is expected to have type
-  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) m)) (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) m)) (f (FunLike.coe.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => Nat) _x) (EmbeddingLike.toFunLike.{1, 1, 1} (Function.Embedding.{1, 1} Nat Nat) Nat Nat (Function.instEmbeddingLikeEmbedding.{1, 1} Nat Nat)) (RelEmbedding.toEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) g) n))))))
+  forall {α : Type.{u1}} (r : α -> α -> Prop) [_inst_1 : IsTrans.{u1} α r] (f : Nat -> α), Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Or (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n)))) (forall (m : Nat) (n : Nat), (LT.lt.{0} Nat instLTNat m n) -> (Not (r (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g m)) (f (FunLike.coe.{1, 1, 1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => Nat) _x) (RelHomClass.toFunLike.{0, 0, 0} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697) (RelEmbedding.instRelHomClassRelEmbedding.{0, 0} Nat Nat (fun (x._@.Mathlib.Order.Hom.Basic._hyg.680 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.682 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.680 x._@.Mathlib.Order.Hom.Basic._hyg.682) (fun (x._@.Mathlib.Order.Hom.Basic._hyg.695 : Nat) (x._@.Mathlib.Order.Hom.Basic._hyg.697 : Nat) => LE.le.{0} Nat instLENat x._@.Mathlib.Order.Hom.Basic._hyg.695 x._@.Mathlib.Order.Hom.Basic._hyg.697))) g n))))))
 Case conversion may be inaccurate. Consider using '#align exists_increasing_or_nonincreasing_subseq exists_increasing_or_nonincreasing_subseqₓ'. -/
 /-- This is the infinitary Erdős–Szekeres theorem, and an important lemma in the usual proof of
     Bolzano-Weierstrass for `ℝ`. -/
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.order_iso_nat
-! leanprover-community/mathlib commit 4d392a6c9c4539cbeca399b3ee0afea398fbd2eb
+! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -365,19 +365,10 @@ Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_m
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
   by
-  suffices (⨆ m : ℕ, a m) ≤ monotonicSequenceLimit a by exact le_antisymm this (le_supᵢ a _)
-  apply supᵢ_le
-  intro m
-  by_cases hm : m ≤ monotonicSequenceLimitIndex a
+  apply (supᵢ_le fun m => _).antisymm (le_supᵢ a _)
+  cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
   · exact a.monotone hm
-  · replace hm := le_of_not_le hm
-    let S := { n | ∀ m, n ≤ m → a n = a m }
-    have hInf : Inf S ∈ S := by
-      refine' Nat.infₛ_mem _
-      rw [WellFounded.monotone_chain_condition] at h
-      exact h a
-    change Inf S ≤ m at hm
-    change a m ≤ a (Inf S)
-    rw [hInf m hm]
+  · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
+    exact (Nat.infₛ_mem ⟨n, fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)⟩ m hm.le).ge
 #align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimit
 
Diff
@@ -360,7 +360,7 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2880 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2882 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2880 x._@.Mathlib.Order.OrderIsoNat._hyg.2882)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2645 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2647 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2645 x._@.Mathlib.Order.OrderIsoNat._hyg.2647)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimitₓ'. -/
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
Diff
@@ -68,7 +68,7 @@ def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f n)}, Eq.{succ u1} (Nat -> α) (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (RelEmbedding.natGt.{u1} α r _inst_1 f H)) f
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.201 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.203 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.201 x._@.Mathlib.Order.OrderIsoNat._hyg.203) r (RelEmbedding.natGt.{u1} α r _inst_1 f H))) f
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {f : Nat -> α} {H : forall (n : Nat), r (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f n)}, Eq.{succ u1} (forall (ᾰ : Nat), (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) ᾰ) (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.202 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.204 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.202 x._@.Mathlib.Order.OrderIsoNat._hyg.204) r (RelEmbedding.natGt.{u1} α r _inst_1 f H))) f
 Case conversion may be inaccurate. Consider using '#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGtₓ'. -/
 @[simp]
 theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
@@ -89,7 +89,7 @@ theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x (Set.range.{u1, 1} α Nat (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f)))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.419 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.419 x._@.Mathlib.Order.OrderIsoNat._hyg.421) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.419 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.419 x._@.Mathlib.Order.OrderIsoNat._hyg.421) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.419 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.419 x._@.Mathlib.Order.OrderIsoNat._hyg.421) r f))))))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {x : α}, Iff (Acc.{succ u1} α r x) (IsEmpty.{succ u1} (Subtype.{succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) (fun (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r) => Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x (Set.range.{u1, 1} α Nat (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.421 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.423 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.421 x._@.Mathlib.Order.OrderIsoNat._hyg.423) r f))))))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seqₓ'. -/
 /-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
 theorem acc_iff_no_decreasing_seq {x} :
@@ -116,7 +116,7 @@ theorem acc_iff_no_decreasing_seq {x} :
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (k : Nat), Not (Acc.{succ u1} α r (coeFn.{succ u1, succ u1} (RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) (fun (_x : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) => Nat -> α) (RelEmbedding.hasCoeToFun.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r) f k))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.655 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.657 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.655 x._@.Mathlib.Order.OrderIsoNat._hyg.657) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.655 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.657 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.655 x._@.Mathlib.Order.OrderIsoNat._hyg.657) r f) k))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r) (k : Nat), Not (Acc.{succ u1} α r (FunLike.coe.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) _x) (EmbeddingLike.toFunLike.{succ u1, 1, succ u1} (Function.Embedding.{1, succ u1} Nat α) Nat α (Function.instEmbeddingLikeEmbedding.{1, succ u1} Nat α)) (RelEmbedding.toEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.659 : Nat) (x._@.Mathlib.Order.OrderIsoNat._hyg.661 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.OrderIsoNat._hyg.659 x._@.Mathlib.Order.OrderIsoNat._hyg.661) r f) k))
 Case conversion may be inaccurate. Consider using '#align rel_embedding.not_acc_of_decreasing_seq RelEmbedding.not_acc_of_decreasing_seqₓ'. -/
 theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k) :=
   by
@@ -360,7 +360,7 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2851 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2853 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2851 x._@.Mathlib.Order.OrderIsoNat._hyg.2853)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2880 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2882 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2880 x._@.Mathlib.Order.OrderIsoNat._hyg.2882)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimitₓ'. -/
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
Diff
@@ -360,7 +360,7 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))))) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toHasSup.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (coeFn.{succ u1, succ u1} (OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) (fun (_x : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) => Nat -> α) (OrderHom.hasCoeToFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2888 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2890 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2888 x._@.Mathlib.Order.OrderIsoNat._hyg.2890)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
+  forall {α : Type.{u1}} [_inst_1 : CompleteLattice.{u1} α], (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.OrderIsoNat._hyg.2851 : α) (x._@.Mathlib.Order.OrderIsoNat._hyg.2853 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))) x._@.Mathlib.Order.OrderIsoNat._hyg.2851 x._@.Mathlib.Order.OrderIsoNat._hyg.2853)) -> (forall (a : OrderHom.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1)))), Eq.{succ u1} α (supᵢ.{u1, 1} α (ConditionallyCompleteLattice.toSupSet.{u1} α (CompleteLattice.toConditionallyCompleteLattice.{u1} α _inst_1)) Nat (OrderHom.toFun.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a)) (monotonicSequenceLimit.{u1} α (PartialOrder.toPreorder.{u1} α (CompleteSemilatticeInf.toPartialOrder.{u1} α (CompleteLattice.toCompleteSemilatticeInf.{u1} α _inst_1))) a))
 Case conversion may be inaccurate. Consider using '#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimitₓ'. -/
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
Diff
@@ -324,7 +324,7 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
 #align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]] -/
 #print WellFounded.monotone_chain_condition /-
 /-- The "monotone chain condition" below is sometimes a convenient form of well foundedness. -/
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
@@ -332,7 +332,7 @@ theorem WellFounded.monotone_chain_condition [PartialOrder α] :
   WellFounded.monotone_chain_condition'.trans <|
     by
     trace
-      "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]]"
+      "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr ∀ a, «expr∃ , »((n), ∀ (m) (h : «expr ≤ »(n, m)), (_ : exprProp()))]]"
     rw [lt_iff_le_and_ne]
     simp [a.mono h]
 #align well_founded.monotone_chain_condition WellFounded.monotone_chain_condition

Changes in mathlib4

mathlib3
mathlib4
chore: split Subsingleton,Nontrivial off of Data.Set.Basic (#11832)

Moves definition of and lemmas related to Set.Subsingleton and Set.Nontrivial to a new file, so that Basic can be shorter.

Diff
@@ -8,7 +8,7 @@ import Mathlib.Data.Nat.Lattice
 import Mathlib.Logic.Denumerable
 import Mathlib.Logic.Function.Iterate
 import Mathlib.Order.Hom.Basic
-import Mathlib.Data.Set.Basic
+import Mathlib.Data.Set.Subsingleton
 
 #align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
 
chore(Data/Nat/Defs): Integrate Nat.sqrt material (#11866)

Move the content of Data.Nat.ForSqrt and Data.Nat.Sqrt to Data.Nat.Defs by using Nat-specific Std lemmas rather than the mathlib general ones. This makes it ready to move to Std if wanted.

Diff
@@ -74,7 +74,7 @@ theorem acc_iff_no_decreasing_seq {x} :
       rintro ⟨x, hx⟩
       cases exists_not_acc_lt_of_not_acc hx with
       | intro w h => exact ⟨⟨w, h.1⟩, h.2⟩
-    obtain ⟨f, h⟩ := Classical.axiom_of_choice this
+    choose f h using this
     refine' fun E =>
       by_contradiction fun hx => E.elim' ⟨natGT (fun n => (f^[n] ⟨x, hx⟩).1) fun n => _, 0, rfl⟩
     simp only [Function.iterate_succ']
chore: more backporting of simp changes from #10995 (#11001)

Co-authored-by: Patrick Massot <patrickmassot@free.fr> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -186,7 +186,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) := by
         intro n
         have h := hm _ (le_add_of_nonneg_left n.zero_le)
-        simp only [exists_prop, not_not, Set.mem_setOf_eq, not_forall] at h
+        simp only [bad, exists_prop, not_not, Set.mem_setOf_eq, not_forall] at h
         obtain ⟨n', hn1, hn2⟩ := h
         obtain ⟨x, hpos, rfl⟩ := exists_pos_add_of_lt hn1
         refine' ⟨n + x, add_lt_add_left hpos n, _⟩
chore(*): shake imports (#10199)
  • Remove Data.Set.Basic from scripts/noshake.json.
  • Remove an exception that was used by examples only, move these examples to a new test file.
  • Drop an exception for Order.Filter.Basic dependency on Control.Traversable.Instances, as the relevant parts were moved to Order.Filter.ListTraverse.
  • Run lake exe shake --fix.
Diff
@@ -8,6 +8,7 @@ import Mathlib.Data.Nat.Lattice
 import Mathlib.Logic.Denumerable
 import Mathlib.Logic.Function.Iterate
 import Mathlib.Order.Hom.Basic
+import Mathlib.Data.Set.Basic
 
 #align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
 
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -251,7 +251,7 @@ theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) :
     iSup a = monotonicSequenceLimit a := by
   refine' (iSup_le fun m => _).antisymm (le_iSup a _)
-  cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
+  rcases le_or_lt m (monotonicSequenceLimitIndex a) with hm | hm
   · exact a.monotone hm
   · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
     have : n ∈ {n | ∀ m, n ≤ m → a n = a m} := fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)
feat: congr(...) congruence quotations and port congrm tactic (#2544)

Adds a term elaborator for congr(...) "congruence quotations". For example, if hf : f = f' and hx : x = x', then we have congr($hf $x) : f x = f' x'. This supports the functions having implicit arguments, and it has support for subsingleton instance arguments. So for example, if s t : Set X are sets with Fintype instances and h : s = t then congr(Fintype.card $h) : Fintype.card s = Fintype.card t works.

Ports the congrm tactic as a convenient frontend for applying a congruence quotation to the goal. Holes are turned into congruence holes. For example, congrm 1 + ?_ uses congr(1 + $(?_)). Placeholders (_) do not turn into congruence holes; that's not to say they have to be identical on the LHS and RHS, but congrm itself is responsible for finding a congruence lemma for such arguments.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Moritz Doll <moritz.doll@googlemail.com>

Diff
@@ -228,10 +228,9 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → a n = a m :=
   WellFounded.monotone_chain_condition'.trans <| by
-  -- porting note: was congrm ∀ a, ∃ n, ∀ m (h : n ≤ m), (_ : Prop)
-  congr! 4
-  rename_i a n m
-  simp (config := {contextual := true}) [lt_iff_le_and_ne, fun h => a.mono h]
+  congrm ∀ a, ∃ n, ∀ m h, ?_
+  rw [lt_iff_le_and_ne]
+  simp [a.mono h]
 #align well_founded.monotone_chain_condition WellFounded.monotone_chain_condition
 
 /-- Given an eventually-constant monotone sequence `a₀ ≤ a₁ ≤ a₂ ≤ ...` in a partially-ordered
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
@@ -27,7 +27,7 @@ defines the limit value of an eventually-constant sequence.
 -/
 
 
-variable {α : Type _}
+variable {α : Type*}
 
 namespace RelEmbedding
 
chore: tidy various files (#6158)
Diff
@@ -19,7 +19,7 @@ defines the limit value of an eventually-constant sequence.
 
 ## Main declarations
 
-* `natLt`/`natGt`: Make an order embedding `Nat ↪ α` from
+* `natLT`/`natGT`: Make an order embedding `Nat ↪ α` from
    an increasing/decreasing function `Nat → α`.
 * `monotonicSequenceLimit`: The limit of an eventually-constant monotone sequence `Nat →o α`.
 * `monotonicSequenceLimitIndex`: The index of the first occurrence of `monotonicSequenceLimit`
@@ -34,25 +34,25 @@ namespace RelEmbedding
 variable {r : α → α → Prop} [IsStrictOrder α r]
 
 /-- If `f` is a strictly `r`-increasing sequence, then this returns `f` as an order embedding. -/
-def natLt (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) : ℕ → ℕ → Prop) ↪r r :=
+def natLT (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) : ℕ → ℕ → Prop) ↪r r :=
   ofMonotone f <| Nat.rel_of_forall_rel_succ_of_lt r H
-#align rel_embedding.nat_lt RelEmbedding.natLt
+#align rel_embedding.nat_lt RelEmbedding.natLT
 
 @[simp]
-theorem coe_natLt {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLt f H) = f :=
+theorem coe_natLT {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLT f H) = f :=
   rfl
-#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLt
+#align rel_embedding.coe_nat_lt RelEmbedding.coe_natLT
 
 /-- If `f` is a strictly `r`-decreasing sequence, then this returns `f` as an order embedding. -/
-def natGt (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) : ℕ → ℕ → Prop) ↪r r :=
+def natGT (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) : ℕ → ℕ → Prop) ↪r r :=
   haveI := IsStrictOrder.swap r
-  RelEmbedding.swap (natLt f H)
-#align rel_embedding.nat_gt RelEmbedding.natGt
+  RelEmbedding.swap (natLT f H)
+#align rel_embedding.nat_gt RelEmbedding.natGT
 
 @[simp]
-theorem coe_natGt {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGt f H) = f :=
+theorem coe_natGT {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGT f H) = f :=
   rfl
-#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGt
+#align rel_embedding.coe_nat_gt RelEmbedding.coe_natGT
 
 theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc r b ∧ r b a := by
   contrapose! h
@@ -75,7 +75,7 @@ theorem acc_iff_no_decreasing_seq {x} :
       | intro w h => exact ⟨⟨w, h.1⟩, h.2⟩
     obtain ⟨f, h⟩ := Classical.axiom_of_choice this
     refine' fun E =>
-      by_contradiction fun hx => E.elim' ⟨natGt (fun n => (f^[n] ⟨x, hx⟩).1) fun n => _, 0, rfl⟩
+      by_contradiction fun hx => E.elim' ⟨natGT (fun n => (f^[n] ⟨x, hx⟩).1) fun n => _, 0, rfl⟩
     simp only [Function.iterate_succ']
     apply h
 #align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seq
@@ -109,7 +109,7 @@ variable (s : Set ℕ) [Infinite s]
 /-- An order embedding from `ℕ` to itself with a specified range -/
 def orderEmbeddingOfSet [DecidablePred (· ∈ s)] : ℕ ↪o ℕ :=
   (RelEmbedding.orderEmbeddingOfLTEmbedding
-    (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun _ => Nat.Subtype.lt_succ_self _)).trans
+    (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun _ => Nat.Subtype.lt_succ_self _)).trans
     (OrderEmbedding.subtype s)
 #align nat.order_embedding_of_set Nat.orderEmbeddingOfSet
 
@@ -120,7 +120,7 @@ noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
   exact
     RelIso.ofSurjective
       (RelEmbedding.orderEmbeddingOfLTEmbedding
-        (RelEmbedding.natLt (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
+        (RelEmbedding.natLT (Nat.Subtype.ofNat s) fun n => Nat.Subtype.lt_succ_self _))
       Nat.Subtype.ofNat_surjective
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 
@@ -193,7 +193,7 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
         exact hn2
       let g' : ℕ → ℕ := @Nat.rec (fun _ => ℕ) m fun n gn => Nat.find (h gn)
       exact
-        ⟨(RelEmbedding.natLt (fun n => g' n + m) fun n =>
+        ⟨(RelEmbedding.natLT (fun n => g' n + m) fun n =>
               Nat.add_lt_add_right (Nat.find_spec (h (g' n))).1 m).orderEmbeddingOfLTEmbedding,
           Or.intro_left _ fun n => (Nat.find_spec (h (g' n))).2⟩
 #align exists_increasing_or_nonincreasing_subseq' exists_increasing_or_nonincreasing_subseq'
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,11 +2,6 @@
 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.order_iso_nat
-! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 
 import Mathlib.Data.Nat.Lattice
@@ -14,6 +9,8 @@ import Mathlib.Logic.Denumerable
 import Mathlib.Logic.Function.Iterate
 import Mathlib.Order.Hom.Basic
 
+#align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90"
+
 /-!
 # Relation embeddings from the naturals
 
fix precedence of Nat.iterate (#5589)
Diff
@@ -78,7 +78,7 @@ theorem acc_iff_no_decreasing_seq {x} :
       | intro w h => exact ⟨⟨w, h.1⟩, h.2⟩
     obtain ⟨f, h⟩ := Classical.axiom_of_choice this
     refine' fun E =>
-      by_contradiction fun hx => E.elim' ⟨natGt (fun n => ((f^[n]) ⟨x, hx⟩).1) fun n => _, 0, rfl⟩
+      by_contradiction fun hx => E.elim' ⟨natGt (fun n => (f^[n] ⟨x, hx⟩).1) fun n => _, 0, rfl⟩
     simp only [Function.iterate_succ']
     apply h
 #align rel_embedding.acc_iff_no_decreasing_seq RelEmbedding.acc_iff_no_decreasing_seq
chore: add space after exacts (#4945)

Too often tempted to change these during other PRs, so doing a mass edit here.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -160,7 +160,7 @@ theorem exists_subseq_of_forall_mem_union {s t : Set α} (e : ℕ → α) (he :
       simp only [Set.infinite_coe_iff, ← Set.infinite_union, ← Set.preimage_union,
         Set.eq_univ_of_forall fun n => Set.mem_preimage.2 (he n), Set.infinite_univ]
     cases this
-    exacts[⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
+    exacts [⟨Nat.orderEmbeddingOfSet (e ⁻¹' s), Or.inl fun n => (Nat.Subtype.ofNat (e ⁻¹' s) _).2⟩,
       ⟨Nat.orderEmbeddingOfSet (e ⁻¹' t), Or.inr fun n => (Nat.Subtype.ofNat (e ⁻¹' t) _).2⟩]
 #align nat.exists_subseq_of_forall_mem_union Nat.exists_subseq_of_forall_mem_union
 
chore: fix many typos (#4535)

Run codespell Mathlib and keep some suggestions.

Diff
@@ -25,7 +25,7 @@ defines the limit value of an eventually-constant sequence.
 * `natLt`/`natGt`: Make an order embedding `Nat ↪ α` from
    an increasing/decreasing function `Nat → α`.
 * `monotonicSequenceLimit`: The limit of an eventually-constant monotone sequence `Nat →o α`.
-* `monotonicSequenceLimitIndex`: The index of the first occurence of `monotonicSequenceLimit`
+* `monotonicSequenceLimitIndex`: The index of the first occurrence of `monotonicSequenceLimit`
   in the sequence.
 -/
 
chore: Rename to sSup/iSup (#3938)

As discussed on Zulip

Renames

  • supₛsSup
  • infₛsInf
  • supᵢiSup
  • infᵢiInf
  • bsupₛbsSup
  • binfₛbsInf
  • bsupᵢbiSup
  • binfᵢbiInf
  • csupₛcsSup
  • cinfₛcsInf
  • csupᵢciSup
  • cinfᵢciInf
  • unionₛsUnion
  • interₛsInter
  • unionᵢiUnion
  • interᵢiInter
  • bunionₛbsUnion
  • binterₛbsInter
  • bunionᵢbiUnion
  • binterᵢbiInter

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

Diff
@@ -242,7 +242,7 @@ type, `monotonicSequenceLimitIndex a` is the least natural number `n` for which
 constant value. For sequences that are not eventually constant, `monotonicSequenceLimitIndex a`
 is defined, but is a junk value. -/
 noncomputable def monotonicSequenceLimitIndex [Preorder α] (a : ℕ →o α) : ℕ :=
-  infₛ { n | ∀ m, n ≤ m → a n = a m }
+  sInf { n | ∀ m, n ≤ m → a n = a m }
 #align monotonic_sequence_limit_index monotonicSequenceLimitIndex
 
 /-- The constant value of an eventually-constant monotone sequence `a₀ ≤ a₁ ≤ a₂ ≤ ...` in a
@@ -251,13 +251,13 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
   a (monotonicSequenceLimitIndex a)
 #align monotonic_sequence_limit monotonicSequenceLimit
 
-theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
+theorem WellFounded.iSup_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) :
-    supᵢ a = monotonicSequenceLimit a := by
-  refine' (supᵢ_le fun m => _).antisymm (le_supᵢ a _)
+    iSup a = monotonicSequenceLimit a := by
+  refine' (iSup_le fun m => _).antisymm (le_iSup a _)
   cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
   · exact a.monotone hm
   · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
     have : n ∈ {n | ∀ m, n ≤ m → a n = a m} := fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)
-    exact (Nat.infₛ_mem ⟨n, this⟩ m hm.le).ge
-#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimit
+    exact (Nat.sInf_mem ⟨n, this⟩ m hm.le).ge
+#align well_founded.supr_eq_monotonic_sequence_limit WellFounded.iSup_eq_monotonicSequenceLimit
chore: bye-bye, solo bys! (#3825)

This PR puts, with one exception, every single remaining by that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh. The exception is when the by begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.

Essentially this is s/\n *by$/ by/g, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated bys".

Diff
@@ -72,8 +72,7 @@ theorem acc_iff_no_decreasing_seq {x} :
     constructor
     rintro ⟨f, k, hf⟩
     exact IsEmpty.elim' (IH (f (k + 1)) (hf ▸ f.map_rel_iff.2 (lt_add_one k))) ⟨f, _, rfl⟩
-  · have : ∀ x : { a // ¬Acc r a }, ∃ y : { a // ¬Acc r a }, r y.1 x.1 :=
-      by
+  · have : ∀ x : { a // ¬Acc r a }, ∃ y : { a // ¬Acc r a }, r y.1 x.1 := by
       rintro ⟨x, hx⟩
       cases exists_not_acc_lt_of_not_acc hx with
       | intro w h => exact ⟨⟨w, h.1⟩, h.2⟩
@@ -179,17 +178,14 @@ theorem exists_increasing_or_nonincreasing_subseq' (r : α → α → Prop) (f :
       rw [Nat.orderEmbeddingOfSet_range bad] at h
       exact h _ ((OrderEmbedding.lt_iff_lt _).2 mn)
     · rw [Set.infinite_coe_iff, Set.Infinite, not_not] at hbad
-      obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad :=
-        by
+      obtain ⟨m, hm⟩ : ∃ m, ∀ n, m ≤ n → ¬n ∈ bad := by
         by_cases he : hbad.toFinset.Nonempty
-        ·
-          refine'
+        · refine'
             ⟨(hbad.toFinset.max' he).succ, fun n hn nbad =>
               Nat.not_succ_le_self _
                 (hn.trans (hbad.toFinset.le_max' n (hbad.mem_toFinset.2 nbad)))⟩
         · exact ⟨0, fun n _ nbad => he ⟨n, hbad.mem_toFinset.2 nbad⟩⟩
-      have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) :=
-        by
+      have h : ∀ n : ℕ, ∃ n' : ℕ, n < n' ∧ r (f (n + m)) (f (n' + m)) := by
         intro n
         have h := hm _ (le_add_of_nonneg_left n.zero_le)
         simp only [exists_prop, not_not, Set.mem_setOf_eq, not_forall] at h
@@ -256,8 +252,8 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 #align monotonic_sequence_limit monotonicSequenceLimit
 
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
-    (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
-  by
+    (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) :
+    supᵢ a = monotonicSequenceLimit a := by
   refine' (supᵢ_le fun m => _).antisymm (le_supᵢ a _)
   cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
   · exact a.monotone hm
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.order_iso_nat
-! leanprover-community/mathlib commit 6623e6af705e97002a9054c1c05a980180276fc1
+! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -258,17 +258,10 @@ noncomputable def monotonicSequenceLimit [Preorder α] (a : ℕ →o α) :=
 theorem WellFounded.supᵢ_eq_monotonicSequenceLimit [CompleteLattice α]
     (h : WellFounded ((· > ·) : α → α → Prop)) (a : ℕ →o α) : supᵢ a = monotonicSequenceLimit a :=
   by
-  suffices (⨆ m : ℕ, a m) ≤ monotonicSequenceLimit a by exact le_antisymm this (le_supᵢ a _)
-  apply supᵢ_le
-  intro m
-  by_cases hm : m ≤ monotonicSequenceLimitIndex a
+  refine' (supᵢ_le fun m => _).antisymm (le_supᵢ a _)
+  cases' le_or_lt m (monotonicSequenceLimitIndex a) with hm hm
   · exact a.monotone hm
-  · replace hm := le_of_not_le hm
-    let S := { n | ∀ m, n ≤ m → a n = a m }
-    have hInf : infₛ S ∈ S := by
-      refine' Nat.infₛ_mem _
-      rw [WellFounded.monotone_chain_condition] at h
-      exact h a
-    change a m ≤ a (infₛ S)
-    rw [hInf m hm]
+  · cases' WellFounded.monotone_chain_condition'.1 h a with n hn
+    have : n ∈ {n | ∀ m, n ≤ m → a n = a m} := fun k hk => (a.mono hk).eq_of_not_lt (hn k hk)
+    exact (Nat.infₛ_mem ⟨n, this⟩ m hm.le).ge
 #align well_founded.supr_eq_monotonic_sequence_limit WellFounded.supᵢ_eq_monotonicSequenceLimit
fix: address some congr/convert porting notes (#3058)
Diff
@@ -144,12 +144,7 @@ theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
 @[simp]
 theorem Subtype.orderIsoOfNat_apply [dP : DecidablePred (· ∈ s)] {n : ℕ} :
     Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by
-  simp only [orderIsoOfNat, RelIso.ofSurjective_apply,
-    RelEmbedding.orderEmbeddingOfLTEmbedding_apply, RelEmbedding.coe_natLt]
-  suffices (fun a => Classical.propDecidable (a ∈ s)) = (fun a => dP a) by
-    rw [this]
-  simp
-  -- Porting note: This proof was simply `by simp [orderIsoOfNat]; congr`
+  simp [orderIsoOfNat]; congr!
 #align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_apply
 
 variable (s)
@@ -236,21 +231,14 @@ theorem WellFounded.monotone_chain_condition' [Preorder α] :
     exact hn n.succ n.lt_succ_self.le ((RelEmbedding.map_rel_iff _).2 n.lt_succ_self)
 #align well_founded.monotone_chain_condition' WellFounded.monotone_chain_condition'
 
---porting note: congrm tactic doesn't exist so this proof is much messier
 /-- The "monotone chain condition" below is sometimes a convenient form of well foundedness. -/
 theorem WellFounded.monotone_chain_condition [PartialOrder α] :
     WellFounded ((· > ·) : α → α → Prop) ↔ ∀ a : ℕ →o α, ∃ n, ∀ m, n ≤ m → a n = a m :=
   WellFounded.monotone_chain_condition'.trans <| by
-  refine' ⟨fun h a => _, fun h a => _⟩ <;> specialize h a <;> cases' h with n h <;>
-      use n <;> intro m hmn <;> specialize h m hmn
-  · rw [lt_iff_le_and_ne] at h
-    push_neg at h
-    apply h
-    simp [a.mono hmn]
-  · rw [lt_iff_le_and_ne]
-    push_neg
-    intro _
-    exact h
+  -- porting note: was congrm ∀ a, ∃ n, ∀ m (h : n ≤ m), (_ : Prop)
+  congr! 4
+  rename_i a n m
+  simp (config := {contextual := true}) [lt_iff_le_and_ne, fun h => a.mono h]
 #align well_founded.monotone_chain_condition WellFounded.monotone_chain_condition
 
 /-- Given an eventually-constant monotone sequence `a₀ ≤ a₁ ≤ a₂ ≤ ...` in a partially-ordered
feat: update SHA from #18277 (#2653)

leanprover-community/mathlib#18277 backported a bug about classical which is already fixed in mathlib4, so these diffs simpy need a SHA update.

(Comment: This might not be the full PR #18277 yet, as I worked on a file-by-file base)

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.order_iso_nat
-! leanprover-community/mathlib commit 2445c98ae4b87eabebdde552593519b9b6dc350c
+! leanprover-community/mathlib commit 6623e6af705e97002a9054c1c05a980180276fc1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -128,30 +128,34 @@ noncomputable def Subtype.orderIsoOfNat : ℕ ≃o s := by
       Nat.Subtype.ofNat_surjective
 #align nat.subtype.order_iso_of_nat Nat.Subtype.orderIsoOfNat
 
---porting note: Added the decidability requirement, I'm not sure how it worked in lean3 without it
-variable {s} [dP : DecidablePred (· ∈ s)]
+variable {s}
 
 @[simp]
-theorem coe_orderEmbeddingOfSet : ⇑(orderEmbeddingOfSet s) = (↑) ∘ Subtype.ofNat s :=
+theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
+    ⇑(orderEmbeddingOfSet s) = (↑) ∘ Subtype.ofNat s :=
   rfl
 #align nat.coe_order_embedding_of_set Nat.coe_orderEmbeddingOfSet
 
-theorem orderEmbeddingOfSet_apply {n : ℕ} : orderEmbeddingOfSet s n = Subtype.ofNat s n :=
+theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} :
+    orderEmbeddingOfSet s n = Subtype.ofNat s n :=
   rfl
 #align nat.order_embedding_of_set_apply Nat.orderEmbeddingOfSet_apply
 
 @[simp]
-theorem Subtype.orderIsoOfNat_apply {n : ℕ} : Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by
+theorem Subtype.orderIsoOfNat_apply [dP : DecidablePred (· ∈ s)] {n : ℕ} :
+    Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by
   simp only [orderIsoOfNat, RelIso.ofSurjective_apply,
     RelEmbedding.orderEmbeddingOfLTEmbedding_apply, RelEmbedding.coe_natLt]
   suffices (fun a => Classical.propDecidable (a ∈ s)) = (fun a => dP a) by
     rw [this]
   simp
+  -- Porting note: This proof was simply `by simp [orderIsoOfNat]; congr`
 #align nat.subtype.order_iso_of_nat_apply Nat.Subtype.orderIsoOfNat_apply
 
 variable (s)
 
-theorem orderEmbeddingOfSet_range : Set.range (Nat.orderEmbeddingOfSet s) = s :=
+theorem orderEmbeddingOfSet_range [DecidablePred (· ∈ s)] :
+    Set.range (Nat.orderEmbeddingOfSet s) = s :=
   Subtype.coe_comp_ofNat_range
 #align nat.order_embedding_of_set_range Nat.orderEmbeddingOfSet_range
 
feat: port Order.OrderIsoNat (#1753)

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

Dependencies 7 + 245

246 files ported (97.2%)
105420 lines ported (97.2%)
Show graph

The unported dependencies are