order.well_founded_setMathlib.Order.WellFoundedSet

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)

(last sync)

feat(order/well_founded_set): prod.lex is well-founded (#18665)

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

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

Diff
@@ -3,6 +3,7 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
 -/
+import data.sigma.lex
 import order.antichain
 import order.order_iso_nat
 import order.well_founded
@@ -45,7 +46,7 @@ Prove that `s` is partial well ordered iff it has no infinite descending chain o
  * [Nash-Williams, *On Well-Quasi-Ordering Finite Trees*][Nash-Williams63]
 -/
 
-variables {ι α β : Type*}
+variables {ι α β γ : Type*} {π : ι → Type*}
 
 namespace set
 
@@ -61,7 +62,7 @@ section well_founded_on
 variables {r r' : α → α → Prop}
 
 section any_rel
-variables {s t : set α} {x y : α}
+variables {f : β → α} {s t : set α} {x y : α}
 
 lemma well_founded_on_iff :
   s.well_founded_on r ↔ well_founded (λ (a b : α), r a b ∧ a ∈ s ∧ b ∈ s) :=
@@ -79,6 +80,26 @@ begin
     exact ⟨m, mt, λ x xt ⟨xm, xs, ms⟩, hst ⟨m, ⟨ms, mt⟩⟩⟩ }
 end
 
+@[simp] lemma well_founded_on_univ : (univ : set α).well_founded_on r ↔ well_founded r :=
+by simp [well_founded_on_iff]
+
+lemma _root_.well_founded.well_founded_on  : well_founded r → s.well_founded_on r := inv_image.wf _
+
+@[simp] lemma well_founded_on_range : (range f).well_founded_on r ↔ well_founded (r on f) :=
+begin
+  let f' : β → range f := λ c, ⟨f c, c, rfl⟩,
+  refine ⟨λ h, (inv_image.wf f' h).mono $ λ c c', id, λ h, ⟨_⟩⟩,
+  rintro ⟨_, c, rfl⟩,
+  refine acc.of_downward_closed f' _ _ (_),
+  { rintro _ ⟨_, c', rfl⟩ -,
+    exact ⟨c', rfl⟩ },
+  { exact h.apply _ }
+end
+
+@[simp] lemma well_founded_on_image {s : set β} :
+  (f '' s).well_founded_on r ↔ s.well_founded_on (r on f) :=
+by { rw image_eq_range, exact well_founded_on_range }
+
 namespace well_founded_on
 
 protected lemma induction (hs : s.well_founded_on r) (hx : x ∈ s) {P : α → Prop}
@@ -98,6 +119,9 @@ begin
   exact ⟨hle _ _ xy.1, hst xy.2.1, hst xy.2.2⟩
 end
 
+lemma mono' (h : ∀ a b ∈ s, r' a b → r a b) : s.well_founded_on r → s.well_founded_on r' :=
+subrelation.wf $ λ a b, h _ a.2 _ b.2
+
 lemma subset (h : t.well_founded_on r) (hst : s ⊆ t) : s.well_founded_on r := h.mono le_rfl hst
 
 open relation
@@ -707,3 +731,71 @@ begin
     refine ⟨g'.trans g, λ a b hab, (finset.forall_mem_cons _ _).2 _⟩,
     exact ⟨hg (order_hom_class.mono g' hab), hg' hab⟩ }
 end
+
+section prod_lex
+variables {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : set γ}
+
+/-- Stronger version of `prod.lex_wf`. Instead of requiring `rβ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+lemma well_founded.prod_lex_of_well_founded_on_fiber (hα : well_founded (rα on f))
+  (hβ : ∀ a, (f ⁻¹' {a}).well_founded_on (rβ on g)) :
+  well_founded (prod.lex rα rβ on λ c, (f c, g c)) :=
+begin
+  refine ((psigma.lex_wf (well_founded_on_range.2 hα) $ λ a, hβ a).on_fun).mono (λ c c' h, _),
+  exact λ c, ⟨⟨_, c, rfl⟩, c, rfl⟩,
+  obtain h' | h' := prod.lex_iff.1 h,
+  { exact psigma.lex.left _ _ h' },
+  { dsimp only [inv_image, (on)] at h' ⊢,
+    convert psigma.lex.right (⟨_, c', rfl⟩ : range f) _ using 1, swap,
+    exacts [⟨c, h'.1⟩, psigma.subtype_ext (subtype.ext h'.1) rfl, h'.2] }
+end
+
+lemma set.well_founded_on.prod_lex_of_well_founded_on_fiber (hα : s.well_founded_on (rα on f))
+  (hβ : ∀ a, (s ∩ f ⁻¹' {a}).well_founded_on (rβ on g)) :
+  s.well_founded_on (prod.lex rα rβ on λ c, (f c, g c)) :=
+begin
+  refine well_founded.prod_lex_of_well_founded_on_fiber hα
+    (λ a, subrelation.wf (λ b c h, _) (hβ a).on_fun),
+  exact λ x, ⟨x, x.1.2, x.2⟩,
+  assumption,
+end
+
+end prod_lex
+
+section sigma_lex
+variables {rι : ι → ι → Prop} {rπ : Π i, π i → π i → Prop} {f : γ → ι} {g : Π i, γ → π i}
+  {s : set γ}
+
+/-- Stronger version of `psigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+lemma well_founded.sigma_lex_of_well_founded_on_fiber (hι : well_founded (rι on f))
+  (hπ : ∀ i, (f ⁻¹' {i}).well_founded_on (rπ i on g i)) :
+  well_founded (sigma.lex rι rπ on λ c, ⟨f c, g (f c) c⟩) :=
+begin
+  refine ((psigma.lex_wf (well_founded_on_range.2 hι) $ λ a, hπ a).on_fun).mono (λ c c' h, _),
+  exact λ c, ⟨⟨_, c, rfl⟩, c, rfl⟩,
+  obtain h' | ⟨h', h''⟩ := sigma.lex_iff.1 h,
+  { exact psigma.lex.left _ _ h' },
+  { dsimp only [inv_image, (on)] at h' ⊢,
+    convert psigma.lex.right (⟨_, c', rfl⟩ : range f) _ using 1, swap,
+    { exact ⟨c, h'⟩ },
+    { exact psigma.subtype_ext (subtype.ext h') rfl },
+    { dsimp only [subtype.coe_mk] at *,
+      revert h',
+      generalize : f c = d,
+      rintro rfl _,
+      exact h'' } }
+end
+
+lemma set.well_founded_on.sigma_lex_of_well_founded_on_fiber (hι : s.well_founded_on (rι on f))
+  (hπ : ∀ i, (s ∩ f ⁻¹' {i}).well_founded_on (rπ i on g i)) :
+  s.well_founded_on (sigma.lex rι rπ on λ c, ⟨f c, g (f c) c⟩) :=
+begin
+  show well_founded (sigma.lex rι rπ on λ (c : s), ⟨f c, g (f c) c⟩),
+  refine @well_founded.sigma_lex_of_well_founded_on_fiber _ s _ _ rπ (λ c, f c) (λ i c, g _ c) hι
+    (λ i, subrelation.wf (λ b c h, _) (hπ i).on_fun),
+  exact λ x, ⟨x, x.1.2, x.2⟩,
+  assumption,
+end
+
+end sigma_lex

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -151,7 +151,7 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
 #align set.well_founded_on.mono Set.WellFoundedOn.mono
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a b «expr ∈ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (a b «expr ∈ » s) -/
 #print Set.WellFoundedOn.mono' /-
 theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
     s.WellFoundedOn r → s.WellFoundedOn r' :=
@@ -438,7 +438,7 @@ protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r)
 #align set.partially_well_ordered_on.insert Set.PartiallyWellOrderedOn.insert
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (t «expr ⊆ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (t «expr ⊆ » s) -/
 #print Set.partiallyWellOrderedOn_iff_finite_antichains /-
 theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ (t) (_ : t ⊆ s), IsAntichain r t → t.Finite :=
Diff
@@ -87,7 +87,7 @@ theorem wellFoundedOn_iff : s.WellFoundedOn r ↔ WellFounded fun a b : α => r
   rw [WellFounded.wellFounded_iff_has_min]
   intro t ht
   by_cases hst : (s ∩ t).Nonempty
-  · rw [← Subtype.preimage_coe_nonempty] at hst 
+  · rw [← Subtype.preimage_coe_nonempty] at hst
     rcases h.has_min (coe ⁻¹' t) hst with ⟨⟨m, ms⟩, mt, hm⟩
     exact ⟨m, mt, fun x xt ⟨xm, xs, ms⟩ => hm ⟨x, xs⟩ xt xm⟩
   · rcases ht with ⟨m, mt⟩
@@ -178,7 +178,7 @@ theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
   · refine' fun h => ⟨fun b => _⟩; apply InvImage.accessible
     rw [← acc_transGen_iff] at h ⊢
     obtain h' | h' := refl_trans_gen_iff_eq_or_trans_gen.1 b.2
-    · rwa [h'] at h ; · exact h.inv h'
+    · rwa [h'] at h; · exact h.inv h'
   tfae_have 2 → 3
   · exact fun h => h.Subset fun _ => trans_gen.to_refl
   tfae_have 3 → 1
@@ -514,7 +514,7 @@ theorem PartiallyWellOrderedOn.wellFoundedOn [IsPreorder α r] (h : s.PartiallyW
     { le := r
       le_refl := refl_of r
       le_trans := fun _ _ _ => trans_of r }
-  change s.well_founded_on (· < ·); change s.partially_well_ordered_on (· ≤ ·) at h 
+  change s.well_founded_on (· < ·); change s.partially_well_ordered_on (· ≤ ·) at h
   rw [well_founded_on_iff_no_descending_seq]
   intro f hf
   obtain ⟨m, n, hlt, hle⟩ := h f hf
@@ -725,7 +725,7 @@ protected theorem IsWF.isPWO (hs : s.IsWF) : s.IsPWO :=
   lift f to ℕ → s using hf
   have hrange : (range f).Nonempty := range_nonempty _
   rcases hs.has_min (range f) (range_nonempty _) with ⟨_, ⟨m, rfl⟩, hm⟩
-  simp only [forall_range_iff, not_lt] at hm 
+  simp only [forall_range_iff, not_lt] at hm
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWF.isPWO
 -/
@@ -1041,23 +1041,23 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
   · simp only [if_neg (lt_irrefl (g 0)), tsub_self]
     rw [List.length_tail, ← Nat.pred_eq_sub_one]
     exact Nat.pred_lt fun con => hnil _ (List.length_eq_zero.1 Con)
-  rw [is_bad_seq] at hf' 
-  push_neg at hf' 
+  rw [is_bad_seq] at hf'
+  push_neg at hf'
   obtain ⟨m, n, mn, hmn⟩ := hf' _
   swap
   · rintro n x hx
-    split_ifs at hx  with hn hn
+    split_ifs at hx with hn hn
     · exact hf1.1 _ _ hx
     · refine' hf1.1 _ _ (List.tail_subset _ hx)
   by_cases hn : n < g 0
   · apply hf1.2 m n mn
-    rwa [if_pos hn, if_pos (mn.trans hn)] at hmn 
+    rwa [if_pos hn, if_pos (mn.trans hn)] at hmn
   · obtain ⟨n', rfl⟩ := exists_add_of_le (not_lt.1 hn)
-    rw [if_neg hn, add_comm (g 0) n', add_tsub_cancel_right] at hmn 
-    split_ifs at hmn  with hm hm
+    rw [if_neg hn, add_comm (g 0) n', add_tsub_cancel_right] at hmn
+    split_ifs at hmn with hm hm
     · apply hf1.2 m (g n') (lt_of_lt_of_le hm (g.monotone n'.zero_le))
       exact trans hmn (List.tail_sublistForall₂_self _)
-    · rw [← tsub_lt_iff_left (le_of_not_lt hm)] at mn 
+    · rw [← tsub_lt_iff_left (le_of_not_lt hm)] at mn
       apply hf1.2 _ _ (g.lt_iff_lt.2 mn)
       rw [← List.cons_head!_tail (hnil (g (m - g 0))), ← List.cons_head!_tail (hnil (g n'))]
       exact List.SublistForall₂.cons (hg _ _ (le_of_lt mn)) hmn
Diff
@@ -482,7 +482,12 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
       ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
-  by classical
+  by
+  classical
+  constructor <;> intro h f hf
+  · exact h.exists_monotone_subseq f hf
+  · obtain ⟨g, gmon⟩ := h f hf
+    exact ⟨g 0, g 1, g.lt_iff_lt.2 zero_lt_one, gmon _ _ zero_le_one⟩
 #align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseq
 -/
 
@@ -949,6 +954,12 @@ noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (
     (hf : IsBadSeq r s f) :
     { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by
   classical
+  have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
+    ⟨_, f, fun _ _ => rfl, hf, rfl⟩
+  obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
+  refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
+  refine' Nat.find_min h _ ⟨g, fun m mn => (h1 m mn).trans (hg1 m mn), by convert Con, rfl⟩
+  rwa [← h3]
 #align set.partially_well_ordered_on.min_bad_seq_of_bad_seq Set.PartiallyWellOrderedOn.minBadSeqOfBadSeq
 -/
 
Diff
@@ -482,12 +482,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
       ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
-  by
-  classical
-  constructor <;> intro h f hf
-  · exact h.exists_monotone_subseq f hf
-  · obtain ⟨g, gmon⟩ := h f hf
-    exact ⟨g 0, g 1, g.lt_iff_lt.2 zero_lt_one, gmon _ _ zero_le_one⟩
+  by classical
 #align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseq
 -/
 
@@ -954,12 +949,6 @@ noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (
     (hf : IsBadSeq r s f) :
     { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by
   classical
-  have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
-    ⟨_, f, fun _ _ => rfl, hf, rfl⟩
-  obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
-  refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
-  refine' Nat.find_min h _ ⟨g, fun m mn => (h1 m mn).trans (hg1 m mn), by convert Con, rfl⟩
-  rwa [← h3]
 #align set.partially_well_ordered_on.min_bad_seq_of_bad_seq Set.PartiallyWellOrderedOn.minBadSeqOfBadSeq
 -/
 
Diff
@@ -252,30 +252,30 @@ section LT
 
 variable [LT α] {s t : Set α}
 
-#print Set.IsWf /-
+#print Set.IsWF /-
 /-- `s.is_wf` indicates that `<` is well-founded when restricted to `s`. -/
-def IsWf (s : Set α) : Prop :=
+def IsWF (s : Set α) : Prop :=
   WellFoundedOn s (· < ·)
-#align set.is_wf Set.IsWf
+#align set.is_wf Set.IsWF
 -/
 
-#print Set.isWf_empty /-
+#print Set.isWF_empty /-
 @[simp]
-theorem isWf_empty : IsWf (∅ : Set α) :=
+theorem isWF_empty : IsWF (∅ : Set α) :=
   wellFounded_of_isEmpty _
-#align set.is_wf_empty Set.isWf_empty
+#align set.is_wf_empty Set.isWF_empty
 -/
 
-#print Set.isWf_univ_iff /-
-theorem isWf_univ_iff : IsWf (univ : Set α) ↔ WellFounded ((· < ·) : α → α → Prop) := by
+#print Set.isWF_univ_iff /-
+theorem isWF_univ_iff : IsWF (univ : Set α) ↔ WellFounded ((· < ·) : α → α → Prop) := by
   simp [is_wf, well_founded_on_iff]
-#align set.is_wf_univ_iff Set.isWf_univ_iff
+#align set.is_wf_univ_iff Set.isWF_univ_iff
 -/
 
-#print Set.IsWf.mono /-
-theorem IsWf.mono (h : IsWf t) (st : s ⊆ t) : IsWf s :=
+#print Set.IsWF.mono /-
+theorem IsWF.mono (h : IsWF t) (st : s ⊆ t) : IsWF s :=
   h.Subset st
-#align set.is_wf.mono Set.IsWf.mono
+#align set.is_wf.mono Set.IsWF.mono
 -/
 
 end LT
@@ -284,17 +284,17 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-#print Set.IsWf.union /-
-protected theorem IsWf.union (hs : IsWf s) (ht : IsWf t) : IsWf (s ∪ t) :=
+#print Set.IsWF.union /-
+protected theorem IsWF.union (hs : IsWF s) (ht : IsWF t) : IsWF (s ∪ t) :=
   hs.union ht
-#align set.is_wf.union Set.IsWf.union
+#align set.is_wf.union Set.IsWF.union
 -/
 
-#print Set.isWf_union /-
+#print Set.isWF_union /-
 @[simp]
-theorem isWf_union : IsWf (s ∪ t) ↔ IsWf s ∧ IsWf t :=
+theorem isWF_union : IsWF (s ∪ t) ↔ IsWF s ∧ IsWF t :=
   wellFoundedOn_union
-#align set.is_wf_union Set.isWf_union
+#align set.is_wf_union Set.isWF_union
 -/
 
 end Preorder
@@ -303,13 +303,13 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-#print Set.isWf_iff_no_descending_seq /-
-theorem isWf_iff_no_descending_seq :
-    IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
+#print Set.isWF_iff_no_descending_seq /-
+theorem isWF_iff_no_descending_seq :
+    IsWF s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
   wellFoundedOn_iff_no_descending_seq.trans
     ⟨fun H f hf => H ⟨⟨f, hf.Injective⟩, fun a b => hf.lt_iff_lt⟩, fun H f =>
       H f fun _ _ => f.map_rel_iff.2⟩
-#align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seq
+#align set.is_wf_iff_no_descending_seq Set.isWF_iff_no_descending_seq
 -/
 
 end Preorder
@@ -528,149 +528,149 @@ section IsPwo
 
 variable [Preorder α] [Preorder β] {s t : Set α}
 
-#print Set.IsPwo /-
+#print Set.IsPWO /-
 /-- A subset of a preorder is partially well-ordered when any infinite sequence contains
   a monotone subsequence of length 2 (or equivalently, an infinite monotone subsequence). -/
-def IsPwo (s : Set α) : Prop :=
+def IsPWO (s : Set α) : Prop :=
   PartiallyWellOrderedOn s (· ≤ ·)
-#align set.is_pwo Set.IsPwo
+#align set.is_pwo Set.IsPWO
 -/
 
-#print Set.IsPwo.mono /-
-theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
+#print Set.IsPWO.mono /-
+theorem IsPWO.mono (ht : t.IsPWO) : s ⊆ t → s.IsPWO :=
   ht.mono
-#align set.is_pwo.mono Set.IsPwo.mono
+#align set.is_pwo.mono Set.IsPWO.mono
 -/
 
-#print Set.IsPwo.exists_monotone_subseq /-
-theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
+#print Set.IsPWO.exists_monotone_subseq /-
+theorem IsPWO.exists_monotone_subseq (h : s.IsPWO) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   h.exists_monotone_subseq f hf
-#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseq
+#align set.is_pwo.exists_monotone_subseq Set.IsPWO.exists_monotone_subseq
 -/
 
-#print Set.isPwo_iff_exists_monotone_subseq /-
-theorem isPwo_iff_exists_monotone_subseq :
-    s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
+#print Set.isPWO_iff_exists_monotone_subseq /-
+theorem isPWO_iff_exists_monotone_subseq :
+    s.IsPWO ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   partiallyWellOrderedOn_iff_exists_monotone_subseq
-#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
+#align set.is_pwo_iff_exists_monotone_subseq Set.isPWO_iff_exists_monotone_subseq
 -/
 
-#print Set.IsPwo.isWf /-
-protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
+#print Set.IsPWO.isWF /-
+protected theorem IsPWO.isWF (h : s.IsPWO) : s.IsWF := by
   simpa only [← lt_iff_le_not_le] using h.well_founded_on
-#align set.is_pwo.is_wf Set.IsPwo.isWf
+#align set.is_pwo.is_wf Set.IsPWO.isWF
 -/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print Set.IsPwo.prod /-
-theorem IsPwo.prod {t : Set β} (hs : s.IsPwo) (ht : t.IsPwo) : IsPwo (s ×ˢ t) :=
+#print Set.IsPWO.prod /-
+theorem IsPWO.prod {t : Set β} (hs : s.IsPWO) (ht : t.IsPWO) : IsPWO (s ×ˢ t) :=
   hs.Prod ht
-#align set.is_pwo.prod Set.IsPwo.prod
+#align set.is_pwo.prod Set.IsPWO.prod
 -/
 
-#print Set.IsPwo.image_of_monotoneOn /-
-theorem IsPwo.image_of_monotoneOn (hs : s.IsPwo) {f : α → β} (hf : MonotoneOn f s) :
-    IsPwo (f '' s) :=
+#print Set.IsPWO.image_of_monotoneOn /-
+theorem IsPWO.image_of_monotoneOn (hs : s.IsPWO) {f : α → β} (hf : MonotoneOn f s) :
+    IsPWO (f '' s) :=
   hs.image_of_monotone_on hf
-#align set.is_pwo.image_of_monotone_on Set.IsPwo.image_of_monotoneOn
+#align set.is_pwo.image_of_monotone_on Set.IsPWO.image_of_monotoneOn
 -/
 
-#print Set.IsPwo.image_of_monotone /-
-theorem IsPwo.image_of_monotone (hs : s.IsPwo) {f : α → β} (hf : Monotone f) : IsPwo (f '' s) :=
+#print Set.IsPWO.image_of_monotone /-
+theorem IsPWO.image_of_monotone (hs : s.IsPWO) {f : α → β} (hf : Monotone f) : IsPWO (f '' s) :=
   hs.image_of_monotone_on (hf.MonotoneOn _)
-#align set.is_pwo.image_of_monotone Set.IsPwo.image_of_monotone
+#align set.is_pwo.image_of_monotone Set.IsPWO.image_of_monotone
 -/
 
-#print Set.IsPwo.union /-
-protected theorem IsPwo.union (hs : IsPwo s) (ht : IsPwo t) : IsPwo (s ∪ t) :=
+#print Set.IsPWO.union /-
+protected theorem IsPWO.union (hs : IsPWO s) (ht : IsPWO t) : IsPWO (s ∪ t) :=
   hs.union ht
-#align set.is_pwo.union Set.IsPwo.union
+#align set.is_pwo.union Set.IsPWO.union
 -/
 
-#print Set.isPwo_union /-
+#print Set.isPWO_union /-
 @[simp]
-theorem isPwo_union : IsPwo (s ∪ t) ↔ IsPwo s ∧ IsPwo t :=
+theorem isPWO_union : IsPWO (s ∪ t) ↔ IsPWO s ∧ IsPWO t :=
   partiallyWellOrderedOn_union
-#align set.is_pwo_union Set.isPwo_union
+#align set.is_pwo_union Set.isPWO_union
 -/
 
-#print Set.Finite.isPwo /-
-protected theorem Finite.isPwo (hs : s.Finite) : IsPwo s :=
+#print Set.Finite.isPWO /-
+protected theorem Finite.isPWO (hs : s.Finite) : IsPWO s :=
   hs.PartiallyWellOrderedOn
-#align set.finite.is_pwo Set.Finite.isPwo
+#align set.finite.is_pwo Set.Finite.isPWO
 -/
 
-#print Set.isPwo_of_finite /-
+#print Set.isPWO_of_finite /-
 @[simp]
-theorem isPwo_of_finite [Finite α] : s.IsPwo :=
-  s.toFinite.IsPwo
-#align set.is_pwo_of_finite Set.isPwo_of_finite
+theorem isPWO_of_finite [Finite α] : s.IsPWO :=
+  s.toFinite.IsPWO
+#align set.is_pwo_of_finite Set.isPWO_of_finite
 -/
 
-#print Set.isPwo_singleton /-
+#print Set.isPWO_singleton /-
 @[simp]
-theorem isPwo_singleton (a : α) : IsPwo ({a} : Set α) :=
-  (finite_singleton a).IsPwo
-#align set.is_pwo_singleton Set.isPwo_singleton
+theorem isPWO_singleton (a : α) : IsPWO ({a} : Set α) :=
+  (finite_singleton a).IsPWO
+#align set.is_pwo_singleton Set.isPWO_singleton
 -/
 
-#print Set.isPwo_empty /-
+#print Set.isPWO_empty /-
 @[simp]
-theorem isPwo_empty : IsPwo (∅ : Set α) :=
-  finite_empty.IsPwo
-#align set.is_pwo_empty Set.isPwo_empty
+theorem isPWO_empty : IsPWO (∅ : Set α) :=
+  finite_empty.IsPWO
+#align set.is_pwo_empty Set.isPWO_empty
 -/
 
-#print Set.Subsingleton.isPwo /-
-protected theorem Subsingleton.isPwo (hs : s.Subsingleton) : IsPwo s :=
-  hs.Finite.IsPwo
-#align set.subsingleton.is_pwo Set.Subsingleton.isPwo
+#print Set.Subsingleton.isPWO /-
+protected theorem Subsingleton.isPWO (hs : s.Subsingleton) : IsPWO s :=
+  hs.Finite.IsPWO
+#align set.subsingleton.is_pwo Set.Subsingleton.isPWO
 -/
 
-#print Set.isPwo_insert /-
+#print Set.isPWO_insert /-
 @[simp]
-theorem isPwo_insert {a} : IsPwo (insert a s) ↔ IsPwo s := by
+theorem isPWO_insert {a} : IsPWO (insert a s) ↔ IsPWO s := by
   simp only [← singleton_union, is_pwo_union, is_pwo_singleton, true_and_iff]
-#align set.is_pwo_insert Set.isPwo_insert
+#align set.is_pwo_insert Set.isPWO_insert
 -/
 
-#print Set.IsPwo.insert /-
-protected theorem IsPwo.insert (h : IsPwo s) (a : α) : IsPwo (insert a s) :=
-  isPwo_insert.2 h
-#align set.is_pwo.insert Set.IsPwo.insert
+#print Set.IsPWO.insert /-
+protected theorem IsPWO.insert (h : IsPWO s) (a : α) : IsPWO (insert a s) :=
+  isPWO_insert.2 h
+#align set.is_pwo.insert Set.IsPWO.insert
 -/
 
-#print Set.Finite.isWf /-
-protected theorem Finite.isWf (hs : s.Finite) : IsWf s :=
-  hs.IsPwo.IsWf
-#align set.finite.is_wf Set.Finite.isWf
+#print Set.Finite.isWF /-
+protected theorem Finite.isWF (hs : s.Finite) : IsWF s :=
+  hs.IsPWO.IsWF
+#align set.finite.is_wf Set.Finite.isWF
 -/
 
-#print Set.isWf_singleton /-
+#print Set.isWF_singleton /-
 @[simp]
-theorem isWf_singleton {a : α} : IsWf ({a} : Set α) :=
-  (finite_singleton a).IsWf
-#align set.is_wf_singleton Set.isWf_singleton
+theorem isWF_singleton {a : α} : IsWF ({a} : Set α) :=
+  (finite_singleton a).IsWF
+#align set.is_wf_singleton Set.isWF_singleton
 -/
 
-#print Set.Subsingleton.isWf /-
-protected theorem Subsingleton.isWf (hs : s.Subsingleton) : IsWf s :=
-  hs.IsPwo.IsWf
-#align set.subsingleton.is_wf Set.Subsingleton.isWf
+#print Set.Subsingleton.isWF /-
+protected theorem Subsingleton.isWF (hs : s.Subsingleton) : IsWF s :=
+  hs.IsPWO.IsWF
+#align set.subsingleton.is_wf Set.Subsingleton.isWF
 -/
 
-#print Set.isWf_insert /-
+#print Set.isWF_insert /-
 @[simp]
-theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
+theorem isWF_insert {a} : IsWF (insert a s) ↔ IsWF s := by
   simp only [← singleton_union, is_wf_union, is_wf_singleton, true_and_iff]
-#align set.is_wf_insert Set.isWf_insert
+#align set.is_wf_insert Set.isWF_insert
 -/
 
-#print Set.IsWf.insert /-
-theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
-  isWf_insert.2 h
-#align set.is_wf.insert Set.IsWf.insert
+#print Set.IsWF.insert /-
+theorem IsWF.insert (h : IsWF s) (a : α) : IsWF (insert a s) :=
+  isWF_insert.2 h
+#align set.is_wf.insert Set.IsWF.insert
 -/
 
 end IsPwo
@@ -718,8 +718,8 @@ section LinearOrder
 
 variable [LinearOrder α] {s : Set α}
 
-#print Set.IsWf.isPwo /-
-protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
+#print Set.IsWF.isPWO /-
+protected theorem IsWF.isPWO (hs : s.IsWF) : s.IsPWO :=
   by
   intro f hf
   lift f to ℕ → s using hf
@@ -727,14 +727,14 @@ protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   rcases hs.has_min (range f) (range_nonempty _) with ⟨_, ⟨m, rfl⟩, hm⟩
   simp only [forall_range_iff, not_lt] at hm 
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
-#align set.is_wf.is_pwo Set.IsWf.isPwo
+#align set.is_wf.is_pwo Set.IsWF.isPWO
 -/
 
-#print Set.isWf_iff_isPwo /-
+#print Set.isWF_iff_isPWO /-
 /-- In a linear order, the predicates `set.is_wf` and `set.is_pwo` are equivalent. -/
-theorem isWf_iff_isPwo : s.IsWf ↔ s.IsPwo :=
-  ⟨IsWf.isPwo, IsPwo.isWf⟩
-#align set.is_wf_iff_is_pwo Set.isWf_iff_isPwo
+theorem isWF_iff_isPWO : s.IsWF ↔ s.IsPWO :=
+  ⟨IsWF.isPWO, IsPWO.isWF⟩
+#align set.is_wf_iff_is_pwo Set.isWF_iff_isPWO
 -/
 
 end LinearOrder
@@ -753,18 +753,18 @@ protected theorem partiallyWellOrderedOn [IsRefl α r] (s : Finset α) :
 #align finset.partially_well_ordered_on Finset.partiallyWellOrderedOn
 -/
 
-#print Finset.isPwo /-
+#print Finset.isPWO /-
 @[simp]
-protected theorem isPwo [Preorder α] (s : Finset α) : Set.IsPwo (↑s : Set α) :=
+protected theorem isPWO [Preorder α] (s : Finset α) : Set.IsPWO (↑s : Set α) :=
   s.PartiallyWellOrderedOn
-#align finset.is_pwo Finset.isPwo
+#align finset.is_pwo Finset.isPWO
 -/
 
-#print Finset.isWf /-
+#print Finset.isWF /-
 @[simp]
-protected theorem isWf [Preorder α] (s : Finset α) : Set.IsWf (↑s : Set α) :=
-  s.finite_toSet.IsWf
-#align finset.is_wf Finset.isWf
+protected theorem isWF [Preorder α] (s : Finset α) : Set.IsWF (↑s : Set α) :=
+  s.finite_toSet.IsWF
+#align finset.is_wf Finset.isWF
 -/
 
 #print Finset.wellFoundedOn /-
@@ -790,18 +790,18 @@ theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
 #align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_sup
 -/
 
-#print Finset.isWf_sup /-
-theorem isWf_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (s.sup f).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
+#print Finset.isWF_sup /-
+theorem isWF_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (s.sup f).IsWF ↔ ∀ i ∈ s, (f i).IsWF :=
   s.wellFoundedOn_sup
-#align finset.is_wf_sup Finset.isWf_sup
+#align finset.is_wf_sup Finset.isWF_sup
 -/
 
-#print Finset.isPwo_sup /-
-theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (s.sup f).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
+#print Finset.isPWO_sup /-
+theorem isPWO_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO :=
   s.partiallyWellOrderedOn_sup
-#align finset.is_pwo_sup Finset.isPwo_sup
+#align finset.is_pwo_sup Finset.isPWO_sup
 -/
 
 #print Finset.wellFoundedOn_bUnion /-
@@ -820,20 +820,20 @@ theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 -/
 
-#print Finset.isWf_bUnion /-
+#print Finset.isWF_bUnion /-
 @[simp]
-theorem isWf_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (⋃ i ∈ s, f i).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
+theorem isWF_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF :=
   s.wellFoundedOn_bUnion
-#align finset.is_wf_bUnion Finset.isWf_bUnion
+#align finset.is_wf_bUnion Finset.isWF_bUnion
 -/
 
-#print Finset.isPwo_bUnion /-
+#print Finset.isPWO_bUnion /-
 @[simp]
-theorem isPwo_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (⋃ i ∈ s, f i).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
+theorem isPWO_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (⋃ i ∈ s, f i).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO :=
   s.partiallyWellOrderedOn_bUnion
-#align finset.is_pwo_bUnion Finset.isPwo_bUnion
+#align finset.is_pwo_bUnion Finset.isPWO_bUnion
 -/
 
 end Finset
@@ -844,31 +844,31 @@ section Preorder
 
 variable [Preorder α] {s : Set α} {a : α}
 
-#print Set.IsWf.min /-
+#print Set.IsWF.min /-
 /-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
-noncomputable def IsWf.min (hs : IsWf s) (hn : s.Nonempty) : α :=
+noncomputable def IsWF.min (hs : IsWF s) (hn : s.Nonempty) : α :=
   hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)
-#align set.is_wf.min Set.IsWf.min
+#align set.is_wf.min Set.IsWF.min
 -/
 
-#print Set.IsWf.min_mem /-
-theorem IsWf.min_mem (hs : IsWf s) (hn : s.Nonempty) : hs.min hn ∈ s :=
+#print Set.IsWF.min_mem /-
+theorem IsWF.min_mem (hs : IsWF s) (hn : s.Nonempty) : hs.min hn ∈ s :=
   (WellFounded.min hs univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)).2
-#align set.is_wf.min_mem Set.IsWf.min_mem
+#align set.is_wf.min_mem Set.IsWF.min_mem
 -/
 
-#print Set.IsWf.not_lt_min /-
-theorem IsWf.not_lt_min (hs : IsWf s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
+#print Set.IsWF.not_lt_min /-
+theorem IsWF.not_lt_min (hs : IsWF s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
-#align set.is_wf.not_lt_min Set.IsWf.not_lt_min
+#align set.is_wf.not_lt_min Set.IsWF.not_lt_min
 -/
 
-#print Set.isWf_min_singleton /-
+#print Set.isWF_min_singleton /-
 @[simp]
-theorem isWf_min_singleton (a) {hs : IsWf ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
+theorem isWF_min_singleton (a) {hs : IsWF ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
-  eq_of_mem_singleton (IsWf.min_mem hs hn)
-#align set.is_wf_min_singleton Set.isWf_min_singleton
+  eq_of_mem_singleton (IsWF.min_mem hs hn)
+#align set.is_wf_min_singleton Set.isWF_min_singleton
 -/
 
 end Preorder
@@ -877,27 +877,27 @@ section LinearOrder
 
 variable [LinearOrder α] {s t : Set α} {a : α}
 
-#print Set.IsWf.min_le /-
-theorem IsWf.min_le (hs : s.IsWf) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
+#print Set.IsWF.min_le /-
+theorem IsWF.min_le (hs : s.IsWF) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
   le_of_not_lt (hs.not_lt_min hn ha)
-#align set.is_wf.min_le Set.IsWf.min_le
+#align set.is_wf.min_le Set.IsWF.min_le
 -/
 
-#print Set.IsWf.le_min_iff /-
-theorem IsWf.le_min_iff (hs : s.IsWf) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
+#print Set.IsWF.le_min_iff /-
+theorem IsWF.le_min_iff (hs : s.IsWF) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
   ⟨fun ha b hb => le_trans ha (hs.min_le hn hb), fun h => h _ (hs.min_mem _)⟩
-#align set.is_wf.le_min_iff Set.IsWf.le_min_iff
+#align set.is_wf.le_min_iff Set.IsWF.le_min_iff
 -/
 
-#print Set.IsWf.min_le_min_of_subset /-
-theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf} {htn : t.Nonempty}
+#print Set.IsWF.min_le_min_of_subset /-
+theorem IsWF.min_le_min_of_subset {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF} {htn : t.Nonempty}
     (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn :=
-  (IsWf.le_min_iff _ _).2 fun b hb => ht.min_le htn (hst hb)
-#align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
+  (IsWF.le_min_iff _ _).2 fun b hb => ht.min_le htn (hst hb)
+#align set.is_wf.min_le_min_of_subset Set.IsWF.min_le_min_of_subset
 -/
 
-#print Set.IsWf.min_union /-
-theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.Nonempty) :
+#print Set.IsWF.min_union /-
+theorem IsWF.min_union (hs : s.IsWF) (hsn : s.Nonempty) (ht : t.IsWF) (htn : t.Nonempty) :
     (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) = min (hs.min hsn) (ht.min htn) :=
   by
   refine'
@@ -909,7 +909,7 @@ theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.N
   exact
     ((mem_union _ _ _).1 ((hs.union ht).min_mem (union_nonempty.2 (Or.intro_left _ hsn)))).imp
       (hs.min_le _) (ht.min_le _)
-#align set.is_wf.min_union Set.IsWf.min_union
+#align set.is_wf.min_union Set.IsWF.min_union
 -/
 
 end LinearOrder
@@ -1066,21 +1066,21 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
 
 end Set.PartiallyWellOrderedOn
 
-#print WellFounded.isWf /-
-theorem WellFounded.isWf [LT α] (h : WellFounded ((· < ·) : α → α → Prop)) (s : Set α) : s.IsWf :=
-  (Set.isWf_univ_iff.2 h).mono s.subset_univ
-#align well_founded.is_wf WellFounded.isWf
+#print WellFounded.isWF /-
+theorem WellFounded.isWF [LT α] (h : WellFounded ((· < ·) : α → α → Prop)) (s : Set α) : s.IsWF :=
+  (Set.isWF_univ_iff.2 h).mono s.subset_univ
+#align well_founded.is_wf WellFounded.isWF
 -/
 
-#print Pi.isPwo /-
+#print Pi.isPWO /-
 /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
 ordered, when `σ` is a `fintype` and each `α s` is a linear well order.
 This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
 Some generalizations would be possible based on this proof, to include cases where the target is
 partially well ordered, and also to consider the case of `set.partially_well_ordered_on` instead of
 `set.is_pwo`. -/
-theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
-    [Finite ι] (s : Set (∀ i, α i)) : s.IsPwo :=
+theorem Pi.isPWO {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
+    [Finite ι] (s : Set (∀ i, α i)) : s.IsPWO :=
   by
   cases nonempty_fintype ι
   suffices
@@ -1095,11 +1095,11 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     simp only [IsEmpty.forall_iff, imp_true_iff, forall_const, Finset.not_mem_empty]
   · intro x s hx ih f
     obtain ⟨g, hg⟩ :=
-      (is_well_founded.wf.is_wf univ).IsPwo.exists_monotone_subseq (fun n => f n x) mem_univ
+      (is_well_founded.wf.is_wf univ).IsPWO.exists_monotone_subseq (fun n => f n x) mem_univ
     obtain ⟨g', hg'⟩ := ih (f ∘ g)
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
-#align pi.is_pwo Pi.isPwo
+#align pi.is_pwo Pi.isPWO
 -/
 
 section ProdLex
Diff
@@ -445,7 +445,7 @@ theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
   by
   refine' ⟨fun h t ht hrt => hrt.finite_of_partiallyWellOrderedOn (h.mono ht), _⟩
   rintro hs f hf
-  by_contra' H
+  by_contra! H
   refine' infinite_range_of_injective (fun m n hmn => _) (hs _ (range_subset_iff.2 hf) _)
   · obtain h | h | h := lt_trichotomy m n
     · refine' (H _ _ h _).elim
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2021 Aaron Anderson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
 -/
-import Mathbin.Data.Sigma.Lex
-import Mathbin.Order.Antichain
-import Mathbin.Order.OrderIsoNat
-import Mathbin.Order.WellFounded
-import Mathbin.Tactic.Tfae
+import Data.Sigma.Lex
+import Order.Antichain
+import Order.OrderIsoNat
+import Order.WellFounded
+import Tactic.Tfae
 
 #align_import order.well_founded_set from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
 
@@ -151,7 +151,7 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
 #align set.well_founded_on.mono Set.WellFoundedOn.mono
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a b «expr ∈ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a b «expr ∈ » s) -/
 #print Set.WellFoundedOn.mono' /-
 theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
     s.WellFoundedOn r → s.WellFoundedOn r' :=
@@ -438,7 +438,7 @@ protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r)
 #align set.partially_well_ordered_on.insert Set.PartiallyWellOrderedOn.insert
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (t «expr ⊆ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (t «expr ⊆ » s) -/
 #print Set.partiallyWellOrderedOn_iff_finite_antichains /-
 theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ (t) (_ : t ⊆ s), IsAntichain r t → t.Finite :=
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Aaron Anderson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
-
-! This file was ported from Lean 3 source module order.well_founded_set
-! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Sigma.Lex
 import Mathbin.Order.Antichain
@@ -14,6 +9,8 @@ import Mathbin.Order.OrderIsoNat
 import Mathbin.Order.WellFounded
 import Mathbin.Tactic.Tfae
 
+#align_import order.well_founded_set from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
+
 /-!
 # Well-founded sets
 
@@ -154,7 +151,7 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
 #align set.well_founded_on.mono Set.WellFoundedOn.mono
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a b «expr ∈ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a b «expr ∈ » s) -/
 #print Set.WellFoundedOn.mono' /-
 theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
     s.WellFoundedOn r → s.WellFoundedOn r' :=
@@ -441,7 +438,7 @@ protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r)
 #align set.partially_well_ordered_on.insert Set.PartiallyWellOrderedOn.insert
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (t «expr ⊆ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (t «expr ⊆ » s) -/
 #print Set.partiallyWellOrderedOn_iff_finite_antichains /-
 theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ (t) (_ : t ⊆ s), IsAntichain r t → t.Finite :=
Diff
@@ -98,15 +98,20 @@ theorem wellFoundedOn_iff : s.WellFoundedOn r ↔ WellFounded fun a b : α => r
 #align set.well_founded_on_iff Set.wellFoundedOn_iff
 -/
 
+#print Set.wellFoundedOn_univ /-
 @[simp]
 theorem wellFoundedOn_univ : (univ : Set α).WellFoundedOn r ↔ WellFounded r := by
   simp [well_founded_on_iff]
 #align set.well_founded_on_univ Set.wellFoundedOn_univ
+-/
 
+#print WellFounded.wellFoundedOn /-
 theorem WellFounded.wellFoundedOn : WellFounded r → s.WellFoundedOn r :=
   InvImage.wf _
 #align well_founded.well_founded_on WellFounded.wellFoundedOn
+-/
 
+#print Set.wellFoundedOn_range /-
 @[simp]
 theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f) :=
   by
@@ -118,11 +123,14 @@ theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f)
     exact ⟨c', rfl⟩
   · exact h.apply _
 #align set.well_founded_on_range Set.wellFoundedOn_range
+-/
 
+#print Set.wellFoundedOn_image /-
 @[simp]
 theorem wellFoundedOn_image {s : Set β} : (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f) := by
   rw [image_eq_range]; exact well_founded_on_range
 #align set.well_founded_on_image Set.wellFoundedOn_image
+-/
 
 namespace WellFoundedOn
 
@@ -147,10 +155,12 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
 -/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a b «expr ∈ » s) -/
+#print Set.WellFoundedOn.mono' /-
 theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
     s.WellFoundedOn r → s.WellFoundedOn r' :=
   Subrelation.wf fun a b => h _ a.2 _ b.2
 #align set.well_founded_on.mono' Set.WellFoundedOn.mono'
+-/
 
 #print Set.WellFoundedOn.subset /-
 theorem subset (h : t.WellFoundedOn r) (hst : s ⊆ t) : s.WellFoundedOn r :=
@@ -1099,6 +1109,7 @@ section ProdLex
 
 variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
 
+#print WellFounded.prod_lex_of_wellFoundedOn_fiber /-
 /-- Stronger version of `prod.lex_wf`. Instead of requiring `rβ on g` to be well-founded, we only
 require it to be well-founded on fibers of `f`.-/
 theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
@@ -1113,7 +1124,9 @@ theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f
     convert PSigma.Lex.right (⟨_, c', rfl⟩ : range f) _ using 1; swap
     exacts [⟨c, h'.1⟩, PSigma.subtype_ext (Subtype.ext h'.1) rfl, h'.2]
 #align well_founded.prod_lex_of_well_founded_on_fiber WellFounded.prod_lex_of_wellFoundedOn_fiber
+-/
 
+#print Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber /-
 theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn (rα on f))
     (hβ : ∀ a, (s ∩ f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
     s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) :=
@@ -1124,6 +1137,7 @@ theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn
   exact fun x => ⟨x, x.1.2, x.2⟩
   assumption
 #align set.well_founded_on.prod_lex_of_well_founded_on_fiber Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
+-/
 
 end ProdLex
 
@@ -1131,6 +1145,7 @@ section SigmaLex
 
 variable {rι : ι → ι → Prop} {rπ : ∀ i, π i → π i → Prop} {f : γ → ι} {g : ∀ i, γ → π i} {s : Set γ}
 
+#print WellFounded.sigma_lex_of_wellFoundedOn_fiber /-
 /-- Stronger version of `psigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
 require it to be well-founded on fibers of `f`.-/
 theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
@@ -1151,7 +1166,9 @@ theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on
       rintro rfl _
       exact h''
 #align well_founded.sigma_lex_of_well_founded_on_fiber WellFounded.sigma_lex_of_wellFoundedOn_fiber
+-/
 
+#print Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber /-
 theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f))
     (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
     s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) :=
@@ -1163,6 +1180,7 @@ theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedO
   exact fun x => ⟨x, x.1.2, x.2⟩
   assumption
 #align set.well_founded_on.sigma_lex_of_well_founded_on_fiber Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
+-/
 
 end SigmaLex
 
Diff
@@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
 
 ! This file was ported from Lean 3 source module order.well_founded_set
-! leanprover-community/mathlib commit f16e7a22e11fc09c71f25446ac1db23a24e8a0bd
+! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
+import Mathbin.Data.Sigma.Lex
 import Mathbin.Order.Antichain
 import Mathbin.Order.OrderIsoNat
 import Mathbin.Order.WellFounded
@@ -51,7 +52,7 @@ Prove that `s` is partial well ordered iff it has no infinite descending chain o
 -/
 
 
-variable {ι α β : Type _}
+variable {ι α β γ : Type _} {π : ι → Type _}
 
 namespace Set
 
@@ -78,7 +79,7 @@ variable {r r' : α → α → Prop}
 
 section AnyRel
 
-variable {s t : Set α} {x y : α}
+variable {f : β → α} {s t : Set α} {x y : α}
 
 #print Set.wellFoundedOn_iff /-
 theorem wellFoundedOn_iff : s.WellFoundedOn r ↔ WellFounded fun a b : α => r a b ∧ a ∈ s ∧ b ∈ s :=
@@ -97,6 +98,32 @@ theorem wellFoundedOn_iff : s.WellFoundedOn r ↔ WellFounded fun a b : α => r
 #align set.well_founded_on_iff Set.wellFoundedOn_iff
 -/
 
+@[simp]
+theorem wellFoundedOn_univ : (univ : Set α).WellFoundedOn r ↔ WellFounded r := by
+  simp [well_founded_on_iff]
+#align set.well_founded_on_univ Set.wellFoundedOn_univ
+
+theorem WellFounded.wellFoundedOn : WellFounded r → s.WellFoundedOn r :=
+  InvImage.wf _
+#align well_founded.well_founded_on WellFounded.wellFoundedOn
+
+@[simp]
+theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f) :=
+  by
+  let f' : β → range f := fun c => ⟨f c, c, rfl⟩
+  refine' ⟨fun h => (InvImage.wf f' h).mono fun c c' => id, fun h => ⟨_⟩⟩
+  rintro ⟨_, c, rfl⟩
+  refine' Acc.of_downward_closed f' _ _ _
+  · rintro _ ⟨_, c', rfl⟩ -
+    exact ⟨c', rfl⟩
+  · exact h.apply _
+#align set.well_founded_on_range Set.wellFoundedOn_range
+
+@[simp]
+theorem wellFoundedOn_image {s : Set β} : (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f) := by
+  rw [image_eq_range]; exact well_founded_on_range
+#align set.well_founded_on_image Set.wellFoundedOn_image
+
 namespace WellFoundedOn
 
 #print Set.WellFoundedOn.induction /-
@@ -119,6 +146,12 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
 #align set.well_founded_on.mono Set.WellFoundedOn.mono
 -/
 
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a b «expr ∈ » s) -/
+theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
+    s.WellFoundedOn r → s.WellFoundedOn r' :=
+  Subrelation.wf fun a b => h _ a.2 _ b.2
+#align set.well_founded_on.mono' Set.WellFoundedOn.mono'
+
 #print Set.WellFoundedOn.subset /-
 theorem subset (h : t.WellFoundedOn r) (hst : s ⊆ t) : s.WellFoundedOn r :=
   h.mono le_rfl hst
@@ -1062,3 +1095,74 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
 #align pi.is_pwo Pi.isPwo
 -/
 
+section ProdLex
+
+variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
+
+/-- Stronger version of `prod.lex_wf`. Instead of requiring `rβ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
+    (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
+    WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) :=
+  by
+  refine' (PSigma.lex_wf (well_founded_on_range.2 hα) fun a => hβ a).onFun.mono fun c c' h => _
+  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  obtain h' | h' := Prod.lex_iff.1 h
+  · exact PSigma.Lex.left _ _ h'
+  · dsimp only [InvImage, (· on ·)] at h' ⊢
+    convert PSigma.Lex.right (⟨_, c', rfl⟩ : range f) _ using 1; swap
+    exacts [⟨c, h'.1⟩, PSigma.subtype_ext (Subtype.ext h'.1) rfl, h'.2]
+#align well_founded.prod_lex_of_well_founded_on_fiber WellFounded.prod_lex_of_wellFoundedOn_fiber
+
+theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn (rα on f))
+    (hβ : ∀ a, (s ∩ f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
+    s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) :=
+  by
+  refine'
+    WellFounded.prod_lex_of_wellFoundedOn_fiber hα fun a =>
+      Subrelation.wf (fun b c h => _) (hβ a).onFun
+  exact fun x => ⟨x, x.1.2, x.2⟩
+  assumption
+#align set.well_founded_on.prod_lex_of_well_founded_on_fiber Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
+
+end ProdLex
+
+section SigmaLex
+
+variable {rι : ι → ι → Prop} {rπ : ∀ i, π i → π i → Prop} {f : γ → ι} {g : ∀ i, γ → π i} {s : Set γ}
+
+/-- Stronger version of `psigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
+    (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
+    WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) :=
+  by
+  refine' (PSigma.lex_wf (well_founded_on_range.2 hι) fun a => hπ a).onFun.mono fun c c' h => _
+  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  obtain h' | ⟨h', h''⟩ := Sigma.lex_iff.1 h
+  · exact PSigma.Lex.left _ _ h'
+  · dsimp only [InvImage, (· on ·)] at h' ⊢
+    convert PSigma.Lex.right (⟨_, c', rfl⟩ : range f) _ using 1; swap
+    · exact ⟨c, h'⟩
+    · exact PSigma.subtype_ext (Subtype.ext h') rfl
+    · dsimp only [Subtype.coe_mk] at *
+      revert h'
+      generalize f c = d
+      rintro rfl _
+      exact h''
+#align well_founded.sigma_lex_of_well_founded_on_fiber WellFounded.sigma_lex_of_wellFoundedOn_fiber
+
+theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f))
+    (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
+    s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) :=
+  by
+  show WellFounded (Sigma.Lex rι rπ on fun c : s => ⟨f c, g (f c) c⟩)
+  refine'
+    @WellFounded.sigma_lex_of_wellFoundedOn_fiber _ s _ _ rπ (fun c => f c) (fun i c => g _ c) hι
+      fun i => Subrelation.wf (fun b c h => _) (hπ i).onFun
+  exact fun x => ⟨x, x.1.2, x.2⟩
+  assumption
+#align set.well_founded_on.sigma_lex_of_well_founded_on_fiber Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
+
+end SigmaLex
+
Diff
@@ -165,6 +165,7 @@ instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈
 #align set.is_strict_order.subset Set.IsStrictOrder.subset
 -/
 
+#print Set.wellFoundedOn_iff_no_descending_seq /-
 theorem wellFoundedOn_iff_no_descending_seq :
     s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s :=
   by
@@ -179,7 +180,9 @@ theorem wellFoundedOn_iff_no_descending_seq :
     refine' ⟨⟨f, _⟩⟩
     simpa only [hfs, and_true_iff] using @hf
 #align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seq
+-/
 
+#print Set.WellFoundedOn.union /-
 theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
     (s ∪ t).WellFoundedOn r :=
   by
@@ -188,12 +191,15 @@ theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
   rcases Nat.exists_subseq_of_forall_mem_union f hf with ⟨g, hg | hg⟩
   exacts [hs (g.dual.lt_embedding.trans f) hg, ht (g.dual.lt_embedding.trans f) hg]
 #align set.well_founded_on.union Set.WellFoundedOn.union
+-/
 
+#print Set.wellFoundedOn_union /-
 @[simp]
 theorem wellFoundedOn_union : (s ∪ t).WellFoundedOn r ↔ s.WellFoundedOn r ∧ t.WellFoundedOn r :=
   ⟨fun h => ⟨h.Subset <| subset_union_left _ _, h.Subset <| subset_union_right _ _⟩, fun h =>
     h.1.union h.2⟩
 #align set.well_founded_on_union Set.wellFoundedOn_union
+-/
 
 end IsStrictOrder
 
@@ -238,14 +244,18 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
+#print Set.IsWf.union /-
 protected theorem IsWf.union (hs : IsWf s) (ht : IsWf t) : IsWf (s ∪ t) :=
   hs.union ht
 #align set.is_wf.union Set.IsWf.union
+-/
 
+#print Set.isWf_union /-
 @[simp]
 theorem isWf_union : IsWf (s ∪ t) ↔ IsWf s ∧ IsWf t :=
   wellFoundedOn_union
 #align set.is_wf_union Set.isWf_union
+-/
 
 end Preorder
 
@@ -298,6 +308,7 @@ theorem partiallyWellOrderedOn_empty (r : α → α → Prop) : PartiallyWellOrd
 #align set.partially_well_ordered_on_empty Set.partiallyWellOrderedOn_empty
 -/
 
+#print Set.PartiallyWellOrderedOn.union /-
 theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
     (ht : t.PartiallyWellOrderedOn r) : (s ∪ t).PartiallyWellOrderedOn r :=
   by
@@ -308,14 +319,18 @@ theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
   · rcases ht _ hgt with ⟨m, n, hlt, hr⟩
     exact ⟨g m, g n, g.strict_mono hlt, hr⟩
 #align set.partially_well_ordered_on.union Set.PartiallyWellOrderedOn.union
+-/
 
+#print Set.partiallyWellOrderedOn_union /-
 @[simp]
 theorem partiallyWellOrderedOn_union :
     (s ∪ t).PartiallyWellOrderedOn r ↔ s.PartiallyWellOrderedOn r ∧ t.PartiallyWellOrderedOn r :=
   ⟨fun h => ⟨h.mono <| subset_union_left _ _, h.mono <| subset_union_right _ _⟩, fun h =>
     h.1.union h.2⟩
 #align set.partially_well_ordered_on_union Set.partiallyWellOrderedOn_union
+-/
 
+#print Set.PartiallyWellOrderedOn.image_of_monotone_on /-
 theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrderedOn r)
     (hf : ∀ a₁ ∈ s, ∀ a₂ ∈ s, r a₁ a₂ → r' (f a₁) (f a₂)) : (f '' s).PartiallyWellOrderedOn r' :=
   by
@@ -325,6 +340,7 @@ theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrdered
   obtain ⟨m, n, hlt, hmn⟩ := hs g hgs
   exact ⟨m, n, hlt, hf _ (hgs m) _ (hgs n) hmn⟩
 #align set.partially_well_ordered_on.image_of_monotone_on Set.PartiallyWellOrderedOn.image_of_monotone_on
+-/
 
 #print IsAntichain.finite_of_partiallyWellOrderedOn /-
 theorem IsAntichain.finite_of_partiallyWellOrderedOn (ha : IsAntichain r s)
@@ -408,6 +424,7 @@ theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
 
 variable [IsTrans α r]
 
+#print Set.PartiallyWellOrderedOn.exists_monotone_subseq /-
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
   by
@@ -419,7 +436,9 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
     obtain ⟨m, n, hlt, hle⟩ := h (f ∘ g) fun n => hf _
     exact h2 m n hlt hle
 #align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseq
+-/
 
+#print Set.partiallyWellOrderedOn_iff_exists_monotone_subseq /-
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
       ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -430,6 +449,7 @@ theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
   · obtain ⟨g, gmon⟩ := h f hf
     exact ⟨g 0, g 1, g.lt_iff_lt.2 zero_lt_one, gmon _ _ zero_le_one⟩
 #align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseq
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 #print Set.PartiallyWellOrderedOn.prod /-
@@ -482,15 +502,19 @@ theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
 #align set.is_pwo.mono Set.IsPwo.mono
 -/
 
+#print Set.IsPwo.exists_monotone_subseq /-
 theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   h.exists_monotone_subseq f hf
 #align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseq
+-/
 
+#print Set.isPwo_iff_exists_monotone_subseq /-
 theorem isPwo_iff_exists_monotone_subseq :
     s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   partiallyWellOrderedOn_iff_exists_monotone_subseq
 #align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
+-/
 
 #print Set.IsPwo.isWf /-
 protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
@@ -499,27 +523,37 @@ protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
 -/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Set.IsPwo.prod /-
 theorem IsPwo.prod {t : Set β} (hs : s.IsPwo) (ht : t.IsPwo) : IsPwo (s ×ˢ t) :=
   hs.Prod ht
 #align set.is_pwo.prod Set.IsPwo.prod
+-/
 
+#print Set.IsPwo.image_of_monotoneOn /-
 theorem IsPwo.image_of_monotoneOn (hs : s.IsPwo) {f : α → β} (hf : MonotoneOn f s) :
     IsPwo (f '' s) :=
   hs.image_of_monotone_on hf
 #align set.is_pwo.image_of_monotone_on Set.IsPwo.image_of_monotoneOn
+-/
 
+#print Set.IsPwo.image_of_monotone /-
 theorem IsPwo.image_of_monotone (hs : s.IsPwo) {f : α → β} (hf : Monotone f) : IsPwo (f '' s) :=
   hs.image_of_monotone_on (hf.MonotoneOn _)
 #align set.is_pwo.image_of_monotone Set.IsPwo.image_of_monotone
+-/
 
+#print Set.IsPwo.union /-
 protected theorem IsPwo.union (hs : IsPwo s) (ht : IsPwo t) : IsPwo (s ∪ t) :=
   hs.union ht
 #align set.is_pwo.union Set.IsPwo.union
+-/
 
+#print Set.isPwo_union /-
 @[simp]
 theorem isPwo_union : IsPwo (s ∪ t) ↔ IsPwo s ∧ IsPwo t :=
   partiallyWellOrderedOn_union
 #align set.is_pwo_union Set.isPwo_union
+-/
 
 #print Set.Finite.isPwo /-
 protected theorem Finite.isPwo (hs : s.Finite) : IsPwo s :=
@@ -702,25 +736,33 @@ protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
 #align finset.well_founded_on Finset.wellFoundedOn
 -/
 
+#print Finset.wellFoundedOn_sup /-
 theorem wellFoundedOn_sup [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r :=
   Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bUnion, hs]
 #align finset.well_founded_on_sup Finset.wellFoundedOn_sup
+-/
 
+#print Finset.partiallyWellOrderedOn_sup /-
 theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
     (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r :=
   Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bUnion, hs]
 #align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_sup
+-/
 
+#print Finset.isWf_sup /-
 theorem isWf_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
   s.wellFoundedOn_sup
 #align finset.is_wf_sup Finset.isWf_sup
+-/
 
+#print Finset.isPwo_sup /-
 theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
   s.partiallyWellOrderedOn_sup
 #align finset.is_pwo_sup Finset.isPwo_sup
+-/
 
 #print Finset.wellFoundedOn_bUnion /-
 @[simp]
@@ -730,11 +772,13 @@ theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Se
 #align finset.well_founded_on_bUnion Finset.wellFoundedOn_bUnion
 -/
 
+#print Finset.partiallyWellOrderedOn_bUnion /-
 @[simp]
 theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r := by
   simpa only [Finset.sup_eq_iSup] using s.partially_well_ordered_on_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
+-/
 
 #print Finset.isWf_bUnion /-
 @[simp]
@@ -812,6 +856,7 @@ theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf}
 #align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
 -/
 
+#print Set.IsWf.min_union /-
 theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.Nonempty) :
     (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) = min (hs.min hsn) (ht.min htn) :=
   by
@@ -825,6 +870,7 @@ theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.N
     ((mem_union _ _ _).1 ((hs.union ht).min_mem (union_nonempty.2 (Or.intro_left _ hsn)))).imp
       (hs.min_le _) (ht.min_le _)
 #align set.is_wf.min_union Set.IsWf.min_union
+-/
 
 end LinearOrder
 
Diff
@@ -382,7 +382,7 @@ protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r)
 #align set.partially_well_ordered_on.insert Set.PartiallyWellOrderedOn.insert
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (t «expr ⊆ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (t «expr ⊆ » s) -/
 #print Set.partiallyWellOrderedOn_iff_finite_antichains /-
 theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ (t) (_ : t ⊆ s), IsAntichain r t → t.Finite :=
Diff
@@ -131,8 +131,8 @@ open Relation
 /-- `a` is accessible under the relation `r` iff `r` is well-founded on the downward transitive
   closure of `a` under `r` (including `a` or not). -/
 theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
-    [Acc r a, { b | ReflTransGen r b a }.WellFoundedOn r,
-        { b | TransGen r b a }.WellFoundedOn r].TFAE :=
+    [Acc r a, {b | ReflTransGen r b a}.WellFoundedOn r,
+        {b | TransGen r b a}.WellFoundedOn r].TFAE :=
   by
   tfae_have 1 → 2
   · refine' fun h => ⟨fun b => _⟩; apply InvImage.accessible
@@ -425,10 +425,10 @@ theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
       ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
   by
   classical
-    constructor <;> intro h f hf
-    · exact h.exists_monotone_subseq f hf
-    · obtain ⟨g, gmon⟩ := h f hf
-      exact ⟨g 0, g 1, g.lt_iff_lt.2 zero_lt_one, gmon _ _ zero_le_one⟩
+  constructor <;> intro h f hf
+  · exact h.exists_monotone_subseq f hf
+  · obtain ⟨g, gmon⟩ := h f hf
+    exact ⟨g 0, g 1, g.lt_iff_lt.2 zero_lt_one, gmon _ _ zero_le_one⟩
 #align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseq
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -868,12 +868,12 @@ noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (
     (hf : IsBadSeq r s f) :
     { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by
   classical
-    have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
-      ⟨_, f, fun _ _ => rfl, hf, rfl⟩
-    obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
-    refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
-    refine' Nat.find_min h _ ⟨g, fun m mn => (h1 m mn).trans (hg1 m mn), by convert Con, rfl⟩
-    rwa [← h3]
+  have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
+    ⟨_, f, fun _ _ => rfl, hf, rfl⟩
+  obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
+  refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
+  refine' Nat.find_min h _ ⟨g, fun m mn => (h1 m mn).trans (hg1 m mn), by convert Con, rfl⟩
+  rwa [← h3]
 #align set.partially_well_ordered_on.min_bad_seq_of_bad_seq Set.PartiallyWellOrderedOn.minBadSeqOfBadSeq
 -/
 
@@ -906,8 +906,8 @@ theorem exists_min_bad_of_exists_bad (r : α → α → Prop) (rk : α → ℕ)
   refine' ⟨fun n => (fs n).1 n, ⟨fun n => (fs n).2.1.1 n, fun m n mn => _⟩, fun n g hg1 hg2 => _⟩
   · dsimp
     rw [← Subtype.val_eq_coe, h m n (le_of_lt mn)]
-    convert(fs n).2.1.2 m n mn
-  · convert(fs n).2.2 g (fun m mn => Eq.trans _ (hg1 m mn)) (lt_of_lt_of_le hg2 le_rfl)
+    convert (fs n).2.1.2 m n mn
+  · convert (fs n).2.2 g (fun m mn => Eq.trans _ (hg1 m mn)) (lt_of_lt_of_le hg2 le_rfl)
     rw [← h m n (le_of_lt mn)]
 #align set.partially_well_ordered_on.exists_min_bad_of_exists_bad Set.PartiallyWellOrderedOn.exists_min_bad_of_exists_bad
 -/
@@ -931,7 +931,7 @@ theorem iff_not_exists_isMinBadSeq (rk : α → ℕ) {s : Set α} :
   `list.sublist_forall₂ r l₁ l₂` whenever `l₁` related pointwise by `r` to a sublist of `l₂`.  -/
 theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl α r] [IsTrans α r]
     {s : Set α} (h : s.PartiallyWellOrderedOn r) :
-    { l : List α | ∀ x, x ∈ l → x ∈ s }.PartiallyWellOrderedOn (List.SublistForall₂ r) :=
+    {l : List α | ∀ x, x ∈ l → x ∈ s}.PartiallyWellOrderedOn (List.SublistForall₂ r) :=
   by
   rcases s.eq_empty_or_nonempty with (rfl | ⟨as, has⟩)
   · apply partially_well_ordered_on.mono (Finset.partiallyWellOrderedOn {List.nil})
@@ -956,11 +956,11 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
     rw [List.length_tail, ← Nat.pred_eq_sub_one]
     exact Nat.pred_lt fun con => hnil _ (List.length_eq_zero.1 Con)
   rw [is_bad_seq] at hf' 
-  push_neg  at hf' 
+  push_neg at hf' 
   obtain ⟨m, n, mn, hmn⟩ := hf' _
   swap
   · rintro n x hx
-    split_ifs  at hx  with hn hn
+    split_ifs at hx  with hn hn
     · exact hf1.1 _ _ hx
     · refine' hf1.1 _ _ (List.tail_subset _ hx)
   by_cases hn : n < g 0
@@ -968,7 +968,7 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
     rwa [if_pos hn, if_pos (mn.trans hn)] at hmn 
   · obtain ⟨n', rfl⟩ := exists_add_of_le (not_lt.1 hn)
     rw [if_neg hn, add_comm (g 0) n', add_tsub_cancel_right] at hmn 
-    split_ifs  at hmn  with hm hm
+    split_ifs at hmn  with hm hm
     · apply hf1.2 m (g n') (lt_of_lt_of_le hm (g.monotone n'.zero_le))
       exact trans hmn (List.tail_sublistForall₂_self _)
     · rw [← tsub_lt_iff_left (le_of_not_lt hm)] at mn 
Diff
@@ -89,7 +89,7 @@ theorem wellFoundedOn_iff : s.WellFoundedOn r ↔ WellFounded fun a b : α => r
   rw [WellFounded.wellFounded_iff_has_min]
   intro t ht
   by_cases hst : (s ∩ t).Nonempty
-  · rw [← Subtype.preimage_coe_nonempty] at hst
+  · rw [← Subtype.preimage_coe_nonempty] at hst 
     rcases h.has_min (coe ⁻¹' t) hst with ⟨⟨m, ms⟩, mt, hm⟩
     exact ⟨m, mt, fun x xt ⟨xm, xs, ms⟩ => hm ⟨x, xs⟩ xt xm⟩
   · rcases ht with ⟨m, mt⟩
@@ -136,9 +136,9 @@ theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
   by
   tfae_have 1 → 2
   · refine' fun h => ⟨fun b => _⟩; apply InvImage.accessible
-    rw [← acc_transGen_iff] at h⊢
+    rw [← acc_transGen_iff] at h ⊢
     obtain h' | h' := refl_trans_gen_iff_eq_or_trans_gen.1 b.2
-    · rwa [h'] at h; · exact h.inv h'
+    · rwa [h'] at h ; · exact h.inv h'
   tfae_have 2 → 3
   · exact fun h => h.Subset fun _ => trans_gen.to_refl
   tfae_have 3 → 1
@@ -186,7 +186,7 @@ theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
   rw [well_founded_on_iff_no_descending_seq] at *
   rintro f hf
   rcases Nat.exists_subseq_of_forall_mem_union f hf with ⟨g, hg | hg⟩
-  exacts[hs (g.dual.lt_embedding.trans f) hg, ht (g.dual.lt_embedding.trans f) hg]
+  exacts [hs (g.dual.lt_embedding.trans f) hg, ht (g.dual.lt_embedding.trans f) hg]
 #align set.well_founded_on.union Set.WellFoundedOn.union
 
 @[simp]
@@ -414,7 +414,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
   obtain ⟨g, h1 | h2⟩ := exists_increasing_or_nonincreasing_subseq r f
   · refine' ⟨g, fun m n hle => _⟩
     obtain hlt | rfl := hle.lt_or_eq
-    exacts[h1 m n hlt, refl_of r _]
+    exacts [h1 m n hlt, refl_of r _]
   · exfalso
     obtain ⟨m, n, hlt, hle⟩ := h (f ∘ g) fun n => hf _
     exact h2 m n hlt hle
@@ -454,7 +454,7 @@ theorem PartiallyWellOrderedOn.wellFoundedOn [IsPreorder α r] (h : s.PartiallyW
     { le := r
       le_refl := refl_of r
       le_trans := fun _ _ _ => trans_of r }
-  change s.well_founded_on (· < ·); change s.partially_well_ordered_on (· ≤ ·) at h
+  change s.well_founded_on (· < ·); change s.partially_well_ordered_on (· ≤ ·) at h 
   rw [well_founded_on_iff_no_descending_seq]
   intro f hf
   obtain ⟨m, n, hlt, hle⟩ := h f hf
@@ -651,7 +651,7 @@ protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   lift f to ℕ → s using hf
   have hrange : (range f).Nonempty := range_nonempty _
   rcases hs.has_min (range f) (range_nonempty _) with ⟨_, ⟨m, rfl⟩, hm⟩
-  simp only [forall_range_iff, not_lt] at hm
+  simp only [forall_range_iff, not_lt] at hm 
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWf.isPwo
 -/
@@ -868,7 +868,7 @@ noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (
     (hf : IsBadSeq r s f) :
     { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by
   classical
-    have h : ∃ (k : ℕ)(g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
+    have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ is_bad_seq r s g ∧ rk (g n) = k :=
       ⟨_, f, fun _ _ => rfl, hf, rfl⟩
     obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
     refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
@@ -955,23 +955,23 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
   · simp only [if_neg (lt_irrefl (g 0)), tsub_self]
     rw [List.length_tail, ← Nat.pred_eq_sub_one]
     exact Nat.pred_lt fun con => hnil _ (List.length_eq_zero.1 Con)
-  rw [is_bad_seq] at hf'
-  push_neg  at hf'
+  rw [is_bad_seq] at hf' 
+  push_neg  at hf' 
   obtain ⟨m, n, mn, hmn⟩ := hf' _
   swap
   · rintro n x hx
-    split_ifs  at hx with hn hn
+    split_ifs  at hx  with hn hn
     · exact hf1.1 _ _ hx
     · refine' hf1.1 _ _ (List.tail_subset _ hx)
   by_cases hn : n < g 0
   · apply hf1.2 m n mn
-    rwa [if_pos hn, if_pos (mn.trans hn)] at hmn
+    rwa [if_pos hn, if_pos (mn.trans hn)] at hmn 
   · obtain ⟨n', rfl⟩ := exists_add_of_le (not_lt.1 hn)
-    rw [if_neg hn, add_comm (g 0) n', add_tsub_cancel_right] at hmn
-    split_ifs  at hmn with hm hm
+    rw [if_neg hn, add_comm (g 0) n', add_tsub_cancel_right] at hmn 
+    split_ifs  at hmn  with hm hm
     · apply hf1.2 m (g n') (lt_of_lt_of_le hm (g.monotone n'.zero_le))
       exact trans hmn (List.tail_sublistForall₂_self _)
-    · rw [← tsub_lt_iff_left (le_of_not_lt hm)] at mn
+    · rw [← tsub_lt_iff_left (le_of_not_lt hm)] at mn 
       apply hf1.2 _ _ (g.lt_iff_lt.2 mn)
       rw [← List.cons_head!_tail (hnil (g (m - g 0))), ← List.cons_head!_tail (hnil (g n'))]
       exact List.SublistForall₂.cons (hg _ _ (le_of_lt mn)) hmn
Diff
@@ -253,12 +253,14 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
+#print Set.isWf_iff_no_descending_seq /-
 theorem isWf_iff_no_descending_seq :
     IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
   wellFoundedOn_iff_no_descending_seq.trans
     ⟨fun H f hf => H ⟨⟨f, hf.Injective⟩, fun a b => hf.lt_iff_lt⟩, fun H f =>
       H f fun _ _ => f.map_rel_iff.2⟩
 #align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seq
+-/
 
 end Preorder
 
@@ -490,9 +492,11 @@ theorem isPwo_iff_exists_monotone_subseq :
   partiallyWellOrderedOn_iff_exists_monotone_subseq
 #align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
 
+#print Set.IsPwo.isWf /-
 protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
   simpa only [← lt_iff_le_not_le] using h.well_founded_on
 #align set.is_pwo.is_wf Set.IsPwo.isWf
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem IsPwo.prod {t : Set β} (hs : s.IsPwo) (ht : t.IsPwo) : IsPwo (s ×ˢ t) :=
@@ -563,27 +567,37 @@ protected theorem IsPwo.insert (h : IsPwo s) (a : α) : IsPwo (insert a s) :=
 #align set.is_pwo.insert Set.IsPwo.insert
 -/
 
+#print Set.Finite.isWf /-
 protected theorem Finite.isWf (hs : s.Finite) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.finite.is_wf Set.Finite.isWf
+-/
 
+#print Set.isWf_singleton /-
 @[simp]
 theorem isWf_singleton {a : α} : IsWf ({a} : Set α) :=
   (finite_singleton a).IsWf
 #align set.is_wf_singleton Set.isWf_singleton
+-/
 
+#print Set.Subsingleton.isWf /-
 protected theorem Subsingleton.isWf (hs : s.Subsingleton) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.subsingleton.is_wf Set.Subsingleton.isWf
+-/
 
+#print Set.isWf_insert /-
 @[simp]
 theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
   simp only [← singleton_union, is_wf_union, is_wf_singleton, true_and_iff]
 #align set.is_wf_insert Set.isWf_insert
+-/
 
+#print Set.IsWf.insert /-
 theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
   isWf_insert.2 h
 #align set.is_wf.insert Set.IsWf.insert
+-/
 
 end IsPwo
 
@@ -630,6 +644,7 @@ section LinearOrder
 
 variable [LinearOrder α] {s : Set α}
 
+#print Set.IsWf.isPwo /-
 protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   by
   intro f hf
@@ -639,11 +654,14 @@ protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   simp only [forall_range_iff, not_lt] at hm
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWf.isPwo
+-/
 
+#print Set.isWf_iff_isPwo /-
 /-- In a linear order, the predicates `set.is_wf` and `set.is_pwo` are equivalent. -/
 theorem isWf_iff_isPwo : s.IsWf ↔ s.IsPwo :=
   ⟨IsWf.isPwo, IsPwo.isWf⟩
 #align set.is_wf_iff_is_pwo Set.isWf_iff_isPwo
+-/
 
 end LinearOrder
 
@@ -668,10 +686,12 @@ protected theorem isPwo [Preorder α] (s : Finset α) : Set.IsPwo (↑s : Set α
 #align finset.is_pwo Finset.isPwo
 -/
 
+#print Finset.isWf /-
 @[simp]
 protected theorem isWf [Preorder α] (s : Finset α) : Set.IsWf (↑s : Set α) :=
   s.finite_toSet.IsWf
 #align finset.is_wf Finset.isWf
+-/
 
 #print Finset.wellFoundedOn /-
 @[simp]
@@ -716,11 +736,13 @@ theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
   simpa only [Finset.sup_eq_iSup] using s.partially_well_ordered_on_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
+#print Finset.isWf_bUnion /-
 @[simp]
 theorem isWf_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
   s.wellFoundedOn_bUnion
 #align finset.is_wf_bUnion Finset.isWf_bUnion
+-/
 
 #print Finset.isPwo_bUnion /-
 @[simp]
@@ -738,24 +760,32 @@ section Preorder
 
 variable [Preorder α] {s : Set α} {a : α}
 
+#print Set.IsWf.min /-
 /-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
 noncomputable def IsWf.min (hs : IsWf s) (hn : s.Nonempty) : α :=
   hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)
 #align set.is_wf.min Set.IsWf.min
+-/
 
+#print Set.IsWf.min_mem /-
 theorem IsWf.min_mem (hs : IsWf s) (hn : s.Nonempty) : hs.min hn ∈ s :=
   (WellFounded.min hs univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)).2
 #align set.is_wf.min_mem Set.IsWf.min_mem
+-/
 
+#print Set.IsWf.not_lt_min /-
 theorem IsWf.not_lt_min (hs : IsWf s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
 #align set.is_wf.not_lt_min Set.IsWf.not_lt_min
+-/
 
+#print Set.isWf_min_singleton /-
 @[simp]
 theorem isWf_min_singleton (a) {hs : IsWf ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
   eq_of_mem_singleton (IsWf.min_mem hs hn)
 #align set.is_wf_min_singleton Set.isWf_min_singleton
+-/
 
 end Preorder
 
@@ -763,18 +793,24 @@ section LinearOrder
 
 variable [LinearOrder α] {s t : Set α} {a : α}
 
+#print Set.IsWf.min_le /-
 theorem IsWf.min_le (hs : s.IsWf) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
   le_of_not_lt (hs.not_lt_min hn ha)
 #align set.is_wf.min_le Set.IsWf.min_le
+-/
 
+#print Set.IsWf.le_min_iff /-
 theorem IsWf.le_min_iff (hs : s.IsWf) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
   ⟨fun ha b hb => le_trans ha (hs.min_le hn hb), fun h => h _ (hs.min_mem _)⟩
 #align set.is_wf.le_min_iff Set.IsWf.le_min_iff
+-/
 
+#print Set.IsWf.min_le_min_of_subset /-
 theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf} {htn : t.Nonempty}
     (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn :=
   (IsWf.le_min_iff _ _).2 fun b hb => ht.min_le htn (hst hb)
 #align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
+-/
 
 theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.Nonempty) :
     (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) = min (hs.min hsn) (ht.min htn) :=
@@ -950,6 +986,7 @@ theorem WellFounded.isWf [LT α] (h : WellFounded ((· < ·) : α → α → Pro
 #align well_founded.is_wf WellFounded.isWf
 -/
 
+#print Pi.isPwo /-
 /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
 ordered, when `σ` is a `fintype` and each `α s` is a linear well order.
 This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
@@ -977,4 +1014,5 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
 #align pi.is_pwo Pi.isPwo
+-/
 
Diff
@@ -165,12 +165,6 @@ instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈
 #align set.is_strict_order.subset Set.IsStrictOrder.subset
 -/
 
-/- warning: set.well_founded_on_iff_no_descending_seq -> Set.wellFoundedOn_iff_no_descending_seq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r), Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (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 n) s))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) 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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r) Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r)) f n) s))
-Case conversion may be inaccurate. Consider using '#align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seqₓ'. -/
 theorem wellFoundedOn_iff_no_descending_seq :
     s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s :=
   by
@@ -186,12 +180,6 @@ theorem wellFoundedOn_iff_no_descending_seq :
     simpa only [hfs, and_true_iff] using @hf
 #align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seq
 
-/- warning: set.well_founded_on.union -> Set.WellFoundedOn.union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.WellFoundedOn.{u1} α s r) -> (Set.WellFoundedOn.{u1} α t r) -> (Set.WellFoundedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) r)
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.WellFoundedOn.{u1} α s r) -> (Set.WellFoundedOn.{u1} α t r) -> (Set.WellFoundedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) r)
-Case conversion may be inaccurate. Consider using '#align set.well_founded_on.union Set.WellFoundedOn.unionₓ'. -/
 theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
     (s ∪ t).WellFoundedOn r :=
   by
@@ -201,12 +189,6 @@ theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
   exacts[hs (g.dual.lt_embedding.trans f) hg, ht (g.dual.lt_embedding.trans f) hg]
 #align set.well_founded_on.union Set.WellFoundedOn.union
 
-/- warning: set.well_founded_on_union -> Set.wellFoundedOn_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) r) (And (Set.WellFoundedOn.{u1} α s r) (Set.WellFoundedOn.{u1} α t r))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) r) (And (Set.WellFoundedOn.{u1} α s r) (Set.WellFoundedOn.{u1} α t r))
-Case conversion may be inaccurate. Consider using '#align set.well_founded_on_union Set.wellFoundedOn_unionₓ'. -/
 @[simp]
 theorem wellFoundedOn_union : (s ∪ t).WellFoundedOn r ↔ s.WellFoundedOn r ∧ t.WellFoundedOn r :=
   ⟨fun h => ⟨h.Subset <| subset_union_left _ _, h.Subset <| subset_union_right _ _⟩, fun h =>
@@ -256,22 +238,10 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-/- warning: set.is_wf.union -> Set.IsWf.union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) t) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.union Set.IsWf.unionₓ'. -/
 protected theorem IsWf.union (hs : IsWf s) (ht : IsWf t) : IsWf (s ∪ t) :=
   hs.union ht
 #align set.is_wf.union Set.IsWf.union
 
-/- warning: set.is_wf_union -> Set.isWf_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (And (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) t))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) (And (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t))
-Case conversion may be inaccurate. Consider using '#align set.is_wf_union Set.isWf_unionₓ'. -/
 @[simp]
 theorem isWf_union : IsWf (s ∪ t) ↔ IsWf s ∧ IsWf t :=
   wellFoundedOn_union
@@ -283,12 +253,6 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-/- warning: set.is_wf_iff_no_descending_seq -> Set.isWf_iff_no_descending_seq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 f) -> (Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f (coeFn.{1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (OrderDual.{0} Nat)) => Nat -> (OrderDual.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 f) -> (Not (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => OrderDual.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
-Case conversion may be inaccurate. Consider using '#align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seqₓ'. -/
 theorem isWf_iff_no_descending_seq :
     IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
   wellFoundedOn_iff_no_descending_seq.trans
@@ -332,12 +296,6 @@ theorem partiallyWellOrderedOn_empty (r : α → α → Prop) : PartiallyWellOrd
 #align set.partially_well_ordered_on_empty Set.partiallyWellOrderedOn_empty
 -/
 
-/- warning: set.partially_well_ordered_on.union -> Set.PartiallyWellOrderedOn.union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} {t : Set.{u1} α}, (Set.PartiallyWellOrderedOn.{u1} α s r) -> (Set.PartiallyWellOrderedOn.{u1} α t r) -> (Set.PartiallyWellOrderedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) r)
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} {t : Set.{u1} α}, (Set.PartiallyWellOrderedOn.{u1} α s r) -> (Set.PartiallyWellOrderedOn.{u1} α t r) -> (Set.PartiallyWellOrderedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) r)
-Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.union Set.PartiallyWellOrderedOn.unionₓ'. -/
 theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
     (ht : t.PartiallyWellOrderedOn r) : (s ∪ t).PartiallyWellOrderedOn r :=
   by
@@ -349,12 +307,6 @@ theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
     exact ⟨g m, g n, g.strict_mono hlt, hr⟩
 #align set.partially_well_ordered_on.union Set.PartiallyWellOrderedOn.union
 
-/- warning: set.partially_well_ordered_on_union -> Set.partiallyWellOrderedOn_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) r) (And (Set.PartiallyWellOrderedOn.{u1} α s r) (Set.PartiallyWellOrderedOn.{u1} α t r))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) r) (And (Set.PartiallyWellOrderedOn.{u1} α s r) (Set.PartiallyWellOrderedOn.{u1} α t r))
-Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_union Set.partiallyWellOrderedOn_unionₓ'. -/
 @[simp]
 theorem partiallyWellOrderedOn_union :
     (s ∪ t).PartiallyWellOrderedOn r ↔ s.PartiallyWellOrderedOn r ∧ t.PartiallyWellOrderedOn r :=
@@ -362,12 +314,6 @@ theorem partiallyWellOrderedOn_union :
     h.1.union h.2⟩
 #align set.partially_well_ordered_on_union Set.partiallyWellOrderedOn_union
 
-/- warning: set.partially_well_ordered_on.image_of_monotone_on -> Set.PartiallyWellOrderedOn.image_of_monotone_on is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {r' : β -> β -> Prop} {f : α -> β} {s : Set.{u1} α}, (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (a₁ : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a₁ s) -> (forall (a₂ : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a₂ s) -> (r a₁ a₂) -> (r' (f a₁) (f a₂)))) -> (Set.PartiallyWellOrderedOn.{u2} β (Set.image.{u1, u2} α β f s) r')
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {r : α -> α -> Prop} {r' : β -> β -> Prop} {f : α -> β} {s : Set.{u2} α}, (Set.PartiallyWellOrderedOn.{u2} α s r) -> (forall (a₁ : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a₁ s) -> (forall (a₂ : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a₂ s) -> (r a₁ a₂) -> (r' (f a₁) (f a₂)))) -> (Set.PartiallyWellOrderedOn.{u1} β (Set.image.{u2, u1} α β f s) r')
-Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.image_of_monotone_on Set.PartiallyWellOrderedOn.image_of_monotone_onₓ'. -/
 theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrderedOn r)
     (hf : ∀ a₁ ∈ s, ∀ a₂ ∈ s, r a₁ a₂ → r' (f a₁) (f a₂)) : (f '' s).PartiallyWellOrderedOn r' :=
   by
@@ -460,9 +406,6 @@ theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
 
 variable [IsTrans α r]
 
-/- warning: set.partially_well_ordered_on.exists_monotone_subseq -> Set.PartiallyWellOrderedOn.exists_monotone_subseq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseqₓ'. -/
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
   by
@@ -475,9 +418,6 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
     exact h2 m n hlt hle
 #align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseq
 
-/- warning: set.partially_well_ordered_on_iff_exists_monotone_subseq -> Set.partiallyWellOrderedOn_iff_exists_monotone_subseq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseqₓ'. -/
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
       ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -540,86 +480,38 @@ theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
 #align set.is_pwo.mono Set.IsPwo.mono
 -/
 
-/- warning: set.is_pwo.exists_monotone_subseq -> Set.IsPwo.exists_monotone_subseq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseqₓ'. -/
 theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   h.exists_monotone_subseq f hf
 #align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseq
 
-/- warning: set.is_pwo_iff_exists_monotone_subseq -> Set.isPwo_iff_exists_monotone_subseq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseqₓ'. -/
 theorem isPwo_iff_exists_monotone_subseq :
     s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   partiallyWellOrderedOn_iff_exists_monotone_subseq
 #align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
 
-/- warning: set.is_pwo.is_wf -> Set.IsPwo.isWf is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.is_wf Set.IsPwo.isWfₓ'. -/
 protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
   simpa only [← lt_iff_le_not_le] using h.well_founded_on
 #align set.is_pwo.is_wf Set.IsPwo.isWf
 
-/- warning: set.is_pwo.prod -> Set.IsPwo.prod is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] {s : Set.{u1} α} {t : Set.{u2} β}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsPwo.{u2} β _inst_2 t) -> (Set.IsPwo.{max u1 u2} (Prod.{u1, u2} α β) (Prod.preorder.{u1, u2} α β _inst_1 _inst_2) (Set.prod.{u1, u2} α β s t))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] {s : Set.{u1} α} {t : Set.{u2} β}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsPwo.{u2} β _inst_2 t) -> (Set.IsPwo.{max u2 u1} (Prod.{u1, u2} α β) (Prod.instPreorderProd.{u1, u2} α β _inst_1 _inst_2) (Set.prod.{u1, u2} α β s t))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.prod Set.IsPwo.prodₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem IsPwo.prod {t : Set β} (hs : s.IsPwo) (ht : t.IsPwo) : IsPwo (s ×ˢ t) :=
   hs.Prod ht
 #align set.is_pwo.prod Set.IsPwo.prod
 
-/- warning: set.is_pwo.image_of_monotone_on -> Set.IsPwo.image_of_monotoneOn is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall {f : α -> β}, (MonotoneOn.{u1, u2} α β _inst_1 _inst_2 f s) -> (Set.IsPwo.{u2} β _inst_2 (Set.image.{u1, u2} α β f s)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] {s : Set.{u2} α}, (Set.IsPwo.{u2} α _inst_1 s) -> (forall {f : α -> β}, (MonotoneOn.{u2, u1} α β _inst_1 _inst_2 f s) -> (Set.IsPwo.{u1} β _inst_2 (Set.image.{u2, u1} α β f s)))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.image_of_monotone_on Set.IsPwo.image_of_monotoneOnₓ'. -/
 theorem IsPwo.image_of_monotoneOn (hs : s.IsPwo) {f : α → β} (hf : MonotoneOn f s) :
     IsPwo (f '' s) :=
   hs.image_of_monotone_on hf
 #align set.is_pwo.image_of_monotone_on Set.IsPwo.image_of_monotoneOn
 
-/- warning: set.is_pwo.image_of_monotone -> Set.IsPwo.image_of_monotone is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall {f : α -> β}, (Monotone.{u1, u2} α β _inst_1 _inst_2 f) -> (Set.IsPwo.{u2} β _inst_2 (Set.image.{u1, u2} α β f s)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] {s : Set.{u2} α}, (Set.IsPwo.{u2} α _inst_1 s) -> (forall {f : α -> β}, (Monotone.{u2, u1} α β _inst_1 _inst_2 f) -> (Set.IsPwo.{u1} β _inst_2 (Set.image.{u2, u1} α β f s)))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.image_of_monotone Set.IsPwo.image_of_monotoneₓ'. -/
 theorem IsPwo.image_of_monotone (hs : s.IsPwo) {f : α → β} (hf : Monotone f) : IsPwo (f '' s) :=
   hs.image_of_monotone_on (hf.MonotoneOn _)
 #align set.is_pwo.image_of_monotone Set.IsPwo.image_of_monotone
 
-/- warning: set.is_pwo.union -> Set.IsPwo.union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsPwo.{u1} α _inst_1 t) -> (Set.IsPwo.{u1} α _inst_1 (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsPwo.{u1} α _inst_1 t) -> (Set.IsPwo.{u1} α _inst_1 (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo.union Set.IsPwo.unionₓ'. -/
 protected theorem IsPwo.union (hs : IsPwo s) (ht : IsPwo t) : IsPwo (s ∪ t) :=
   hs.union ht
 #align set.is_pwo.union Set.IsPwo.union
 
-/- warning: set.is_pwo_union -> Set.isPwo_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (And (Set.IsPwo.{u1} α _inst_1 s) (Set.IsPwo.{u1} α _inst_1 t))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) (And (Set.IsPwo.{u1} α _inst_1 s) (Set.IsPwo.{u1} α _inst_1 t))
-Case conversion may be inaccurate. Consider using '#align set.is_pwo_union Set.isPwo_unionₓ'. -/
 @[simp]
 theorem isPwo_union : IsPwo (s ∪ t) ↔ IsPwo s ∧ IsPwo t :=
   partiallyWellOrderedOn_union
@@ -671,54 +563,24 @@ protected theorem IsPwo.insert (h : IsPwo s) (a : α) : IsPwo (insert a s) :=
 #align set.is_pwo.insert Set.IsPwo.insert
 -/
 
-/- warning: set.finite.is_wf -> Set.Finite.isWf is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Finite.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Finite.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
-Case conversion may be inaccurate. Consider using '#align set.finite.is_wf Set.Finite.isWfₓ'. -/
 protected theorem Finite.isWf (hs : s.Finite) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.finite.is_wf Set.Finite.isWf
 
-/- warning: set.is_wf_singleton -> Set.isWf_singleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α}, Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α}, Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)
-Case conversion may be inaccurate. Consider using '#align set.is_wf_singleton Set.isWf_singletonₓ'. -/
 @[simp]
 theorem isWf_singleton {a : α} : IsWf ({a} : Set α) :=
   (finite_singleton a).IsWf
 #align set.is_wf_singleton Set.isWf_singleton
 
-/- warning: set.subsingleton.is_wf -> Set.Subsingleton.isWf is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Subsingleton.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Subsingleton.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
-Case conversion may be inaccurate. Consider using '#align set.subsingleton.is_wf Set.Subsingleton.isWfₓ'. -/
 protected theorem Subsingleton.isWf (hs : s.Subsingleton) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.subsingleton.is_wf Set.Subsingleton.isWf
 
-/- warning: set.is_wf_insert -> Set.isWf_insert is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s)) (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s)) (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
-Case conversion may be inaccurate. Consider using '#align set.is_wf_insert Set.isWf_insertₓ'. -/
 @[simp]
 theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
   simp only [← singleton_union, is_wf_union, is_wf_singleton, true_and_iff]
 #align set.is_wf_insert Set.isWf_insert
 
-/- warning: set.is_wf.insert -> Set.IsWf.insert is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (forall (a : α), Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (forall (a : α), Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.insert Set.IsWf.insertₓ'. -/
 theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
   isWf_insert.2 h
 #align set.is_wf.insert Set.IsWf.insert
@@ -768,12 +630,6 @@ section LinearOrder
 
 variable [LinearOrder α] {s : Set α}
 
-/- warning: set.is_wf.is_pwo -> Set.IsWf.isPwo is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) -> (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) -> (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s)
-Case conversion may be inaccurate. Consider using '#align set.is_wf.is_pwo Set.IsWf.isPwoₓ'. -/
 protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   by
   intro f hf
@@ -784,12 +640,6 @@ protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWf.isPwo
 
-/- warning: set.is_wf_iff_is_pwo -> Set.isWf_iff_isPwo is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s)
-Case conversion may be inaccurate. Consider using '#align set.is_wf_iff_is_pwo Set.isWf_iff_isPwoₓ'. -/
 /-- In a linear order, the predicates `set.is_wf` and `set.is_pwo` are equivalent. -/
 theorem isWf_iff_isPwo : s.IsWf ↔ s.IsPwo :=
   ⟨IsWf.isPwo, IsPwo.isWf⟩
@@ -818,12 +668,6 @@ protected theorem isPwo [Preorder α] (s : Finset α) : Set.IsPwo (↑s : Set α
 #align finset.is_pwo Finset.isPwo
 -/
 
-/- warning: finset.is_wf -> Finset.isWf is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (s : Finset.{u1} α), Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (s : Finset.{u1} α), Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Finset.toSet.{u1} α s)
-Case conversion may be inaccurate. Consider using '#align finset.is_wf Finset.isWfₓ'. -/
 @[simp]
 protected theorem isWf [Preorder α] (s : Finset α) : Set.IsWf (↑s : Set α) :=
   s.finite_toSet.IsWf
@@ -838,45 +682,21 @@ protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
 #align finset.well_founded_on Finset.wellFoundedOn
 -/
 
-/- warning: finset.well_founded_on_sup -> Finset.wellFoundedOn_sup is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u2} α r] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.WellFoundedOn.{u2} α (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f) r) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.WellFoundedOn.{u2} α (f i) r))
-but is expected to have type
-  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u2} α r] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.WellFoundedOn.{u2} α (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α))))))) (BoundedOrder.toOrderBot.{u2} (Set.{u2} α) (Preorder.toLE.{u2} (Set.{u2} α) (PartialOrder.toPreorder.{u2} (Set.{u2} α) (SemilatticeSup.toPartialOrder.{u2} (Set.{u2} α) (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))))))) (CompleteLattice.toBoundedOrder.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))) s f) r) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.WellFoundedOn.{u2} α (f i) r))
-Case conversion may be inaccurate. Consider using '#align finset.well_founded_on_sup Finset.wellFoundedOn_supₓ'. -/
 theorem wellFoundedOn_sup [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r :=
   Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bUnion, hs]
 #align finset.well_founded_on_sup Finset.wellFoundedOn_sup
 
-/- warning: finset.partially_well_ordered_on_sup -> Finset.partiallyWellOrderedOn_sup is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.PartiallyWellOrderedOn.{u2} α (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f) r) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.PartiallyWellOrderedOn.{u2} α (f i) r))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} {r : α -> α -> Prop} (s : Finset.{u2} ι) {f : ι -> (Set.{u1} α)}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Finset.sup.{u1, u2} (Set.{u1} α) ι (Lattice.toSemilatticeSup.{u1} (Set.{u1} α) (ConditionallyCompleteLattice.toLattice.{u1} (Set.{u1} α) (CompleteLattice.toConditionallyCompleteLattice.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α))))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} α) (Preorder.toLE.{u1} (Set.{u1} α) (PartialOrder.toPreorder.{u1} (Set.{u1} α) (SemilatticeSup.toPartialOrder.{u1} (Set.{u1} α) (Lattice.toSemilatticeSup.{u1} (Set.{u1} α) (ConditionallyCompleteLattice.toLattice.{u1} (Set.{u1} α) (CompleteLattice.toConditionallyCompleteLattice.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) s f) r) (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Set.PartiallyWellOrderedOn.{u1} α (f i) r))
-Case conversion may be inaccurate. Consider using '#align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_supₓ'. -/
 theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
     (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r :=
   Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bUnion, hs]
 #align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_sup
 
-/- warning: finset.is_wf_sup -> Finset.isWf_sup is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f)) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (f i)))
-but is expected to have type
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α))))))) (BoundedOrder.toOrderBot.{u2} (Set.{u2} α) (Preorder.toLE.{u2} (Set.{u2} α) (PartialOrder.toPreorder.{u2} (Set.{u2} α) (SemilatticeSup.toPartialOrder.{u2} (Set.{u2} α) (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))))))) (CompleteLattice.toBoundedOrder.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))) s f)) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (f i)))
-Case conversion may be inaccurate. Consider using '#align finset.is_wf_sup Finset.isWf_supₓ'. -/
 theorem isWf_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
   s.wellFoundedOn_sup
 #align finset.is_wf_sup Finset.isWf_sup
 
-/- warning: finset.is_pwo_sup -> Finset.isPwo_sup is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsPwo.{u2} α _inst_1 (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f)) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsPwo.{u2} α _inst_1 (f i)))
-but is expected to have type
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsPwo.{u2} α _inst_1 (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α))))))) (BoundedOrder.toOrderBot.{u2} (Set.{u2} α) (Preorder.toLE.{u2} (Set.{u2} α) (PartialOrder.toPreorder.{u2} (Set.{u2} α) (SemilatticeSup.toPartialOrder.{u2} (Set.{u2} α) (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))))))) (CompleteLattice.toBoundedOrder.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))) s f)) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.IsPwo.{u2} α _inst_1 (f i)))
-Case conversion may be inaccurate. Consider using '#align finset.is_pwo_sup Finset.isPwo_supₓ'. -/
 theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
   s.partiallyWellOrderedOn_sup
@@ -890,24 +710,12 @@ theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Se
 #align finset.well_founded_on_bUnion Finset.wellFoundedOn_bUnion
 -/
 
-/- warning: finset.partially_well_ordered_on_bUnion -> Finset.partiallyWellOrderedOn_bUnion is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.PartiallyWellOrderedOn.{u2} α (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (fun (H : Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) => f i))) r) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.PartiallyWellOrderedOn.{u2} α (f i) r))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} {r : α -> α -> Prop} (s : Finset.{u2} ι) {f : ι -> (Set.{u1} α)}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Set.iUnion.{u1, succ u2} α ι (fun (i : ι) => Set.iUnion.{u1, 0} α (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) (fun (H : Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) => f i))) r) (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Set.PartiallyWellOrderedOn.{u1} α (f i) r))
-Case conversion may be inaccurate. Consider using '#align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnionₓ'. -/
 @[simp]
 theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r := by
   simpa only [Finset.sup_eq_iSup] using s.partially_well_ordered_on_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
-/- warning: finset.is_wf_bUnion -> Finset.isWf_bUnion is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (fun (H : Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) => f i)))) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (f i)))
-but is expected to have type
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) (fun (H : Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) => f i)))) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (f i)))
-Case conversion may be inaccurate. Consider using '#align finset.is_wf_bUnion Finset.isWf_bUnionₓ'. -/
 @[simp]
 theorem isWf_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
@@ -930,43 +738,19 @@ section Preorder
 
 variable [Preorder α] {s : Set α} {a : α}
 
-/- warning: set.is_wf.min -> Set.IsWf.min is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (Set.Nonempty.{u1} α s) -> α
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (Set.Nonempty.{u1} α s) -> α
-Case conversion may be inaccurate. Consider using '#align set.is_wf.min Set.IsWf.minₓ'. -/
 /-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
 noncomputable def IsWf.min (hs : IsWf s) (hn : s.Nonempty) : α :=
   hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)
 #align set.is_wf.min Set.IsWf.min
 
-/- warning: set.is_wf.min_mem -> Set.IsWf.min_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Set.IsWf.min.{u1} α _inst_1 s hs hn) s
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Set.IsWf.min.{u1} α _inst_1 s hs hn) s
-Case conversion may be inaccurate. Consider using '#align set.is_wf.min_mem Set.IsWf.min_memₓ'. -/
 theorem IsWf.min_mem (hs : IsWf s) (hn : s.Nonempty) : hs.min hn ∈ s :=
   (WellFounded.min hs univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)).2
 #align set.is_wf.min_mem Set.IsWf.min_mem
 
-/- warning: set.is_wf.not_lt_min -> Set.IsWf.not_lt_min is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (Not (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) a (Set.IsWf.min.{u1} α _inst_1 s hs hn)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (Not (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) a (Set.IsWf.min.{u1} α _inst_1 s hs hn)))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.not_lt_min Set.IsWf.not_lt_minₓ'. -/
 theorem IsWf.not_lt_min (hs : IsWf s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
 #align set.is_wf.not_lt_min Set.IsWf.not_lt_min
 
-/- warning: set.is_wf_min_singleton -> Set.isWf_min_singleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (a : α) {hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)} {hn : Set.Nonempty.{u1} α (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)}, Eq.{succ u1} α (Set.IsWf.min.{u1} α _inst_1 (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a) hs hn) a
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (a : α) {hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)} {hn : Set.Nonempty.{u1} α (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)}, Eq.{succ u1} α (Set.IsWf.min.{u1} α _inst_1 (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a) hs hn) a
-Case conversion may be inaccurate. Consider using '#align set.is_wf_min_singleton Set.isWf_min_singletonₓ'. -/
 @[simp]
 theorem isWf_min_singleton (a) {hs : IsWf ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
@@ -979,43 +763,19 @@ section LinearOrder
 
 variable [LinearOrder α] {s t : Set α} {a : α}
 
-/- warning: set.is_wf.min_le -> Set.IsWf.min_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hn : Set.Nonempty.{u1} α s), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hn) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hn : Set.Nonempty.{u1} α s), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hn) a)
-Case conversion may be inaccurate. Consider using '#align set.is_wf.min_le Set.IsWf.min_leₓ'. -/
 theorem IsWf.min_le (hs : s.IsWf) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
   le_of_not_lt (hs.not_lt_min hn ha)
 #align set.is_wf.min_le Set.IsWf.min_le
 
-/- warning: set.is_wf.le_min_iff -> Set.IsWf.le_min_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hn : Set.Nonempty.{u1} α s), Iff (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) a (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hn)) (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) a b))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hn : Set.Nonempty.{u1} α s), Iff (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) a (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hn)) (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) a b))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.le_min_iff Set.IsWf.le_min_iffₓ'. -/
 theorem IsWf.le_min_iff (hs : s.IsWf) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
   ⟨fun ha b hb => le_trans ha (hs.min_le hn hb), fun h => h _ (hs.min_mem _)⟩
 #align set.is_wf.le_min_iff Set.IsWf.le_min_iff
 
-/- warning: set.is_wf.min_le_min_of_subset -> Set.IsWf.min_le_min_of_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} {hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s} {hsn : Set.Nonempty.{u1} α s} {ht : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) t} {htn : Set.Nonempty.{u1} α t}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) s t) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) t ht htn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hsn))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} {hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s} {hsn : Set.Nonempty.{u1} α s} {ht : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) t} {htn : Set.Nonempty.{u1} α t}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) s t) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) t ht htn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hsn))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subsetₓ'. -/
 theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf} {htn : t.Nonempty}
     (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn :=
   (IsWf.le_min_iff _ _).2 fun b hb => ht.min_le htn (hst hb)
 #align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
 
-/- warning: set.is_wf.min_union -> Set.IsWf.min_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hsn : Set.Nonempty.{u1} α s) (ht : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) t) (htn : Set.Nonempty.{u1} α t), Eq.{succ u1} α (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) (Set.IsWf.union.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s t hs ht) (Iff.mpr (Set.Nonempty.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Or (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t)) (Set.union_nonempty.{u1} α s t) (Or.intro_left (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t) hsn))) (LinearOrder.min.{u1} α _inst_1 (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hsn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) t ht htn))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hsn : Set.Nonempty.{u1} α s) (ht : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) t) (htn : Set.Nonempty.{u1} α t), Eq.{succ u1} α (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) (Set.IsWf.union.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s t hs ht) (Iff.mpr (Set.Nonempty.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) (Or (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t)) (Set.union_nonempty.{u1} α s t) (Or.intro_left (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t) hsn))) (Min.min.{u1} α (LinearOrder.toMin.{u1} α _inst_1) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hsn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) t ht htn))
-Case conversion may be inaccurate. Consider using '#align set.is_wf.min_union Set.IsWf.min_unionₓ'. -/
 theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.Nonempty) :
     (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) = min (hs.min hsn) (ht.min htn) :=
   by
@@ -1190,12 +950,6 @@ theorem WellFounded.isWf [LT α] (h : WellFounded ((· < ·) : α → α → Pro
 #align well_founded.is_wf WellFounded.isWf
 -/
 
-/- warning: pi.is_pwo -> Pi.isPwo is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : ι -> Type.{u2}} [_inst_1 : forall (i : ι), LinearOrder.{u2} (α i)] [_inst_2 : forall (i : ι), IsWellOrder.{u2} (α i) (LT.lt.{u2} (α i) (Preorder.toHasLt.{u2} (α i) (PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (LinearOrder.toLattice.{u2} (α i) (_inst_1 i)))))))] [_inst_3 : Finite.{succ u1} ι] (s : Set.{max u1 u2} (forall (i : ι), α i)), Set.IsPwo.{max u1 u2} (forall (i : ι), α i) (Pi.preorder.{u1, u2} ι (fun (i : ι) => α i) (fun (i : ι) => PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (LinearOrder.toLattice.{u2} (α i) (_inst_1 i)))))) s
-but is expected to have type
-  forall {ι : Type.{u1}} {α : ι -> Type.{u2}} [_inst_1 : forall (i : ι), LinearOrder.{u2} (α i)] [_inst_2 : forall (i : ι), IsWellOrder.{u2} (α i) (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.9686 : α i) (x._@.Mathlib.Order.WellFoundedSet._hyg.9688 : α i) => LT.lt.{u2} (α i) (Preorder.toLT.{u2} (α i) (PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (DistribLattice.toLattice.{u2} (α i) (instDistribLattice.{u2} (α i) (_inst_1 i))))))) x._@.Mathlib.Order.WellFoundedSet._hyg.9686 x._@.Mathlib.Order.WellFoundedSet._hyg.9688)] [_inst_3 : Finite.{succ u1} ι] (s : Set.{max u1 u2} (forall (i : ι), α i)), Set.IsPwo.{max u1 u2} (forall (i : ι), α i) (Pi.preorder.{u1, u2} ι (fun (i : ι) => α i) (fun (i : ι) => PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (DistribLattice.toLattice.{u2} (α i) (instDistribLattice.{u2} (α i) (_inst_1 i))))))) s
-Case conversion may be inaccurate. Consider using '#align pi.is_pwo Pi.isPwoₓ'. -/
 /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
 ordered, when `σ` is a `fintype` and each `α s` is a linear well order.
 This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
Diff
@@ -135,12 +135,10 @@ theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
         { b | TransGen r b a }.WellFoundedOn r].TFAE :=
   by
   tfae_have 1 → 2
-  · refine' fun h => ⟨fun b => _⟩
-    apply InvImage.accessible
+  · refine' fun h => ⟨fun b => _⟩; apply InvImage.accessible
     rw [← acc_transGen_iff] at h⊢
     obtain h' | h' := refl_trans_gen_iff_eq_or_trans_gen.1 b.2
-    · rwa [h'] at h
-    · exact h.inv h'
+    · rwa [h'] at h; · exact h.inv h'
   tfae_have 2 → 3
   · exact fun h => h.Subset fun _ => trans_gen.to_refl
   tfae_have 3 → 1
@@ -1216,8 +1214,7 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     refine' is_pwo_iff_exists_monotone_subseq.2 fun f hf => _
     simpa only [Finset.mem_univ, true_imp_iff] using this Finset.univ f
   refine' Finset.cons_induction _ _
-  · intro f
-    exists RelEmbedding.refl (· ≤ ·)
+  · intro f; exists RelEmbedding.refl (· ≤ ·)
     simp only [IsEmpty.forall_iff, imp_true_iff, forall_const, Finset.not_mem_empty]
   · intro x s hx ih f
     obtain ⟨g, hg⟩ :=
Diff
@@ -463,10 +463,7 @@ theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
 variable [IsTrans α r]
 
 /- warning: set.partially_well_ordered_on.exists_monotone_subseq -> Set.PartiallyWellOrderedOn.exists_monotone_subseq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
+<too large>
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseqₓ'. -/
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -481,10 +478,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 #align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseq
 
 /- warning: set.partially_well_ordered_on_iff_exists_monotone_subseq -> Set.partiallyWellOrderedOn_iff_exists_monotone_subseq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
+<too large>
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseqₓ'. -/
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
Diff
@@ -171,7 +171,7 @@ instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r), Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (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 n) s))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) 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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r) Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r)) f n) s))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.869 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) 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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r) Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r)) f n) s))
 Case conversion may be inaccurate. Consider using '#align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seqₓ'. -/
 theorem wellFoundedOn_iff_no_descending_seq :
     s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s :=
@@ -289,7 +289,7 @@ variable [Preorder α] {s t : Set α} {a : α}
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 f) -> (Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f (coeFn.{1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (OrderDual.{0} Nat)) => Nat -> (OrderDual.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 f) -> (Not (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => OrderDual.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 f) -> (Not (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => OrderDual.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
 Case conversion may be inaccurate. Consider using '#align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seqₓ'. -/
 theorem isWf_iff_no_descending_seq :
     IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
@@ -466,7 +466,7 @@ variable [IsTrans α r]
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseqₓ'. -/
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -484,7 +484,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseqₓ'. -/
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
@@ -552,7 +552,7 @@ theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseqₓ'. -/
 theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
@@ -563,7 +563,7 @@ theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n,
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseqₓ'. -/
 theorem isPwo_iff_exists_monotone_subseq :
     s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
Diff
@@ -260,7 +260,7 @@ variable [Preorder α] {s t : Set α} {a : α}
 
 /- warning: set.is_wf.union -> Set.IsWf.union is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) t) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t))
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t))
 Case conversion may be inaccurate. Consider using '#align set.is_wf.union Set.IsWf.unionₓ'. -/
@@ -270,7 +270,7 @@ protected theorem IsWf.union (hs : IsWf s) (ht : IsWf t) : IsWf (s ∪ t) :=
 
 /- warning: set.is_wf_union -> Set.isWf_union is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (And (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (And (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) t))
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) (And (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) t))
 Case conversion may be inaccurate. Consider using '#align set.is_wf_union Set.isWf_unionₓ'. -/
@@ -285,14 +285,18 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-#print Set.isWf_iff_no_descending_seq /-
+/- warning: set.is_wf_iff_no_descending_seq -> Set.isWf_iff_no_descending_seq is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 f) -> (Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f (coeFn.{1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (OrderDual.{0} Nat)) => Nat -> (OrderDual.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (forall (f : Nat -> α), (StrictAnti.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 f) -> (Not (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (OrderDual.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => OrderDual.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (OrderDual.{0} Nat)) (OrderDual.toDual.{0} Nat) n)) s)))
+Case conversion may be inaccurate. Consider using '#align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seqₓ'. -/
 theorem isWf_iff_no_descending_seq :
     IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
   wellFoundedOn_iff_no_descending_seq.trans
     ⟨fun H f hf => H ⟨⟨f, hf.Injective⟩, fun a b => hf.lt_iff_lt⟩, fun H f =>
       H f fun _ _ => f.map_rel_iff.2⟩
 #align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seq
--/
 
 end Preorder
 
@@ -566,11 +570,15 @@ theorem isPwo_iff_exists_monotone_subseq :
   partiallyWellOrderedOn_iff_exists_monotone_subseq
 #align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
 
-#print Set.IsPwo.isWf /-
+/- warning: set.is_pwo.is_wf -> Set.IsPwo.isWf is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
+Case conversion may be inaccurate. Consider using '#align set.is_pwo.is_wf Set.IsPwo.isWfₓ'. -/
 protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
   simpa only [← lt_iff_le_not_le] using h.well_founded_on
 #align set.is_pwo.is_wf Set.IsPwo.isWf
--/
 
 /- warning: set.is_pwo.prod -> Set.IsPwo.prod is a dubious translation:
 lean 3 declaration is
@@ -671,37 +679,57 @@ protected theorem IsPwo.insert (h : IsPwo s) (a : α) : IsPwo (insert a s) :=
 #align set.is_pwo.insert Set.IsPwo.insert
 -/
 
-#print Set.Finite.isWf /-
+/- warning: set.finite.is_wf -> Set.Finite.isWf is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Finite.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Finite.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
+Case conversion may be inaccurate. Consider using '#align set.finite.is_wf Set.Finite.isWfₓ'. -/
 protected theorem Finite.isWf (hs : s.Finite) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.finite.is_wf Set.Finite.isWf
--/
 
-#print Set.isWf_singleton /-
+/- warning: set.is_wf_singleton -> Set.isWf_singleton is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α}, Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α}, Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)
+Case conversion may be inaccurate. Consider using '#align set.is_wf_singleton Set.isWf_singletonₓ'. -/
 @[simp]
 theorem isWf_singleton {a : α} : IsWf ({a} : Set α) :=
   (finite_singleton a).IsWf
 #align set.is_wf_singleton Set.isWf_singleton
--/
 
-#print Set.Subsingleton.isWf /-
+/- warning: set.subsingleton.is_wf -> Set.Subsingleton.isWf is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Subsingleton.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.Subsingleton.{u1} α s) -> (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
+Case conversion may be inaccurate. Consider using '#align set.subsingleton.is_wf Set.Subsingleton.isWfₓ'. -/
 protected theorem Subsingleton.isWf (hs : s.Subsingleton) : IsWf s :=
   hs.IsPwo.IsWf
 #align set.subsingleton.is_wf Set.Subsingleton.isWf
--/
 
-#print Set.isWf_insert /-
+/- warning: set.is_wf_insert -> Set.isWf_insert is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s)) (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s)) (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s)
+Case conversion may be inaccurate. Consider using '#align set.is_wf_insert Set.isWf_insertₓ'. -/
 @[simp]
 theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
   simp only [← singleton_union, is_wf_union, is_wf_singleton, true_and_iff]
 #align set.is_wf_insert Set.isWf_insert
--/
 
-#print Set.IsWf.insert /-
+/- warning: set.is_wf.insert -> Set.IsWf.insert is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (forall (a : α), Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (forall (a : α), Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s))
+Case conversion may be inaccurate. Consider using '#align set.is_wf.insert Set.IsWf.insertₓ'. -/
 theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
   isWf_insert.2 h
 #align set.is_wf.insert Set.IsWf.insert
--/
 
 end IsPwo
 
@@ -748,7 +776,12 @@ section LinearOrder
 
 variable [LinearOrder α] {s : Set α}
 
-#print Set.IsWf.isPwo /-
+/- warning: set.is_wf.is_pwo -> Set.IsWf.isPwo is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) -> (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) -> (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s)
+Case conversion may be inaccurate. Consider using '#align set.is_wf.is_pwo Set.IsWf.isPwoₓ'. -/
 protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   by
   intro f hf
@@ -758,14 +791,17 @@ protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo :=
   simp only [forall_range_iff, not_lt] at hm
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWf.isPwo
--/
 
-#print Set.isWf_iff_isPwo /-
+/- warning: set.is_wf_iff_is_pwo -> Set.isWf_iff_isPwo is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (Set.IsPwo.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s)
+Case conversion may be inaccurate. Consider using '#align set.is_wf_iff_is_pwo Set.isWf_iff_isPwoₓ'. -/
 /-- In a linear order, the predicates `set.is_wf` and `set.is_pwo` are equivalent. -/
 theorem isWf_iff_isPwo : s.IsWf ↔ s.IsPwo :=
   ⟨IsWf.isPwo, IsPwo.isWf⟩
 #align set.is_wf_iff_is_pwo Set.isWf_iff_isPwo
--/
 
 end LinearOrder
 
@@ -790,12 +826,16 @@ protected theorem isPwo [Preorder α] (s : Finset α) : Set.IsPwo (↑s : Set α
 #align finset.is_pwo Finset.isPwo
 -/
 
-#print Finset.isWf /-
+/- warning: finset.is_wf -> Finset.isWf is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (s : Finset.{u1} α), Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (s : Finset.{u1} α), Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Finset.toSet.{u1} α s)
+Case conversion may be inaccurate. Consider using '#align finset.is_wf Finset.isWfₓ'. -/
 @[simp]
 protected theorem isWf [Preorder α] (s : Finset α) : Set.IsWf (↑s : Set α) :=
   s.finite_toSet.IsWf
 #align finset.is_wf Finset.isWf
--/
 
 #print Finset.wellFoundedOn /-
 @[simp]
@@ -830,7 +870,7 @@ theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
 
 /- warning: finset.is_wf_sup -> Finset.isWf_sup is a dubious translation:
 lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f)) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (f i)))
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.completeBooleanAlgebra.{u2} α))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u2} (Set.{u2} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u2} (Set.{u2} α) (Set.booleanAlgebra.{u2} α))) s f)) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (f i)))
 but is expected to have type
   forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (Finset.sup.{u2, u1} (Set.{u2} α) ι (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α))))))) (BoundedOrder.toOrderBot.{u2} (Set.{u2} α) (Preorder.toLE.{u2} (Set.{u2} α) (PartialOrder.toPreorder.{u2} (Set.{u2} α) (SemilatticeSup.toPartialOrder.{u2} (Set.{u2} α) (Lattice.toSemilatticeSup.{u2} (Set.{u2} α) (ConditionallyCompleteLattice.toLattice.{u2} (Set.{u2} α) (CompleteLattice.toConditionallyCompleteLattice.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))))))) (CompleteLattice.toBoundedOrder.{u2} (Set.{u2} α) (Order.Coframe.toCompleteLattice.{u2} (Set.{u2} α) (CompleteDistribLattice.toCoframe.{u2} (Set.{u2} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u2} (Set.{u2} α) (Set.instCompleteBooleanAlgebraSet.{u2} α)))))) s f)) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (f i)))
 Case conversion may be inaccurate. Consider using '#align finset.is_wf_sup Finset.isWf_supₓ'. -/
@@ -870,13 +910,17 @@ theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
   simpa only [Finset.sup_eq_iSup] using s.partially_well_ordered_on_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
-#print Finset.isWf_bUnion /-
+/- warning: finset.is_wf_bUnion -> Finset.isWf_bUnion is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (fun (H : Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) => f i)))) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toHasLt.{u2} α _inst_1) (f i)))
+but is expected to have type
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Preorder.{u2} α] (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) (fun (H : Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) => f i)))) (forall (i : ι), (Membership.mem.{u1, u1} ι (Finset.{u1} ι) (Finset.instMembershipFinset.{u1} ι) i s) -> (Set.IsWf.{u2} α (Preorder.toLT.{u2} α _inst_1) (f i)))
+Case conversion may be inaccurate. Consider using '#align finset.is_wf_bUnion Finset.isWf_bUnionₓ'. -/
 @[simp]
 theorem isWf_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
   s.wellFoundedOn_bUnion
 #align finset.is_wf_bUnion Finset.isWf_bUnion
--/
 
 #print Finset.isPwo_bUnion /-
 @[simp]
@@ -894,32 +938,48 @@ section Preorder
 
 variable [Preorder α] {s : Set α} {a : α}
 
-#print Set.IsWf.min /-
+/- warning: set.is_wf.min -> Set.IsWf.min is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) -> (Set.Nonempty.{u1} α s) -> α
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) -> (Set.Nonempty.{u1} α s) -> α
+Case conversion may be inaccurate. Consider using '#align set.is_wf.min Set.IsWf.minₓ'. -/
 /-- `is_wf.min` returns a minimal element of a nonempty well-founded set. -/
 noncomputable def IsWf.min (hs : IsWf s) (hn : s.Nonempty) : α :=
   hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)
 #align set.is_wf.min Set.IsWf.min
--/
 
-#print Set.IsWf.min_mem /-
+/- warning: set.is_wf.min_mem -> Set.IsWf.min_mem is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Set.IsWf.min.{u1} α _inst_1 s hs hn) s
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Set.IsWf.min.{u1} α _inst_1 s hs hn) s
+Case conversion may be inaccurate. Consider using '#align set.is_wf.min_mem Set.IsWf.min_memₓ'. -/
 theorem IsWf.min_mem (hs : IsWf s) (hn : s.Nonempty) : hs.min hn ∈ s :=
   (WellFounded.min hs univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)).2
 #align set.is_wf.min_mem Set.IsWf.min_mem
--/
 
-#print Set.IsWf.not_lt_min /-
+/- warning: set.is_wf.not_lt_min -> Set.IsWf.not_lt_min is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (Not (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) a (Set.IsWf.min.{u1} α _inst_1 s hs hn)))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) s) (hn : Set.Nonempty.{u1} α s), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (Not (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) a (Set.IsWf.min.{u1} α _inst_1 s hs hn)))
+Case conversion may be inaccurate. Consider using '#align set.is_wf.not_lt_min Set.IsWf.not_lt_minₓ'. -/
 theorem IsWf.not_lt_min (hs : IsWf s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
 #align set.is_wf.not_lt_min Set.IsWf.not_lt_min
--/
 
-#print Set.isWf_min_singleton /-
+/- warning: set.is_wf_min_singleton -> Set.isWf_min_singleton is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (a : α) {hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)} {hn : Set.Nonempty.{u1} α (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a)}, Eq.{succ u1} α (Set.IsWf.min.{u1} α _inst_1 (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a) hs hn) a
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] (a : α) {hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α _inst_1) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)} {hn : Set.Nonempty.{u1} α (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a)}, Eq.{succ u1} α (Set.IsWf.min.{u1} α _inst_1 (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) a) hs hn) a
+Case conversion may be inaccurate. Consider using '#align set.is_wf_min_singleton Set.isWf_min_singletonₓ'. -/
 @[simp]
 theorem isWf_min_singleton (a) {hs : IsWf ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
   eq_of_mem_singleton (IsWf.min_mem hs hn)
 #align set.is_wf_min_singleton Set.isWf_min_singleton
--/
 
 end Preorder
 
@@ -927,28 +987,40 @@ section LinearOrder
 
 variable [LinearOrder α] {s t : Set α} {a : α}
 
-#print Set.IsWf.min_le /-
+/- warning: set.is_wf.min_le -> Set.IsWf.min_le is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hn : Set.Nonempty.{u1} α s), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hn) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hn : Set.Nonempty.{u1} α s), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hn) a)
+Case conversion may be inaccurate. Consider using '#align set.is_wf.min_le Set.IsWf.min_leₓ'. -/
 theorem IsWf.min_le (hs : s.IsWf) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
   le_of_not_lt (hs.not_lt_min hn ha)
 #align set.is_wf.min_le Set.IsWf.min_le
--/
 
-#print Set.IsWf.le_min_iff /-
+/- warning: set.is_wf.le_min_iff -> Set.IsWf.le_min_iff is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hn : Set.Nonempty.{u1} α s), Iff (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) a (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hn)) (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) a b))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {a : α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hn : Set.Nonempty.{u1} α s), Iff (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) a (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hn)) (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) a b))
+Case conversion may be inaccurate. Consider using '#align set.is_wf.le_min_iff Set.IsWf.le_min_iffₓ'. -/
 theorem IsWf.le_min_iff (hs : s.IsWf) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
   ⟨fun ha b hb => le_trans ha (hs.min_le hn hb), fun h => h _ (hs.min_mem _)⟩
 #align set.is_wf.le_min_iff Set.IsWf.le_min_iff
--/
 
-#print Set.IsWf.min_le_min_of_subset /-
+/- warning: set.is_wf.min_le_min_of_subset -> Set.IsWf.min_le_min_of_subset is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} {hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s} {hsn : Set.Nonempty.{u1} α s} {ht : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) t} {htn : Set.Nonempty.{u1} α t}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) s t) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) t ht htn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hsn))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} {hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s} {hsn : Set.Nonempty.{u1} α s} {ht : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) t} {htn : Set.Nonempty.{u1} α t}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) s t) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) t ht htn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hsn))
+Case conversion may be inaccurate. Consider using '#align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subsetₓ'. -/
 theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf} {htn : t.Nonempty}
     (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn :=
   (IsWf.le_min_iff _ _).2 fun b hb => ht.min_le htn (hst hb)
 #align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
--/
 
 /- warning: set.is_wf.min_union -> Set.IsWf.min_union is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hsn : Set.Nonempty.{u1} α s) (ht : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) t) (htn : Set.Nonempty.{u1} α t), Eq.{succ u1} α (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) (Set.IsWf.union.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s t hs ht) (Iff.mpr (Set.Nonempty.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Or (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t)) (Set.union_nonempty.{u1} α s t) (Or.intro_left (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t) hsn))) (LinearOrder.min.{u1} α _inst_1 (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hsn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) t ht htn))
+  forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) s) (hsn : Set.Nonempty.{u1} α s) (ht : Set.IsWf.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1))))) t) (htn : Set.Nonempty.{u1} α t), Eq.{succ u1} α (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) (Set.IsWf.union.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s t hs ht) (Iff.mpr (Set.Nonempty.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Or (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t)) (Set.union_nonempty.{u1} α s t) (Or.intro_left (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t) hsn))) (LinearOrder.min.{u1} α _inst_1 (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) s hs hsn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (LinearOrder.toLattice.{u1} α _inst_1)))) t ht htn))
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : LinearOrder.{u1} α] {s : Set.{u1} α} {t : Set.{u1} α} (hs : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) s) (hsn : Set.Nonempty.{u1} α s) (ht : Set.IsWf.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1)))))) t) (htn : Set.Nonempty.{u1} α t), Eq.{succ u1} α (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t) (Set.IsWf.union.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s t hs ht) (Iff.mpr (Set.Nonempty.{u1} α (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) s t)) (Or (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t)) (Set.union_nonempty.{u1} α s t) (Or.intro_left (Set.Nonempty.{u1} α s) (Set.Nonempty.{u1} α t) hsn))) (Min.min.{u1} α (LinearOrder.toMin.{u1} α _inst_1) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) s hs hsn) (Set.IsWf.min.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α (Lattice.toSemilatticeInf.{u1} α (DistribLattice.toLattice.{u1} α (instDistribLattice.{u1} α _inst_1))))) t ht htn))
 Case conversion may be inaccurate. Consider using '#align set.is_wf.min_union Set.IsWf.min_unionₓ'. -/
@@ -1126,7 +1198,12 @@ theorem WellFounded.isWf [LT α] (h : WellFounded ((· < ·) : α → α → Pro
 #align well_founded.is_wf WellFounded.isWf
 -/
 
-#print Pi.isPwo /-
+/- warning: pi.is_pwo -> Pi.isPwo is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {α : ι -> Type.{u2}} [_inst_1 : forall (i : ι), LinearOrder.{u2} (α i)] [_inst_2 : forall (i : ι), IsWellOrder.{u2} (α i) (LT.lt.{u2} (α i) (Preorder.toHasLt.{u2} (α i) (PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (LinearOrder.toLattice.{u2} (α i) (_inst_1 i)))))))] [_inst_3 : Finite.{succ u1} ι] (s : Set.{max u1 u2} (forall (i : ι), α i)), Set.IsPwo.{max u1 u2} (forall (i : ι), α i) (Pi.preorder.{u1, u2} ι (fun (i : ι) => α i) (fun (i : ι) => PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (LinearOrder.toLattice.{u2} (α i) (_inst_1 i)))))) s
+but is expected to have type
+  forall {ι : Type.{u1}} {α : ι -> Type.{u2}} [_inst_1 : forall (i : ι), LinearOrder.{u2} (α i)] [_inst_2 : forall (i : ι), IsWellOrder.{u2} (α i) (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.9686 : α i) (x._@.Mathlib.Order.WellFoundedSet._hyg.9688 : α i) => LT.lt.{u2} (α i) (Preorder.toLT.{u2} (α i) (PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (DistribLattice.toLattice.{u2} (α i) (instDistribLattice.{u2} (α i) (_inst_1 i))))))) x._@.Mathlib.Order.WellFoundedSet._hyg.9686 x._@.Mathlib.Order.WellFoundedSet._hyg.9688)] [_inst_3 : Finite.{succ u1} ι] (s : Set.{max u1 u2} (forall (i : ι), α i)), Set.IsPwo.{max u1 u2} (forall (i : ι), α i) (Pi.preorder.{u1, u2} ι (fun (i : ι) => α i) (fun (i : ι) => PartialOrder.toPreorder.{u2} (α i) (SemilatticeInf.toPartialOrder.{u2} (α i) (Lattice.toSemilatticeInf.{u2} (α i) (DistribLattice.toLattice.{u2} (α i) (instDistribLattice.{u2} (α i) (_inst_1 i))))))) s
+Case conversion may be inaccurate. Consider using '#align pi.is_pwo Pi.isPwoₓ'. -/
 /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
 ordered, when `σ` is a `fintype` and each `α s` is a linear well order.
 This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
@@ -1155,5 +1232,4 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
 #align pi.is_pwo Pi.isPwo
--/
 
Diff
@@ -854,20 +854,20 @@ theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
 @[simp]
 theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r := by
-  simpa only [Finset.sup_eq_supᵢ] using s.well_founded_on_sup
+  simpa only [Finset.sup_eq_iSup] using s.well_founded_on_sup
 #align finset.well_founded_on_bUnion Finset.wellFoundedOn_bUnion
 -/
 
 /- warning: finset.partially_well_ordered_on_bUnion -> Finset.partiallyWellOrderedOn_bUnion is a dubious translation:
 lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.PartiallyWellOrderedOn.{u2} α (Set.unionᵢ.{u2, succ u1} α ι (fun (i : ι) => Set.unionᵢ.{u2, 0} α (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (fun (H : Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) => f i))) r) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.PartiallyWellOrderedOn.{u2} α (f i) r))
+  forall {ι : Type.{u1}} {α : Type.{u2}} {r : α -> α -> Prop} (s : Finset.{u1} ι) {f : ι -> (Set.{u2} α)}, Iff (Set.PartiallyWellOrderedOn.{u2} α (Set.iUnion.{u2, succ u1} α ι (fun (i : ι) => Set.iUnion.{u2, 0} α (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (fun (H : Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) => f i))) r) (forall (i : ι), (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) -> (Set.PartiallyWellOrderedOn.{u2} α (f i) r))
 but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} {r : α -> α -> Prop} (s : Finset.{u2} ι) {f : ι -> (Set.{u1} α)}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Set.unionᵢ.{u1, succ u2} α ι (fun (i : ι) => Set.unionᵢ.{u1, 0} α (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) (fun (H : Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) => f i))) r) (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Set.PartiallyWellOrderedOn.{u1} α (f i) r))
+  forall {ι : Type.{u2}} {α : Type.{u1}} {r : α -> α -> Prop} (s : Finset.{u2} ι) {f : ι -> (Set.{u1} α)}, Iff (Set.PartiallyWellOrderedOn.{u1} α (Set.iUnion.{u1, succ u2} α ι (fun (i : ι) => Set.iUnion.{u1, 0} α (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) (fun (H : Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) => f i))) r) (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Set.PartiallyWellOrderedOn.{u1} α (f i) r))
 Case conversion may be inaccurate. Consider using '#align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnionₓ'. -/
 @[simp]
 theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r := by
-  simpa only [Finset.sup_eq_supᵢ] using s.partially_well_ordered_on_sup
+  simpa only [Finset.sup_eq_iSup] using s.partially_well_ordered_on_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
 #print Finset.isWf_bUnion /-
Diff
@@ -462,7 +462,7 @@ variable [IsTrans α r]
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseqₓ'. -/
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -480,7 +480,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseqₓ'. -/
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
@@ -548,7 +548,7 @@ theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseqₓ'. -/
 theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
@@ -559,7 +559,7 @@ theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n,
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseqₓ'. -/
 theorem isPwo_iff_exists_monotone_subseq :
     s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
Diff
@@ -171,7 +171,7 @@ instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r), Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (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 n) s))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r f) n) s))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Order.RelIso.Basic._hyg.867 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (FunLike.coe.{succ u1, 1, succ u1} (RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) 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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r) Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r (RelEmbedding.instRelHomClassRelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r)) f n) s))
 Case conversion may be inaccurate. Consider using '#align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seqₓ'. -/
 theorem wellFoundedOn_iff_no_descending_seq :
     s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s :=
@@ -462,7 +462,7 @@ variable [IsTrans α r]
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], (Set.PartiallyWellOrderedOn.{u1} α s r) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on.exists_monotone_subseq Set.PartiallyWellOrderedOn.exists_monotone_subseqₓ'. -/
 theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
     (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) :=
@@ -480,7 +480,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat Nat.hasLe 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))))))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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 {α : Type.{u1}} {r : α -> α -> Prop} {s : Set.{u1} α} [_inst_1 : IsRefl.{u1} α r] [_inst_2 : IsTrans.{u1} α r], Iff (Set.PartiallyWellOrderedOn.{u1} α s r) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => forall (m : Nat) (n : Nat), (LE.le.{0} Nat instLENat 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))))))
 Case conversion may be inaccurate. Consider using '#align set.partially_well_ordered_on_iff_exists_monotone_subseq Set.partiallyWellOrderedOn_iff_exists_monotone_subseqₓ'. -/
 theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
     s.PartiallyWellOrderedOn r ↔
@@ -548,7 +548,7 @@ theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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))))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (Set.IsPwo.{u1} α _inst_1 s) -> (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseqₓ'. -/
 theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
@@ -559,7 +559,7 @@ theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n,
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) (fun (g : OrderEmbedding.{0, 0} Nat Nat Nat.hasLe Nat.hasLe) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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))))))
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, Iff (Set.IsPwo.{u1} α _inst_1 s) (forall (f : Nat -> α), (forall (n : Nat), Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (f n) s) -> (Exists.{1} (OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) (fun (g : OrderEmbedding.{0, 0} Nat Nat instLENat instLENat) => Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) _inst_1 (Function.comp.{1, 1, succ u1} Nat Nat α 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)))))
 Case conversion may be inaccurate. Consider using '#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseqₓ'. -/
 theorem isPwo_iff_exists_monotone_subseq :
     s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
Diff
@@ -171,7 +171,7 @@ instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈
 lean 3 declaration is
   forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (GT.gt.{0} Nat Nat.hasLt) r), Not (forall (n : Nat), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (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 n) s))
 but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.1156 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.1158 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.1156 x._@.Mathlib.Order.WellFoundedSet._hyg.1158) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (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.WellFoundedSet._hyg.1156 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.1158 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.1156 x._@.Mathlib.Order.WellFoundedSet._hyg.1158) r f) n) s))
+  forall {α : Type.{u1}} {r : α -> α -> Prop} [_inst_1 : IsStrictOrder.{u1} α r] {s : Set.{u1} α}, Iff (Set.WellFoundedOn.{u1} α s r) (forall (f : RelEmbedding.{0, u1} Nat α (fun (x._@.Mathlib.Order.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r), Not (forall (n : Nat), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : Nat) => α) n) (Set.{u1} α) (Set.instMembershipSet.{u1} α) (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.WellFoundedSet._hyg.3266 : Nat) (x._@.Mathlib.Order.WellFoundedSet._hyg.3268 : Nat) => GT.gt.{0} Nat instLTNat x._@.Mathlib.Order.WellFoundedSet._hyg.3266 x._@.Mathlib.Order.WellFoundedSet._hyg.3268) r f) n) s))
 Case conversion may be inaccurate. Consider using '#align set.well_founded_on_iff_no_descending_seq Set.wellFoundedOn_iff_no_descending_seqₓ'. -/
 theorem wellFoundedOn_iff_no_descending_seq :
     s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s :=
Diff
@@ -1046,8 +1046,8 @@ theorem exists_min_bad_of_exists_bad (r : α → α → Prop) (rk : α → ℕ)
   refine' ⟨fun n => (fs n).1 n, ⟨fun n => (fs n).2.1.1 n, fun m n mn => _⟩, fun n g hg1 hg2 => _⟩
   · dsimp
     rw [← Subtype.val_eq_coe, h m n (le_of_lt mn)]
-    convert (fs n).2.1.2 m n mn
-  · convert (fs n).2.2 g (fun m mn => Eq.trans _ (hg1 m mn)) (lt_of_lt_of_le hg2 le_rfl)
+    convert(fs n).2.1.2 m n mn
+  · convert(fs n).2.2 g (fun m mn => Eq.trans _ (hg1 m mn)) (lt_of_lt_of_le hg2 le_rfl)
     rw [← h m n (le_of_lt mn)]
 #align set.partially_well_ordered_on.exists_min_bad_of_exists_bad Set.PartiallyWellOrderedOn.exists_min_bad_of_exists_bad
 -/
Diff
@@ -432,7 +432,7 @@ protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r)
 #align set.partially_well_ordered_on.insert Set.PartiallyWellOrderedOn.insert
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (t «expr ⊆ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (t «expr ⊆ » s) -/
 #print Set.partiallyWellOrderedOn_iff_finite_antichains /-
 theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ (t) (_ : t ⊆ s), IsAntichain r t → t.Finite :=

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 1 (#12338)

A PR accompanying #12339.

Zulip discussion

Diff
@@ -303,7 +303,8 @@ theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrdered
     (hf : ∀ a₁ ∈ s, ∀ a₂ ∈ s, r a₁ a₂ → r' (f a₁) (f a₂)) : (f '' s).PartiallyWellOrderedOn r' := by
   intro g' hg'
   choose g hgs heq using hg'
-  obtain rfl : f ∘ g = g'; exact funext heq
+  obtain rfl : f ∘ g = g'
+  · exact funext heq
   obtain ⟨m, n, hlt, hmn⟩ := hs g hgs
   exact ⟨m, n, hlt, hf _ (hgs m) _ (hgs n) hmn⟩
 #align set.partially_well_ordered_on.image_of_monotone_on Set.PartiallyWellOrderedOn.image_of_monotone_on
@@ -870,7 +871,7 @@ theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f
     (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
     WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) := by
   refine' (PSigma.lex_wf (wellFoundedOn_range.2 hα) fun a => hβ a).onFun.mono fun c c' h => _
-  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  · exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
   obtain h' | h' := Prod.lex_iff.1 h
   · exact PSigma.Lex.left _ _ h'
   · dsimp only [InvImage, (· on ·)] at h' ⊢
@@ -883,8 +884,8 @@ theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn
     s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) := by
   refine' WellFounded.prod_lex_of_wellFoundedOn_fiber hα fun a ↦ (hβ a).onFun.mono (fun b c h ↦ _)
   swap
-  exact fun _ x => ⟨x, x.1.2, x.2⟩
-  assumption
+  · exact fun _ x => ⟨x, x.1.2, x.2⟩
+  · assumption
 #align set.well_founded_on.prod_lex_of_well_founded_on_fiber Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
 
 end ProdLex
@@ -899,7 +900,7 @@ theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on
     (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
     WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by
   refine' (PSigma.lex_wf (wellFoundedOn_range.2 hι) fun a => hπ a).onFun.mono fun c c' h => _
-  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  · exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
   obtain h' | ⟨h', h''⟩ := Sigma.lex_iff.1 h
   · exact PSigma.Lex.left _ _ h'
   · dsimp only [InvImage, (· on ·)] at h' ⊢
@@ -921,8 +922,8 @@ theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedO
     @WellFounded.sigma_lex_of_wellFoundedOn_fiber _ s _ _ rπ (fun c => f c) (fun i c => g _ c) hι
       fun i => (hπ i).onFun.mono (fun b c h => _)
   swap
-  exact fun _ x => ⟨x, x.1.2, x.2⟩
-  assumption
+  · exact fun _ x => ⟨x, x.1.2, x.2⟩
+  · assumption
 #align set.well_founded_on.sigma_lex_of_well_founded_on_fiber Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
 
 end SigmaLex
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -865,7 +865,7 @@ section ProdLex
 variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
 
 /-- Stronger version of `WellFounded.prod_lex`. Instead of requiring `rβ on g` to be well-founded,
-we only require it to be well-founded on fibers of `f`.-/
+we only require it to be well-founded on fibers of `f`. -/
 theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
     (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
     WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) := by
@@ -894,7 +894,7 @@ section SigmaLex
 variable {rι : ι → ι → Prop} {rπ : ∀ i, π i → π i → Prop} {f : γ → ι} {g : ∀ i, γ → π i} {s : Set γ}
 
 /-- Stronger version of `PSigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
-require it to be well-founded on fibers of `f`.-/
+require it to be well-founded on fibers of `f`. -/
 theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
     (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
     WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by
feat(RingTheory/HahnSeries/Basic): Make a Hahn series from a function with support bounded below (#9574)

Given a locally finite linearly ordered set Γ and a function f on Γ whose support is bounded below, we produce a Hahn series whose coefficients are given by f. We introduce a theorem (borrowing from mathlib3 #18604) for translating the vanishing condition to the partially well-ordered support condition that is used in the definition of Hahn Series.

Diff
@@ -702,6 +702,22 @@ end Set
 
 open Set
 
+section LocallyFiniteOrder
+
+variable {s : Set α} [Preorder α] [LocallyFiniteOrder α]
+
+theorem BddBelow.wellFoundedOn_lt : BddBelow s → s.WellFoundedOn (· < ·) := by
+  rw [wellFoundedOn_iff_no_descending_seq]
+  rintro ⟨a, ha⟩ f hf
+  refine infinite_range_of_injective f.injective ?_
+  exact (finite_Icc a <| f 0).subset <| range_subset_iff.2 <| fun n =>
+    ⟨ha <| hf _, antitone_iff_forall_lt.2 (fun a b hab => (f.map_rel_iff.2 hab).le) <| zero_le _⟩
+
+theorem BddAbove.wellFoundedOn_gt : BddAbove s → s.WellFoundedOn (· > ·) :=
+  fun h => h.dual.wellFoundedOn_lt
+
+end LocallyFiniteOrder
+
 namespace Set.PartiallyWellOrderedOn
 
 variable {r : α → α → Prop}
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -552,7 +552,7 @@ protected theorem IsWF.isPWO (hs : s.IsWF) : s.IsPWO := by
   intro f hf
   lift f to ℕ → s using hf
   rcases hs.has_min (range f) (range_nonempty _) with ⟨_, ⟨m, rfl⟩, hm⟩
-  simp only [forall_range_iff, not_lt] at hm
+  simp only [forall_mem_range, not_lt] at hm
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
 #align set.is_wf.is_pwo Set.IsWF.isPWO
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -412,7 +412,7 @@ theorem PartiallyWellOrderedOn.wellFoundedOn [IsPreorder α r] (h : s.PartiallyW
       le_refl := refl_of r
       le_trans := fun _ _ _ => trans_of r }
   change s.WellFoundedOn (· < ·)
-  replace h : s.PartiallyWellOrderedOn (· ≤ ·) := h -- porting note: was `change _ at h`
+  replace h : s.PartiallyWellOrderedOn (· ≤ ·) := h -- Porting note: was `change _ at h`
   rw [wellFoundedOn_iff_no_descending_seq]
   intro f hf
   obtain ⟨m, n, hlt, hle⟩ := h f hf
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -785,8 +785,8 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
   rintro ⟨f, hf1, hf2⟩
   have hnil : ∀ n, f n ≠ List.nil := fun n con =>
     hf1.2 n n.succ n.lt_succ_self (con.symm ▸ List.SublistForall₂.nil)
-  have : ∀ n, (f n).headI ∈ s
-  · exact fun n => hf1.1 n _ (List.head!_mem_self (hnil n))
+  have : ∀ n, (f n).headI ∈ s :=
+    fun n => hf1.1 n _ (List.head!_mem_self (hnil n))
   obtain ⟨g, hg⟩ := h.exists_monotone_subseq (fun n => (f n).headI) this
   have hf' :=
     hf2 (g 0) (fun n => if n < g 0 then f n else List.tail (f (g (n - g 0))))
feat: HahnSeries smul order inequality (#9848)

Given a Hahn series x and a scalar r such that r • x ≠ 0, the order of r • x is not strictly less than the order of x. If the exponent poset is linearly ordered, the order of x is less than or equal to the order of r • x. (Note that the order of a Hahn series is not uniquely defined when the exponent poset is not linearly ordered.) This is a complement to the addition result HahnSeries.min_order_le_order_add.

Diff
@@ -642,7 +642,7 @@ namespace Set
 
 section Preorder
 
-variable [Preorder α] {s : Set α} {a : α}
+variable [Preorder α] {s t : Set α} {a : α}
 
 /-- `Set.IsWF.min` returns a minimal element of a nonempty well-founded set. -/
 noncomputable nonrec def IsWF.min (hs : IsWF s) (hn : s.Nonempty) : α :=
@@ -657,6 +657,10 @@ nonrec theorem IsWF.not_lt_min (hs : IsWF s) (hn : s.Nonempty) (ha : a ∈ s) :
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
 #align set.is_wf.not_lt_min Set.IsWF.not_lt_min
 
+theorem IsWF.min_of_subset_not_lt_min {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF}
+    {htn : t.Nonempty} (hst : s ⊆ t) : ¬hs.min hsn < ht.min htn :=
+  ht.not_lt_min htn (hst (min_mem hs hsn))
+
 @[simp]
 theorem isWF_min_singleton (a) {hs : IsWF ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
chore(*): rename IsPwo to IsPWO (#9582)

Rename Set.IsPwoSet.IsPWO and Set.IsWfSet.IsWF.

Diff
@@ -20,10 +20,10 @@ A well-founded subset of an ordered type is one on which the relation `<` is wel
 ## Main Definitions
  * `Set.WellFoundedOn s r` indicates that the relation `r` is
   well-founded when restricted to the set `s`.
- * `Set.IsWf s` indicates that `<` is well-founded when restricted to `s`.
+ * `Set.IsWF s` indicates that `<` is well-founded when restricted to `s`.
  * `Set.PartiallyWellOrderedOn s r` indicates that the relation `r` is
   partially well-ordered (also known as well quasi-ordered) when restricted to the set `s`.
- * `Set.IsPwo s` indicates that any infinite sequence of elements in `s` contains an infinite
+ * `Set.IsPWO s` indicates that any infinite sequence of elements in `s` contains an infinite
   monotone subsequence. Note that this is equivalent to containing only two comparable elements.
 
 ## Main Results
@@ -33,9 +33,9 @@ A well-founded subset of an ordered type is one on which the relation `<` is wel
   Higman, but this proof more closely follows Nash-Williams.
  * `Set.wellFoundedOn_iff` relates `well_founded_on` to the well-foundedness of a relation on the
  original type, to avoid dealing with subtypes.
- * `Set.IsWf.mono` shows that a subset of a well-founded subset is well-founded.
- * `Set.IsWf.union` shows that the union of two well-founded subsets is well-founded.
- * `Finset.isWf` shows that all `Finset`s are well-founded.
+ * `Set.IsWF.mono` shows that a subset of a well-founded subset is well-founded.
+ * `Set.IsWF.union` shows that the union of two well-founded subsets is well-founded.
+ * `Finset.isWF` shows that all `Finset`s are well-founded.
 
 ## TODO
 
@@ -211,22 +211,22 @@ section LT
 
 variable [LT α] {s t : Set α}
 
-/-- `s.IsWf` indicates that `<` is well-founded when restricted to `s`. -/
-def IsWf (s : Set α) : Prop :=
+/-- `s.IsWF` indicates that `<` is well-founded when restricted to `s`. -/
+def IsWF (s : Set α) : Prop :=
   WellFoundedOn s (· < ·)
-#align set.is_wf Set.IsWf
+#align set.is_wf Set.IsWF
 
 @[simp]
-theorem isWf_empty : IsWf (∅ : Set α) :=
+theorem isWF_empty : IsWF (∅ : Set α) :=
   wellFounded_of_isEmpty _
-#align set.is_wf_empty Set.isWf_empty
+#align set.is_wf_empty Set.isWF_empty
 
-theorem isWf_univ_iff : IsWf (univ : Set α) ↔ WellFounded ((· < ·) : α → α → Prop) := by
-  simp [IsWf, wellFoundedOn_iff]
-#align set.is_wf_univ_iff Set.isWf_univ_iff
+theorem isWF_univ_iff : IsWF (univ : Set α) ↔ WellFounded ((· < ·) : α → α → Prop) := by
+  simp [IsWF, wellFoundedOn_iff]
+#align set.is_wf_univ_iff Set.isWF_univ_iff
 
-theorem IsWf.mono (h : IsWf t) (st : s ⊆ t) : IsWf s := h.subset st
-#align set.is_wf.mono Set.IsWf.mono
+theorem IsWF.mono (h : IsWF t) (st : s ⊆ t) : IsWF s := h.subset st
+#align set.is_wf.mono Set.IsWF.mono
 
 end LT
 
@@ -234,11 +234,11 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-protected nonrec theorem IsWf.union (hs : IsWf s) (ht : IsWf t) : IsWf (s ∪ t) := hs.union ht
-#align set.is_wf.union Set.IsWf.union
+protected nonrec theorem IsWF.union (hs : IsWF s) (ht : IsWF t) : IsWF (s ∪ t) := hs.union ht
+#align set.is_wf.union Set.IsWF.union
 
-@[simp] theorem isWf_union : IsWf (s ∪ t) ↔ IsWf s ∧ IsWf t := wellFoundedOn_union
-#align set.is_wf_union Set.isWf_union
+@[simp] theorem isWF_union : IsWF (s ∪ t) ↔ IsWF s ∧ IsWF t := wellFoundedOn_union
+#align set.is_wf_union Set.isWF_union
 
 end Preorder
 
@@ -246,11 +246,11 @@ section Preorder
 
 variable [Preorder α] {s t : Set α} {a : α}
 
-theorem isWf_iff_no_descending_seq :
-    IsWf s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
+theorem isWF_iff_no_descending_seq :
+    IsWF s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s :=
   wellFoundedOn_iff_no_descending_seq.trans
     ⟨fun H f hf => H ⟨⟨f, hf.injective⟩, hf.lt_iff_lt⟩, fun H f => H f fun _ _ => f.map_rel_iff.2⟩
-#align set.is_wf_iff_no_descending_seq Set.isWf_iff_no_descending_seq
+#align set.is_wf_iff_no_descending_seq Set.isWF_iff_no_descending_seq
 
 end Preorder
 
@@ -421,98 +421,98 @@ theorem PartiallyWellOrderedOn.wellFoundedOn [IsPreorder α r] (h : s.PartiallyW
 
 end PartiallyWellOrderedOn
 
-section IsPwo
+section IsPWO
 
 variable [Preorder α] [Preorder β] {s t : Set α}
 
 /-- A subset of a preorder is partially well-ordered when any infinite sequence contains
   a monotone subsequence of length 2 (or equivalently, an infinite monotone subsequence). -/
-def IsPwo (s : Set α) : Prop :=
+def IsPWO (s : Set α) : Prop :=
   PartiallyWellOrderedOn s (· ≤ ·)
-#align set.is_pwo Set.IsPwo
+#align set.is_pwo Set.IsPWO
 
-nonrec theorem IsPwo.mono (ht : t.IsPwo) : s ⊆ t → s.IsPwo := ht.mono
-#align set.is_pwo.mono Set.IsPwo.mono
+nonrec theorem IsPWO.mono (ht : t.IsPWO) : s ⊆ t → s.IsPWO := ht.mono
+#align set.is_pwo.mono Set.IsPWO.mono
 
-nonrec theorem IsPwo.exists_monotone_subseq (h : s.IsPwo) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
+nonrec theorem IsPWO.exists_monotone_subseq (h : s.IsPWO) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
     ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   h.exists_monotone_subseq f hf
-#align set.is_pwo.exists_monotone_subseq Set.IsPwo.exists_monotone_subseq
+#align set.is_pwo.exists_monotone_subseq Set.IsPWO.exists_monotone_subseq
 
-theorem isPwo_iff_exists_monotone_subseq :
-    s.IsPwo ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
+theorem isPWO_iff_exists_monotone_subseq :
+    s.IsPWO ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) :=
   partiallyWellOrderedOn_iff_exists_monotone_subseq
-#align set.is_pwo_iff_exists_monotone_subseq Set.isPwo_iff_exists_monotone_subseq
+#align set.is_pwo_iff_exists_monotone_subseq Set.isPWO_iff_exists_monotone_subseq
 
-protected theorem IsPwo.isWf (h : s.IsPwo) : s.IsWf := by
+protected theorem IsPWO.isWF (h : s.IsPWO) : s.IsWF := by
   simpa only [← lt_iff_le_not_le] using h.wellFoundedOn
-#align set.is_pwo.is_wf Set.IsPwo.isWf
+#align set.is_pwo.is_wf Set.IsPWO.isWF
 
-nonrec theorem IsPwo.prod {t : Set β} (hs : s.IsPwo) (ht : t.IsPwo) : IsPwo (s ×ˢ t) :=
+nonrec theorem IsPWO.prod {t : Set β} (hs : s.IsPWO) (ht : t.IsPWO) : IsPWO (s ×ˢ t) :=
   hs.prod ht
-#align set.is_pwo.prod Set.IsPwo.prod
+#align set.is_pwo.prod Set.IsPWO.prod
 
-theorem IsPwo.image_of_monotoneOn (hs : s.IsPwo) {f : α → β} (hf : MonotoneOn f s) :
-    IsPwo (f '' s) :=
+theorem IsPWO.image_of_monotoneOn (hs : s.IsPWO) {f : α → β} (hf : MonotoneOn f s) :
+    IsPWO (f '' s) :=
   hs.image_of_monotone_on hf
-#align set.is_pwo.image_of_monotone_on Set.IsPwo.image_of_monotoneOn
+#align set.is_pwo.image_of_monotone_on Set.IsPWO.image_of_monotoneOn
 
-theorem IsPwo.image_of_monotone (hs : s.IsPwo) {f : α → β} (hf : Monotone f) : IsPwo (f '' s) :=
+theorem IsPWO.image_of_monotone (hs : s.IsPWO) {f : α → β} (hf : Monotone f) : IsPWO (f '' s) :=
   hs.image_of_monotone_on (hf.monotoneOn _)
-#align set.is_pwo.image_of_monotone Set.IsPwo.image_of_monotone
+#align set.is_pwo.image_of_monotone Set.IsPWO.image_of_monotone
 
-protected nonrec theorem IsPwo.union (hs : IsPwo s) (ht : IsPwo t) : IsPwo (s ∪ t) :=
+protected nonrec theorem IsPWO.union (hs : IsPWO s) (ht : IsPWO t) : IsPWO (s ∪ t) :=
   hs.union ht
-#align set.is_pwo.union Set.IsPwo.union
+#align set.is_pwo.union Set.IsPWO.union
 
 @[simp]
-theorem isPwo_union : IsPwo (s ∪ t) ↔ IsPwo s ∧ IsPwo t :=
+theorem isPWO_union : IsPWO (s ∪ t) ↔ IsPWO s ∧ IsPWO t :=
   partiallyWellOrderedOn_union
-#align set.is_pwo_union Set.isPwo_union
+#align set.is_pwo_union Set.isPWO_union
 
-protected theorem Finite.isPwo (hs : s.Finite) : IsPwo s := hs.partiallyWellOrderedOn
-#align set.finite.is_pwo Set.Finite.isPwo
+protected theorem Finite.isPWO (hs : s.Finite) : IsPWO s := hs.partiallyWellOrderedOn
+#align set.finite.is_pwo Set.Finite.isPWO
 
-@[simp] theorem isPwo_of_finite [Finite α] : s.IsPwo := s.toFinite.isPwo
-#align set.is_pwo_of_finite Set.isPwo_of_finite
+@[simp] theorem isPWO_of_finite [Finite α] : s.IsPWO := s.toFinite.isPWO
+#align set.is_pwo_of_finite Set.isPWO_of_finite
 
-@[simp] theorem isPwo_singleton (a : α) : IsPwo ({a} : Set α) := (finite_singleton a).isPwo
-#align set.is_pwo_singleton Set.isPwo_singleton
+@[simp] theorem isPWO_singleton (a : α) : IsPWO ({a} : Set α) := (finite_singleton a).isPWO
+#align set.is_pwo_singleton Set.isPWO_singleton
 
-@[simp] theorem isPwo_empty : IsPwo (∅ : Set α) := finite_empty.isPwo
-#align set.is_pwo_empty Set.isPwo_empty
+@[simp] theorem isPWO_empty : IsPWO (∅ : Set α) := finite_empty.isPWO
+#align set.is_pwo_empty Set.isPWO_empty
 
-protected theorem Subsingleton.isPwo (hs : s.Subsingleton) : IsPwo s := hs.finite.isPwo
-#align set.subsingleton.is_pwo Set.Subsingleton.isPwo
+protected theorem Subsingleton.isPWO (hs : s.Subsingleton) : IsPWO s := hs.finite.isPWO
+#align set.subsingleton.is_pwo Set.Subsingleton.isPWO
 
 @[simp]
-theorem isPwo_insert {a} : IsPwo (insert a s) ↔ IsPwo s := by
-  simp only [← singleton_union, isPwo_union, isPwo_singleton, true_and_iff]
-#align set.is_pwo_insert Set.isPwo_insert
+theorem isPWO_insert {a} : IsPWO (insert a s) ↔ IsPWO s := by
+  simp only [← singleton_union, isPWO_union, isPWO_singleton, true_and_iff]
+#align set.is_pwo_insert Set.isPWO_insert
 
-protected theorem IsPwo.insert (h : IsPwo s) (a : α) : IsPwo (insert a s) :=
-  isPwo_insert.2 h
-#align set.is_pwo.insert Set.IsPwo.insert
+protected theorem IsPWO.insert (h : IsPWO s) (a : α) : IsPWO (insert a s) :=
+  isPWO_insert.2 h
+#align set.is_pwo.insert Set.IsPWO.insert
 
-protected theorem Finite.isWf (hs : s.Finite) : IsWf s := hs.isPwo.isWf
-#align set.finite.is_wf Set.Finite.isWf
+protected theorem Finite.isWF (hs : s.Finite) : IsWF s := hs.isPWO.isWF
+#align set.finite.is_wf Set.Finite.isWF
 
-@[simp] theorem isWf_singleton {a : α} : IsWf ({a} : Set α) := (finite_singleton a).isWf
-#align set.is_wf_singleton Set.isWf_singleton
+@[simp] theorem isWF_singleton {a : α} : IsWF ({a} : Set α) := (finite_singleton a).isWF
+#align set.is_wf_singleton Set.isWF_singleton
 
-protected theorem Subsingleton.isWf (hs : s.Subsingleton) : IsWf s := hs.isPwo.isWf
-#align set.subsingleton.is_wf Set.Subsingleton.isWf
+protected theorem Subsingleton.isWF (hs : s.Subsingleton) : IsWF s := hs.isPWO.isWF
+#align set.subsingleton.is_wf Set.Subsingleton.isWF
 
 @[simp]
-theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
-  simp only [← singleton_union, isWf_union, isWf_singleton, true_and_iff]
-#align set.is_wf_insert Set.isWf_insert
+theorem isWF_insert {a} : IsWF (insert a s) ↔ IsWF s := by
+  simp only [← singleton_union, isWF_union, isWF_singleton, true_and_iff]
+#align set.is_wf_insert Set.isWF_insert
 
-protected theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
-  isWf_insert.2 h
-#align set.is_wf.insert Set.IsWf.insert
+protected theorem IsWF.insert (h : IsWF s) (a : α) : IsWF (insert a s) :=
+  isWF_insert.2 h
+#align set.is_wf.insert Set.IsWF.insert
 
-end IsPwo
+end IsPWO
 
 section WellFoundedOn
 
@@ -520,7 +520,7 @@ variable {r : α → α → Prop} [IsStrictOrder α r] {s : Set α} {a : α}
 
 protected theorem Finite.wellFoundedOn (hs : s.Finite) : s.WellFoundedOn r :=
   letI := partialOrderOfSO r
-  hs.isWf
+  hs.isWF
 #align set.finite.well_founded_on Set.Finite.wellFoundedOn
 
 @[simp]
@@ -548,18 +548,18 @@ section LinearOrder
 
 variable [LinearOrder α] {s : Set α}
 
-protected theorem IsWf.isPwo (hs : s.IsWf) : s.IsPwo := by
+protected theorem IsWF.isPWO (hs : s.IsWF) : s.IsPWO := by
   intro f hf
   lift f to ℕ → s using hf
   rcases hs.has_min (range f) (range_nonempty _) with ⟨_, ⟨m, rfl⟩, hm⟩
   simp only [forall_range_iff, not_lt] at hm
   exact ⟨m, m + 1, lt_add_one m, hm _⟩
-#align set.is_wf.is_pwo Set.IsWf.isPwo
+#align set.is_wf.is_pwo Set.IsWF.isPWO
 
-/-- In a linear order, the predicates `Set.IsWf` and `Set.IsPwo` are equivalent. -/
-theorem isWf_iff_isPwo : s.IsWf ↔ s.IsPwo :=
-  ⟨IsWf.isPwo, IsPwo.isWf⟩
-#align set.is_wf_iff_is_pwo Set.isWf_iff_isPwo
+/-- In a linear order, the predicates `Set.IsWF` and `Set.IsPWO` are equivalent. -/
+theorem isWF_iff_isPWO : s.IsWF ↔ s.IsPWO :=
+  ⟨IsWF.isPWO, IsPWO.isWF⟩
+#align set.is_wf_iff_is_pwo Set.isWF_iff_isPWO
 
 end LinearOrder
 
@@ -576,20 +576,20 @@ protected theorem partiallyWellOrderedOn [IsRefl α r] (s : Finset α) :
 #align finset.partially_well_ordered_on Finset.partiallyWellOrderedOn
 
 @[simp]
-protected theorem isPwo [Preorder α] (s : Finset α) : Set.IsPwo (↑s : Set α) :=
+protected theorem isPWO [Preorder α] (s : Finset α) : Set.IsPWO (↑s : Set α) :=
   s.partiallyWellOrderedOn
-#align finset.is_pwo Finset.isPwo
+#align finset.is_pwo Finset.isPWO
 
 @[simp]
-protected theorem isWf [Preorder α] (s : Finset α) : Set.IsWf (↑s : Set α) :=
-  s.finite_toSet.isWf
-#align finset.is_wf Finset.isWf
+protected theorem isWF [Preorder α] (s : Finset α) : Set.IsWF (↑s : Set α) :=
+  s.finite_toSet.isWF
+#align finset.is_wf Finset.isWF
 
 @[simp]
 protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
     Set.WellFoundedOn (↑s : Set α) r :=
   letI := partialOrderOfSO r
-  s.isWf
+  s.isWF
 #align finset.well_founded_on Finset.wellFoundedOn
 
 theorem wellFoundedOn_sup [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
@@ -602,15 +602,15 @@ theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
   Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_biUnion, hs]
 #align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_sup
 
-theorem isWf_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (s.sup f).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
+theorem isWF_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (s.sup f).IsWF ↔ ∀ i ∈ s, (f i).IsWF :=
   s.wellFoundedOn_sup
-#align finset.is_wf_sup Finset.isWf_sup
+#align finset.is_wf_sup Finset.isWF_sup
 
-theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (s.sup f).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
+theorem isPWO_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO :=
   s.partiallyWellOrderedOn_sup
-#align finset.is_pwo_sup Finset.isPwo_sup
+#align finset.is_pwo_sup Finset.isPWO_sup
 
 @[simp]
 theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
@@ -625,16 +625,16 @@ theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
 @[simp]
-theorem isWf_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (⋃ i ∈ s, f i).IsWf ↔ ∀ i ∈ s, (f i).IsWf :=
+theorem isWF_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF :=
   s.wellFoundedOn_bUnion
-#align finset.is_wf_bUnion Finset.isWf_bUnion
+#align finset.is_wf_bUnion Finset.isWF_bUnion
 
 @[simp]
-theorem isPwo_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
-    (⋃ i ∈ s, f i).IsPwo ↔ ∀ i ∈ s, (f i).IsPwo :=
+theorem isPWO_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
+    (⋃ i ∈ s, f i).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO :=
   s.partiallyWellOrderedOn_bUnion
-#align finset.is_pwo_bUnion Finset.isPwo_bUnion
+#align finset.is_pwo_bUnion Finset.isPWO_bUnion
 
 end Finset
 
@@ -644,24 +644,24 @@ section Preorder
 
 variable [Preorder α] {s : Set α} {a : α}
 
-/-- `Set.IsWf.min` returns a minimal element of a nonempty well-founded set. -/
-noncomputable nonrec def IsWf.min (hs : IsWf s) (hn : s.Nonempty) : α :=
+/-- `Set.IsWF.min` returns a minimal element of a nonempty well-founded set. -/
+noncomputable nonrec def IsWF.min (hs : IsWF s) (hn : s.Nonempty) : α :=
   hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)
-#align set.is_wf.min Set.IsWf.min
+#align set.is_wf.min Set.IsWF.min
 
-theorem IsWf.min_mem (hs : IsWf s) (hn : s.Nonempty) : hs.min hn ∈ s :=
+theorem IsWF.min_mem (hs : IsWF s) (hn : s.Nonempty) : hs.min hn ∈ s :=
   (WellFounded.min hs univ (nonempty_iff_univ_nonempty.1 hn.to_subtype)).2
-#align set.is_wf.min_mem Set.IsWf.min_mem
+#align set.is_wf.min_mem Set.IsWF.min_mem
 
-nonrec theorem IsWf.not_lt_min (hs : IsWf s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
+nonrec theorem IsWF.not_lt_min (hs : IsWF s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn :=
   hs.not_lt_min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) (mem_univ (⟨a, ha⟩ : s))
-#align set.is_wf.not_lt_min Set.IsWf.not_lt_min
+#align set.is_wf.not_lt_min Set.IsWF.not_lt_min
 
 @[simp]
-theorem isWf_min_singleton (a) {hs : IsWf ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
+theorem isWF_min_singleton (a) {hs : IsWF ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
     hs.min hn = a :=
-  eq_of_mem_singleton (IsWf.min_mem hs hn)
-#align set.is_wf_min_singleton Set.isWf_min_singleton
+  eq_of_mem_singleton (IsWF.min_mem hs hn)
+#align set.is_wf_min_singleton Set.isWF_min_singleton
 
 end Preorder
 
@@ -669,28 +669,28 @@ section LinearOrder
 
 variable [LinearOrder α] {s t : Set α} {a : α}
 
-theorem IsWf.min_le (hs : s.IsWf) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
+theorem IsWF.min_le (hs : s.IsWF) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a :=
   le_of_not_lt (hs.not_lt_min hn ha)
-#align set.is_wf.min_le Set.IsWf.min_le
+#align set.is_wf.min_le Set.IsWF.min_le
 
-theorem IsWf.le_min_iff (hs : s.IsWf) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
+theorem IsWF.le_min_iff (hs : s.IsWF) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b :=
   ⟨fun ha _b hb => le_trans ha (hs.min_le hn hb), fun h => h _ (hs.min_mem _)⟩
-#align set.is_wf.le_min_iff Set.IsWf.le_min_iff
+#align set.is_wf.le_min_iff Set.IsWF.le_min_iff
 
-theorem IsWf.min_le_min_of_subset {hs : s.IsWf} {hsn : s.Nonempty} {ht : t.IsWf} {htn : t.Nonempty}
+theorem IsWF.min_le_min_of_subset {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF} {htn : t.Nonempty}
     (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn :=
-  (IsWf.le_min_iff _ _).2 fun _b hb => ht.min_le htn (hst hb)
-#align set.is_wf.min_le_min_of_subset Set.IsWf.min_le_min_of_subset
+  (IsWF.le_min_iff _ _).2 fun _b hb => ht.min_le htn (hst hb)
+#align set.is_wf.min_le_min_of_subset Set.IsWF.min_le_min_of_subset
 
-theorem IsWf.min_union (hs : s.IsWf) (hsn : s.Nonempty) (ht : t.IsWf) (htn : t.Nonempty) :
+theorem IsWF.min_union (hs : s.IsWF) (hsn : s.Nonempty) (ht : t.IsWF) (htn : t.Nonempty) :
     (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) =
       Min.min (hs.min hsn) (ht.min htn) := by
-  refine' le_antisymm (le_min (IsWf.min_le_min_of_subset (subset_union_left _ _))
-    (IsWf.min_le_min_of_subset (subset_union_right _ _))) _
+  refine' le_antisymm (le_min (IsWF.min_le_min_of_subset (subset_union_left _ _))
+    (IsWF.min_le_min_of_subset (subset_union_right _ _))) _
   rw [min_le_iff]
   exact ((mem_union _ _ _).1 ((hs.union ht).min_mem (union_nonempty.2 (.inl hsn)))).imp
     (hs.min_le _) (ht.min_le _)
-#align set.is_wf.min_union Set.IsWf.min_union
+#align set.is_wf.min_union Set.IsWF.min_union
 
 end LinearOrder
 
@@ -812,22 +812,22 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
 
 end Set.PartiallyWellOrderedOn
 
-theorem WellFounded.isWf [LT α] (h : WellFounded ((· < ·) : α → α → Prop)) (s : Set α) : s.IsWf :=
-  (Set.isWf_univ_iff.2 h).mono s.subset_univ
-#align well_founded.is_wf WellFounded.isWf
+theorem WellFounded.isWF [LT α] (h : WellFounded ((· < ·) : α → α → Prop)) (s : Set α) : s.IsWF :=
+  (Set.isWF_univ_iff.2 h).mono s.subset_univ
+#align well_founded.is_wf WellFounded.isWF
 
 /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
 ordered, when `σ` is a `Fintype` and each `α s` is a linear well order.
 This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
 Some generalizations would be possible based on this proof, to include cases where the target is
 partially well ordered, and also to consider the case of `Set.PartiallyWellOrderedOn` instead of
-`Set.IsPwo`. -/
-theorem Pi.isPwo {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
-    [Finite ι] (s : Set (∀ i, α i)) : s.IsPwo := by
+`Set.IsPWO`. -/
+theorem Pi.isPWO {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
+    [Finite ι] (s : Set (∀ i, α i)) : s.IsPWO := by
   cases nonempty_fintype ι
   suffices ∀ (s : Finset ι) (f : ℕ → ∀ s, α s),
     ∃ g : ℕ ↪o ℕ, ∀ ⦃a b : ℕ⦄, a ≤ b → ∀ x, x ∈ s → (f ∘ g) a x ≤ (f ∘ g) b x by
-    refine isPwo_iff_exists_monotone_subseq.2 fun f _ => ?_
+    refine isPWO_iff_exists_monotone_subseq.2 fun f _ => ?_
     simpa only [Finset.mem_univ, true_imp_iff] using this Finset.univ f
   refine' Finset.cons_induction _ _
   · intro f
@@ -835,11 +835,11 @@ theorem Pi.isPwo {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellO
     simp only [IsEmpty.forall_iff, imp_true_iff, forall_const, Finset.not_mem_empty]
   · intro x s hx ih f
     obtain ⟨g, hg⟩ :=
-      (IsWellFounded.wf.isWf univ).isPwo.exists_monotone_subseq (fun n => f n x) mem_univ
+      (IsWellFounded.wf.isWF univ).isPWO.exists_monotone_subseq (fun n => f n x) mem_univ
     obtain ⟨g', hg'⟩ := ih (f ∘ g)
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
-#align pi.is_pwo Pi.isPwo
+#align pi.is_pwo Pi.isPWO
 
 section ProdLex
 variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
chore(*): drop $/<| before fun (#9361)

Subset of #9319

Diff
@@ -793,7 +793,7 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
     exact Nat.pred_lt fun con => hnil _ (List.length_eq_zero.1 con)
   rw [IsBadSeq] at hf'
   push_neg at hf'
-  obtain ⟨m, n, mn, hmn⟩ := hf' <| fun n x hx => by
+  obtain ⟨m, n, mn, hmn⟩ := hf' fun n x hx => by
     split_ifs at hx with hn
     exacts [hf1.1 _ _ hx, hf1.1 _ _ (List.tail_subset _ hx)]
   by_cases hn : n < g 0
chore: rename by_contra' to by_contra! (#8797)

To fit with the "please try harder" convention of ! tactics.

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

Diff
@@ -356,7 +356,7 @@ theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
     s.PartiallyWellOrderedOn r ↔ ∀ t, t ⊆ s → IsAntichain r t → t.Finite := by
   refine' ⟨fun h t ht hrt => hrt.finite_of_partiallyWellOrderedOn (h.mono ht), _⟩
   rintro hs f hf
-  by_contra' H
+  by_contra! H
   refine' infinite_range_of_injective (fun m n hmn => _) (hs _ (range_subset_iff.2 hf) _)
   · obtain h | h | h := lt_trichotomy m n
     · refine' (H _ _ h _).elim
chore: tidy various files (#6924)
Diff
@@ -844,8 +844,8 @@ theorem Pi.isPwo {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellO
 section ProdLex
 variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
 
-/-- Stronger version of `prod.lex_wf`. Instead of requiring `rβ on g` to be well-founded, we only
-require it to be well-founded on fibers of `f`.-/
+/-- Stronger version of `WellFounded.prod_lex`. Instead of requiring `rβ on g` to be well-founded,
+we only require it to be well-founded on fibers of `f`.-/
 theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
     (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
     WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) := by
@@ -873,7 +873,7 @@ section SigmaLex
 
 variable {rι : ι → ι → Prop} {rπ : ∀ i, π i → π i → Prop} {f : γ → ι} {g : ∀ i, γ → π i} {s : Set γ}
 
-/-- Stronger version of `psigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
+/-- Stronger version of `PSigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
 require it to be well-founded on fibers of `f`.-/
 theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
     (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
chore: remove unused simps (#6632)

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

Diff
@@ -782,8 +782,7 @@ theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl
   have hnil : ∀ n, f n ≠ List.nil := fun n con =>
     hf1.2 n n.succ n.lt_succ_self (con.symm ▸ List.SublistForall₂.nil)
   have : ∀ n, (f n).headI ∈ s
-  · simp only [Set.range_subset_iff, Function.comp_apply]
-    exact fun n => hf1.1 n _ (List.head!_mem_self (hnil n))
+  · exact fun n => hf1.1 n _ (List.head!_mem_self (hnil n))
   obtain ⟨g, hg⟩ := h.exists_monotone_subseq (fun n => (f n).headI) this
   have hf' :=
     hf2 (g 0) (fun n => if n < g 0 then f n else List.tail (f (g (n - g 0))))
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
@@ -47,7 +47,7 @@ Prove that `s` is partial well ordered iff it has no infinite descending chain o
 -/
 
 
-variable {ι α β γ : Type _} {π : ι → Type _}
+variable {ι α β γ : Type*} {π : ι → Type*}
 
 namespace Set
 
@@ -823,7 +823,7 @@ This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well par
 Some generalizations would be possible based on this proof, to include cases where the target is
 partially well ordered, and also to consider the case of `Set.PartiallyWellOrderedOn` instead of
 `Set.IsPwo`. -/
-theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
+theorem Pi.isPwo {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
     [Finite ι] (s : Set (∀ i, α i)) : s.IsPwo := by
   cases nonempty_fintype ι
   suffices ∀ (s : Finset ι) (f : ℕ → ∀ s, α s),
chore(*): add protected to *.insert theorems (#6142)

Otherwise code like

theorem ContMDiffWithinAt.mythm (h : x ∈ insert y s) : _ = _

interprets insert as ContMDiffWithinAt.insert, not Insert.insert.

Diff
@@ -508,7 +508,7 @@ theorem isWf_insert {a} : IsWf (insert a s) ↔ IsWf s := by
   simp only [← singleton_union, isWf_union, isWf_singleton, true_and_iff]
 #align set.is_wf_insert Set.isWf_insert
 
-theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
+protected theorem IsWf.insert (h : IsWf s) (a : α) : IsWf (insert a s) :=
   isWf_insert.2 h
 #align set.is_wf.insert Set.IsWf.insert
 
@@ -537,7 +537,8 @@ theorem wellFoundedOn_insert : WellFoundedOn (insert a s) r ↔ WellFoundedOn s
   simp only [← singleton_union, wellFoundedOn_union, wellFoundedOn_singleton, true_and_iff]
 #align set.well_founded_on_insert Set.wellFoundedOn_insert
 
-theorem WellFoundedOn.insert (h : WellFoundedOn s r) (a : α) : WellFoundedOn (insert a s) r :=
+protected theorem WellFoundedOn.insert (h : WellFoundedOn s r) (a : α) :
+    WellFoundedOn (insert a s) r :=
   wellFoundedOn_insert.2 h
 #align set.well_founded_on.insert Set.WellFoundedOn.insert
 
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) 2021 Aaron Anderson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
-
-! This file was ported from Lean 3 source module order.well_founded_set
-! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Init.Data.Sigma.Lex
 import Mathlib.Data.Sigma.Lex
@@ -15,6 +10,8 @@ import Mathlib.Order.OrderIsoNat
 import Mathlib.Order.WellFounded
 import Mathlib.Tactic.TFAE
 
+#align_import order.well_founded_set from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
+
 /-!
 # Well-founded sets
 
feat: prod.lex is well-founded (#5943)

Match https://github.com/leanprover-community/mathlib/pull/18665

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

Diff
@@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Aaron Anderson
 
 ! This file was ported from Lean 3 source module order.well_founded_set
-! leanprover-community/mathlib commit bcfa726826abd57587355b4b5b7e78ad6527b7e4
+! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
+import Mathlib.Init.Data.Sigma.Lex
+import Mathlib.Data.Sigma.Lex
 import Mathlib.Order.Antichain
 import Mathlib.Order.OrderIsoNat
 import Mathlib.Order.WellFounded
@@ -48,7 +50,7 @@ Prove that `s` is partial well ordered iff it has no infinite descending chain o
 -/
 
 
-variable {ι α β : Type _}
+variable {ι α β γ : Type _} {π : ι → Type _}
 
 namespace Set
 
@@ -71,7 +73,7 @@ variable {r r' : α → α → Prop}
 
 section AnyRel
 
-variable {s t : Set α} {x y : α}
+variable {f : β → α} {s t : Set α} {x y : α}
 
 theorem wellFoundedOn_iff :
     s.WellFoundedOn r ↔ WellFounded fun a b : α => r a b ∧ a ∈ s ∧ b ∈ s := by
@@ -88,6 +90,31 @@ theorem wellFoundedOn_iff :
     exact ⟨m, mt, fun x _ ⟨_, _, ms⟩ => hst ⟨m, ⟨ms, mt⟩⟩⟩
 #align set.well_founded_on_iff Set.wellFoundedOn_iff
 
+@[simp]
+theorem wellFoundedOn_univ : (univ : Set α).WellFoundedOn r ↔ WellFounded r := by
+  simp [wellFoundedOn_iff]
+#align set.well_founded_on_univ Set.wellFoundedOn_univ
+
+theorem _root_.WellFounded.wellFoundedOn : WellFounded r → s.WellFoundedOn r :=
+  InvImage.wf _
+#align well_founded.well_founded_on WellFounded.wellFoundedOn
+
+@[simp]
+theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f) := by
+  let f' : β → range f := fun c => ⟨f c, c, rfl⟩
+  refine' ⟨fun h => (InvImage.wf f' h).mono fun c c' => id, fun h => ⟨_⟩⟩
+  rintro ⟨_, c, rfl⟩
+  refine' Acc.of_downward_closed f' _ _ _
+  · rintro _ ⟨_, c', rfl⟩ -
+    exact ⟨c', rfl⟩
+  · exact h.apply _
+#align set.well_founded_on_range Set.wellFoundedOn_range
+
+@[simp]
+theorem wellFoundedOn_image {s : Set β} : (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f) := by
+  rw [image_eq_range]; exact wellFoundedOn_range
+#align set.well_founded_on_image Set.wellFoundedOn_image
+
 namespace WellFoundedOn
 
 protected theorem induction (hs : s.WellFoundedOn r) (hx : x ∈ s) {P : α → Prop}
@@ -104,6 +131,11 @@ protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t)
   exact Subrelation.wf (fun xy => ⟨hle _ _ xy.1, hst xy.2.1, hst xy.2.2⟩) h
 #align set.well_founded_on.mono Set.WellFoundedOn.mono
 
+theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
+    s.WellFoundedOn r → s.WellFoundedOn r' :=
+  Subrelation.wf @fun a b => h _ a.2 _ b.2
+#align set.well_founded_on.mono' Set.WellFoundedOn.mono'
+
 theorem subset (h : t.WellFoundedOn r) (hst : s ⊆ t) : s.WellFoundedOn r :=
   h.mono le_rfl hst
 #align set.well_founded_on.subset Set.WellFoundedOn.subset
@@ -811,3 +843,69 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
 #align pi.is_pwo Pi.isPwo
+
+section ProdLex
+variable {rα : α → α → Prop} {rβ : β → β → Prop} {f : γ → α} {g : γ → β} {s : Set γ}
+
+/-- Stronger version of `prod.lex_wf`. Instead of requiring `rβ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
+    (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
+    WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) := by
+  refine' (PSigma.lex_wf (wellFoundedOn_range.2 hα) fun a => hβ a).onFun.mono fun c c' h => _
+  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  obtain h' | h' := Prod.lex_iff.1 h
+  · exact PSigma.Lex.left _ _ h'
+  · dsimp only [InvImage, (· on ·)] at h' ⊢
+    convert PSigma.Lex.right (⟨_, c', rfl⟩ : range f) _ using 1; swap
+    exacts [⟨c, h'.1⟩, PSigma.subtype_ext (Subtype.ext h'.1) rfl, h'.2]
+#align well_founded.prod_lex_of_well_founded_on_fiber WellFounded.prod_lex_of_wellFoundedOn_fiber
+
+theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn (rα on f))
+    (hβ : ∀ a, (s ∩ f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
+    s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) := by
+  refine' WellFounded.prod_lex_of_wellFoundedOn_fiber hα fun a ↦ (hβ a).onFun.mono (fun b c h ↦ _)
+  swap
+  exact fun _ x => ⟨x, x.1.2, x.2⟩
+  assumption
+#align set.well_founded_on.prod_lex_of_well_founded_on_fiber Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
+
+end ProdLex
+
+section SigmaLex
+
+variable {rι : ι → ι → Prop} {rπ : ∀ i, π i → π i → Prop} {f : γ → ι} {g : ∀ i, γ → π i} {s : Set γ}
+
+/-- Stronger version of `psigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
+require it to be well-founded on fibers of `f`.-/
+theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
+    (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
+    WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by
+  refine' (PSigma.lex_wf (wellFoundedOn_range.2 hι) fun a => hπ a).onFun.mono fun c c' h => _
+  exact fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩
+  obtain h' | ⟨h', h''⟩ := Sigma.lex_iff.1 h
+  · exact PSigma.Lex.left _ _ h'
+  · dsimp only [InvImage, (· on ·)] at h' ⊢
+    convert PSigma.Lex.right (⟨_, c', rfl⟩ : range f) _ using 1; swap
+    · exact ⟨c, h'⟩
+    · exact PSigma.subtype_ext (Subtype.ext h') rfl
+    · dsimp only [Subtype.coe_mk] at *
+      revert h'
+      generalize f c = d
+      rintro rfl h''
+      exact h''
+#align well_founded.sigma_lex_of_well_founded_on_fiber WellFounded.sigma_lex_of_wellFoundedOn_fiber
+
+theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f))
+    (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
+    s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by
+  show WellFounded (Sigma.Lex rι rπ on fun c : s => ⟨f c, g (f c) c⟩)
+  refine'
+    @WellFounded.sigma_lex_of_wellFoundedOn_fiber _ s _ _ rπ (fun c => f c) (fun i c => g _ c) hι
+      fun i => (hπ i).onFun.mono (fun b c h => _)
+  swap
+  exact fun _ x => ⟨x, x.1.2, x.2⟩
+  assumption
+#align set.well_founded_on.sigma_lex_of_well_founded_on_fiber Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
+
+end SigmaLex
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -697,7 +697,7 @@ noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (
     (hf : IsBadSeq r s f) :
     { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by
   classical
-    have h : ∃ (k : ℕ)(g : ℕ → α), (∀ m, m < n → f m = g m) ∧ IsBadSeq r s g ∧ rk (g n) = k :=
+    have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ IsBadSeq r s g ∧ rk (g n) = k :=
       ⟨_, f, fun _ _ => rfl, hf, rfl⟩
     obtain ⟨h1, h2, h3⟩ := Classical.choose_spec (Nat.find_spec h)
     refine' ⟨Classical.choose (Nat.find_spec h), h1, by convert h2, fun g hg1 hg2 con => _⟩
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
@@ -350,7 +350,7 @@ theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrdere
   obtain ⟨g, h1 | h2⟩ := exists_increasing_or_nonincreasing_subseq r f
   · refine' ⟨g, fun m n hle => _⟩
     obtain hlt | rfl := hle.lt_or_eq
-    exacts[h1 m n hlt, refl_of r _]
+    exacts [h1 m n hlt, refl_of r _]
   · exfalso
     obtain ⟨m, n, hlt, hle⟩ := h (f ∘ g) fun n => hf _
     exact h2 m n hlt hle
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
@@ -564,12 +564,12 @@ protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
 
 theorem wellFoundedOn_sup [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
     (s.sup f).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r :=
-  Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bunionᵢ, hs]
+  Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_biUnion, hs]
 #align finset.well_founded_on_sup Finset.wellFoundedOn_sup
 
 theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
     (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r :=
-  Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_bunionᵢ, hs]
+  Finset.cons_induction_on s (by simp) fun a s ha hs => by simp [-sup_set_eq_biUnion, hs]
 #align finset.partially_well_ordered_on_sup Finset.partiallyWellOrderedOn_sup
 
 theorem isWf_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
@@ -585,13 +585,13 @@ theorem isPwo_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
 @[simp]
 theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r := by
-  simpa only [Finset.sup_eq_supᵢ] using s.wellFoundedOn_sup
+  simpa only [Finset.sup_eq_iSup] using s.wellFoundedOn_sup
 #align finset.well_founded_on_bUnion Finset.wellFoundedOn_bUnion
 
 @[simp]
 theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
     (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r := by
-  simpa only [Finset.sup_eq_supᵢ] using s.partiallyWellOrderedOn_sup
+  simpa only [Finset.sup_eq_iSup] using s.partiallyWellOrderedOn_sup
 #align finset.partially_well_ordered_on_bUnion Finset.partiallyWellOrderedOn_bUnion
 
 @[simp]
chore: restore some tfae proofs (#2959)
Diff
@@ -11,7 +11,7 @@ Authors: Aaron Anderson
 import Mathlib.Order.Antichain
 import Mathlib.Order.OrderIsoNat
 import Mathlib.Order.WellFounded
-import Mathlib.Data.List.TFAE
+import Mathlib.Tactic.TFAE
 
 /-!
 # Well-founded sets
@@ -117,15 +117,18 @@ theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
     TFAE [Acc r a,
       WellFoundedOn { b | ReflTransGen r b a } r,
       WellFoundedOn { b | TransGen r b a } r] := by
-  apply_rules [tfae_of_cycle, Chain.cons, Chain.nil] <;> dsimp only [ilast']
+  tfae_have 1 → 2
   · refine fun h => ⟨fun b => InvImage.accessible _ ?_⟩
     rw [← acc_transGen_iff] at h ⊢
     obtain h' | h' := reflTransGen_iff_eq_or_transGen.1 b.2
     · rwa [h'] at h
     · exact h.inv h'
+  tfae_have 2 → 3
   · exact fun h => h.subset fun _ => TransGen.to_reflTransGen
+  tfae_have 3 → 1
   · refine fun h => Acc.intro _ (fun b hb => (h.apply ⟨b, .single hb⟩).of_fibration Subtype.val ?_)
     exact fun ⟨c, hc⟩ d h => ⟨⟨d, .head h hc⟩, h, rfl⟩
+  tfae_finish
 #align set.well_founded_on.acc_iff_well_founded_on Set.WellFoundedOn.acc_iff_wellFoundedOn
 
 end WellFoundedOn
@@ -808,4 +811,3 @@ theorem Pi.isPwo {α : ι → Type _} [∀ i, LinearOrder (α i)] [∀ i, IsWell
     refine' ⟨g'.trans g, fun a b hab => (Finset.forall_mem_cons _ _).2 _⟩
     exact ⟨hg (OrderHomClass.mono g' hab), hg' hab⟩
 #align pi.is_pwo Pi.isPwo
-
feat: port Order.WellFoundedSet (#1975)

Dependencies 7 + 248

249 files ported (97.3%)
106727 lines ported (97.2%)
Show graph

The unported dependencies are