order.well_foundedMathlib.Order.WellFounded

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
@@ -21,21 +21,24 @@ and provide a few new definitions: `well_founded.min`, `well_founded.sup`, and `
 and an induction principle `well_founded.induction_bot`.
 -/
 
-variables {α : Type*}
+variables {α β γ : Type*}
 
 namespace well_founded
+variables {r r' : α → α → Prop}
 
-protected theorem is_asymm {α : Sort*} {r : α → α → Prop} (h : well_founded r) : is_asymm α r :=
-⟨h.asymmetric⟩
+protected theorem is_asymm (h : well_founded r) : is_asymm α r := ⟨h.asymmetric⟩
 
-instance {α : Sort*} [has_well_founded α] : is_asymm α has_well_founded.r :=
-has_well_founded.wf.is_asymm
-
-protected theorem is_irrefl {α : Sort*} {r : α → α → Prop} (h : well_founded r) : is_irrefl α r :=
+protected theorem is_irrefl (h : well_founded r) : is_irrefl α r :=
 (@is_asymm.is_irrefl α r h.is_asymm)
 
-instance {α : Sort*} [has_well_founded α] : is_irrefl α has_well_founded.r :=
-is_asymm.is_irrefl
+instance [has_well_founded α] : is_asymm α has_well_founded.r := has_well_founded.wf.is_asymm
+instance [has_well_founded α] : is_irrefl α has_well_founded.r := is_asymm.is_irrefl
+
+lemma mono (hr : well_founded r) (h : ∀ a b, r' a b → r a b) : well_founded r' :=
+subrelation.wf h hr
+
+lemma on_fun {α β : Sort*} {r : β → β → Prop} {f : α → β} :
+  well_founded r → well_founded (r on f) := inv_image.wf _
 
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
 with respect to `r`. -/
@@ -110,8 +113,7 @@ end
 
 section linear_order
 
-variables {β : Type*} [linear_order β] (h : well_founded ((<) : β → β → Prop))
-  {γ : Type*} [partial_order γ]
+variables [linear_order β] (h : well_founded ((<) : β → β → Prop)) [partial_order γ]
 
 theorem min_le {x : β} {s : set β} (hx : x ∈ s) (hne : s.nonempty := ⟨x, hx⟩) :
   h.min s hne ≤ x :=
@@ -149,8 +151,7 @@ end linear_order
 end well_founded
 
 namespace function
-
-variables {β : Type*} (f : α → β)
+variables (f : α → β)
 
 section has_lt
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

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

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

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

Diff
@@ -72,26 +72,6 @@ begin
   exact hm' y hy' hy
 end
 
-lemma eq_iff_not_lt_of_le {α} [partial_order α] {x y : α} : x ≤ y → y = x ↔ ¬ x < y :=
-begin
-  split,
-  { intros xle nge,
-    cases le_not_le_of_lt nge,
-    rw xle left at nge,
-    exact lt_irrefl x nge },
-  { intros ngt xle,
-    contrapose! ngt,
-    exact lt_of_le_of_ne xle (ne.symm ngt) }
-end
-
-theorem well_founded_iff_has_max' [partial_order α] : (well_founded ((>) : α → α → Prop) ↔
-  ∀ (p : set α), p.nonempty → ∃ m ∈ p, ∀ x ∈ p, m ≤ x → x = m) :=
-by simp only [eq_iff_not_lt_of_le, well_founded_iff_has_min]
-
-theorem well_founded_iff_has_min' [partial_order α] : (well_founded (has_lt.lt : α → α → Prop)) ↔
-  ∀ (p : set α), p.nonempty → ∃ m ∈ p, ∀ x ∈ p, x ≤ m → x = m :=
-@well_founded_iff_has_max' αᵒᵈ _
-
 open set
 /-- The supremum of a bounded, well-founded order -/
 protected noncomputable def sup {r : α → α → Prop} (wf : well_founded r) (s : set α)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -157,7 +157,7 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
   constructor
   · intro h';
     have : ¬r x y := by
-      intro hy; rw [WellFounded.succ, dif_pos] at h' 
+      intro hy; rw [WellFounded.succ, dif_pos] at h'
       exact wo.wf.not_lt_min _ h hy h'
     rcases trichotomous_of r x y with (hy | hy | hy)
     exfalso; exact this hy
@@ -183,8 +183,8 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
   by
   obtain ⟨c, hc⟩ : g b ∈ Set.range f := by rw [hfg]; exact Set.mem_range_self b
   cases' lt_or_le c b with hcb hbc
-  · rw [H c hcb] at hc 
-    rw [hg.injective hc] at hcb 
+  · rw [H c hcb] at hc
+    rw [hg.injective hc] at hcb
     exact hcb.false.elim
   · rw [← hc]
     exact hf.monotone hbc
Diff
@@ -203,7 +203,7 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
 -/
 
 #print WellFounded.self_le_of_strictMono /-
-theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra' h₁;
+theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra! h₁;
   have h₂ := h.min_mem _ h₁; exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
 -/
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2020 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 -/
-import Mathbin.Tactic.ByContra
-import Mathbin.Data.Set.Image
+import Tactic.ByContra
+import Data.Set.Image
 
 #align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
-
-! This file was ported from Lean 3 source module order.well_founded
-! 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.Tactic.ByContra
 import Mathbin.Data.Set.Image
 
+#align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
+
 /-!
 # Well-founded relations
 
Diff
@@ -51,14 +51,18 @@ instance [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.R :=
 instance [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.R :=
   IsAsymm.isIrrefl
 
+#print WellFounded.mono /-
 theorem mono (hr : WellFounded r) (h : ∀ a b, r' a b → r a b) : WellFounded r' :=
   Subrelation.wf h hr
 #align well_founded.mono WellFounded.mono
+-/
 
+#print WellFounded.onFun /-
 theorem onFun {α β : Sort _} {r : β → β → Prop} {f : α → β} :
     WellFounded r → WellFounded (r on f) :=
   InvImage.wf _
 #align well_founded.on_fun WellFounded.onFun
+-/
 
 #print WellFounded.has_min /-
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.well_founded
-! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
+! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -27,28 +27,39 @@ and an induction principle `well_founded.induction_bot`.
 -/
 
 
-variable {α : Type _}
+variable {α β γ : Type _}
 
 namespace WellFounded
 
+variable {r r' : α → α → Prop}
+
 #print WellFounded.isAsymm /-
-protected theorem isAsymm {α : Sort _} {r : α → α → Prop} (h : WellFounded r) : IsAsymm α r :=
+protected theorem isAsymm (h : WellFounded r) : IsAsymm α r :=
   ⟨h.asymmetric⟩
 #align well_founded.is_asymm WellFounded.isAsymm
 -/
 
-instance {α : Sort _} [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.R :=
-  WellFoundedRelation.wf.IsAsymm
-
 #print WellFounded.isIrrefl /-
-protected theorem isIrrefl {α : Sort _} {r : α → α → Prop} (h : WellFounded r) : IsIrrefl α r :=
+protected theorem isIrrefl (h : WellFounded r) : IsIrrefl α r :=
   @IsAsymm.isIrrefl α r h.IsAsymm
 #align well_founded.is_irrefl WellFounded.isIrrefl
 -/
 
-instance {α : Sort _} [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.R :=
+instance [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.R :=
+  WellFoundedRelation.wf.IsAsymm
+
+instance [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.R :=
   IsAsymm.isIrrefl
 
+theorem mono (hr : WellFounded r) (h : ∀ a b, r' a b → r a b) : WellFounded r' :=
+  Subrelation.wf h hr
+#align well_founded.mono WellFounded.mono
+
+theorem onFun {α β : Sort _} {r : β → β → Prop} {f : α → β} :
+    WellFounded r → WellFounded (r on f) :=
+  InvImage.wf _
+#align well_founded.on_fun WellFounded.onFun
+
 #print WellFounded.has_min /-
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
 with respect to `r`. -/
@@ -157,8 +168,7 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
 
 section LinearOrder
 
-variable {β : Type _} [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) {γ : Type _}
-  [PartialOrder γ]
+variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) [PartialOrder γ]
 
 #print WellFounded.min_le /-
 theorem min_le {x : β} {s : Set β} (hx : x ∈ s) (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x :=
@@ -203,7 +213,7 @@ end WellFounded
 
 namespace Function
 
-variable {β : Type _} (f : α → β)
+variable (f : α → β)
 
 section LT
 
Diff
@@ -49,6 +49,7 @@ protected theorem isIrrefl {α : Sort _} {r : α → α → Prop} (h : WellFound
 instance {α : Sort _} [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.R :=
   IsAsymm.isIrrefl
 
+#print WellFounded.has_min /-
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
 with respect to `r`. -/
 theorem has_min {α} {r : α → α → Prop} (H : WellFounded r) (s : Set α) :
@@ -58,6 +59,7 @@ theorem has_min {α} {r : α → α → Prop} (H : WellFounded r) (s : Set α) :
         not_imp_not.1 fun hne hx => hne <| ⟨x, hx, fun y hy hyx => hne <| IH y hyx hy⟩)
       ha
 #align well_founded.has_min WellFounded.has_min
+-/
 
 #print WellFounded.min /-
 /-- A minimal element of a nonempty set in a well-founded order.
@@ -86,6 +88,7 @@ theorem not_lt_min {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h
 #align well_founded.not_lt_min WellFounded.not_lt_min
 -/
 
+#print WellFounded.wellFounded_iff_has_min /-
 theorem wellFounded_iff_has_min {r : α → α → Prop} :
     WellFounded r ↔ ∀ s : Set α, s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m :=
   by
@@ -96,6 +99,7 @@ theorem wellFounded_iff_has_min {r : α → α → Prop} :
   by_contra hy'
   exact hm' y hy' hy
 #align well_founded.well_founded_iff_has_min WellFounded.wellFounded_iff_has_min
+-/
 
 open Set
 
@@ -174,8 +178,7 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
   · rw [← hc]
     exact hf.monotone hbc
 
-include h
-
+#print WellFounded.eq_strictMono_iff_eq_range /-
 theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : StrictMono g) :
     Set.range f = Set.range g ↔ f = g :=
   ⟨fun hfg => by
@@ -186,6 +189,7 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
         (eq_strict_mono_iff_eq_range_aux hg hf hfg.symm fun a hab => (H a hab).symm),
     congr_arg _⟩
 #align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_range
+-/
 
 #print WellFounded.self_le_of_strictMono /-
 theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra' h₁;
@@ -213,9 +217,11 @@ noncomputable def argmin [Nonempty α] : α :=
 #align function.argmin Function.argmin
 -/
 
+#print Function.not_lt_argmin /-
 theorem not_lt_argmin [Nonempty α] (a : α) : ¬f a < f (argmin f h) :=
   WellFounded.not_lt_min (InvImage.wf f h) _ _ (Set.mem_univ a)
 #align function.not_lt_argmin Function.not_lt_argmin
+-/
 
 #print Function.argminOn /-
 /-- Given a function `f : α → β` where `β` carries a well-founded `<`, and a non-empty subset `s`
@@ -226,16 +232,20 @@ noncomputable def argminOn (s : Set α) (hs : s.Nonempty) : α :=
 #align function.argmin_on Function.argminOn
 -/
 
+#print Function.argminOn_mem /-
 @[simp]
 theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s :=
   WellFounded.min_mem _ _ _
 #align function.argmin_on_mem Function.argminOn_mem
+-/
 
+#print Function.not_lt_argminOn /-
 @[simp]
 theorem not_lt_argminOn (s : Set α) {a : α} (ha : a ∈ s)
     (hs : s.Nonempty := Set.nonempty_of_mem ha) : ¬f a < f (argminOn f h s hs) :=
   WellFounded.not_lt_min (InvImage.wf f h) s hs ha
 #align function.not_lt_argmin_on Function.not_lt_argminOn
+-/
 
 end LT
 
@@ -243,16 +253,20 @@ section LinearOrder
 
 variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop))
 
+#print Function.argmin_le /-
 @[simp]
 theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
   not_lt.mp <| not_lt_argmin f h a
 #align function.argmin_le Function.argmin_le
+-/
 
+#print Function.argminOn_le /-
 @[simp]
 theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
     f (argminOn f h s hs) ≤ f a :=
   not_lt.mp <| not_lt_argminOn f h s ha hs
 #align function.argmin_on_le Function.argminOn_le
+-/
 
 end LinearOrder
 
@@ -260,6 +274,7 @@ end Function
 
 section Induction
 
+#print Acc.induction_bot' /-
 /-- Let `r` be a relation on `α`, let `f : α → β` be a function, let `C : β → Prop`, and
 let `bot : α`. This induction principle shows that `C (f bot)` holds, given that
 * some `a` that is accessible by `r` satisfies `C (f a)`, and
@@ -272,6 +287,7 @@ theorem Acc.induction_bot' {α β} {r : α → α → Prop} {a bot : α} (ha : A
       let ⟨y, hy₁, hy₂⟩ := ih x h hC
       ih' y hy₁ hy₂
 #align acc.induction_bot' Acc.induction_bot'
+-/
 
 #print Acc.induction_bot /-
 /-- Let `r` be a relation on `α`, let `C : α → Prop` and let `bot : α`.
@@ -284,6 +300,7 @@ theorem Acc.induction_bot {α} {r : α → α → Prop} {a bot : α} (ha : Acc r
 #align acc.induction_bot Acc.induction_bot
 -/
 
+#print WellFounded.induction_bot' /-
 /-- Let `r` be a well-founded relation on `α`, let `f : α → β` be a function,
 let `C : β → Prop`, and  let `bot : α`.
 This induction principle shows that `C (f bot)` holds, given that
@@ -295,6 +312,7 @@ theorem WellFounded.induction_bot' {α β} {r : α → α → Prop} (hwf : WellF
     C (f a) → C (f bot) :=
   (hwf.apply a).induction_bot' ih
 #align well_founded.induction_bot' WellFounded.induction_bot'
+-/
 
 #print WellFounded.induction_bot /-
 /-- Let `r` be a well-founded relation on `α`, let `C : α → Prop`, and let `bot : α`.
Diff
@@ -103,14 +103,14 @@ open Set
 /-- The supremum of a bounded, well-founded order -/
 protected noncomputable def sup {r : α → α → Prop} (wf : WellFounded r) (s : Set α)
     (h : Bounded r s) : α :=
-  wf.min { x | ∀ a ∈ s, r a x } h
+  wf.min {x | ∀ a ∈ s, r a x} h
 #align well_founded.sup WellFounded.sup
 -/
 
 #print WellFounded.lt_sup /-
 protected theorem lt_sup {r : α → α → Prop} (wf : WellFounded r) {s : Set α} (h : Bounded r s) {x}
     (hx : x ∈ s) : r x (wf.sup s h) :=
-  min_mem wf { x | ∀ a ∈ s, r a x } h x hx
+  min_mem wf {x | ∀ a ∈ s, r a x} h x hx
 #align well_founded.lt_sup WellFounded.lt_sup
 -/
 
@@ -122,7 +122,7 @@ open scoped Classical
 /-- A successor of an element `x` in a well-founded order is a minimal element `y` such that
 `x < y` if one exists. Otherwise it is `x` itself. -/
 protected noncomputable def succ {r : α → α → Prop} (wf : WellFounded r) (x : α) : α :=
-  if h : ∃ y, r x y then wf.min { y | r x y } h else x
+  if h : ∃ y, r x y then wf.min {y | r x y} h else x
 #align well_founded.succ WellFounded.succ
 -/
 
Diff
@@ -141,7 +141,7 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
   constructor
   · intro h';
     have : ¬r x y := by
-      intro hy; rw [WellFounded.succ, dif_pos] at h'
+      intro hy; rw [WellFounded.succ, dif_pos] at h' 
       exact wo.wf.not_lt_min _ h hy h'
     rcases trichotomous_of r x y with (hy | hy | hy)
     exfalso; exact this hy
@@ -168,8 +168,8 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
   by
   obtain ⟨c, hc⟩ : g b ∈ Set.range f := by rw [hfg]; exact Set.mem_range_self b
   cases' lt_or_le c b with hcb hbc
-  · rw [H c hcb] at hc
-    rw [hg.injective hc] at hcb
+  · rw [H c hcb] at hc 
+    rw [hg.injective hc] at hcb 
     exact hcb.false.elim
   · rw [← hc]
     exact hf.monotone hbc
Diff
@@ -116,7 +116,7 @@ protected theorem lt_sup {r : α → α → Prop} (wf : WellFounded r) {s : Set
 
 section
 
-open Classical
+open scoped Classical
 
 #print WellFounded.succ /-
 /-- A successor of an element `x` in a well-founded order is a minimal element `y` such that
@@ -156,9 +156,11 @@ section LinearOrder
 variable {β : Type _} [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) {γ : Type _}
   [PartialOrder γ]
 
+#print WellFounded.min_le /-
 theorem min_le {x : β} {s : Set β} (hx : x ∈ s) (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x :=
   not_lt.1 <| h.not_lt_min _ _ hx
 #align well_founded.min_le WellFounded.min_le
+-/
 
 private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMono f)
     (hg : StrictMono g) (hfg : Set.range f = Set.range g) {b : β} (H : ∀ a < b, f a = g a) :
@@ -185,9 +187,11 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
     congr_arg _⟩
 #align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_range
 
+#print WellFounded.self_le_of_strictMono /-
 theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra' h₁;
   have h₂ := h.min_mem _ h₁; exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
+-/
 
 end LinearOrder
 
Diff
@@ -49,12 +49,6 @@ protected theorem isIrrefl {α : Sort _} {r : α → α → Prop} (h : WellFound
 instance {α : Sort _} [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.R :=
   IsAsymm.isIrrefl
 
-/- warning: well_founded.has_min -> WellFounded.has_min is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, (WellFounded.{succ u1} α r) -> (forall (s : Set.{u1} α), (Set.Nonempty.{u1} α s) -> (Exists.{succ u1} α (fun (a : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) => forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x s) -> (Not (r x a))))))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, (WellFounded.{succ u1} α r) -> (forall (s : Set.{u1} α), (Set.Nonempty.{u1} α s) -> (Exists.{succ u1} α (fun (a : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) (forall (x : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x s) -> (Not (r x a))))))
-Case conversion may be inaccurate. Consider using '#align well_founded.has_min WellFounded.has_minₓ'. -/
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
 with respect to `r`. -/
 theorem has_min {α} {r : α → α → Prop} (H : WellFounded r) (s : Set α) :
@@ -92,12 +86,6 @@ theorem not_lt_min {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h
 #align well_founded.not_lt_min WellFounded.not_lt_min
 -/
 
-/- warning: well_founded.well_founded_iff_has_min -> WellFounded.wellFounded_iff_has_min is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, Iff (WellFounded.{succ u1} α r) (forall (s : Set.{u1} α), (Set.Nonempty.{u1} α s) -> (Exists.{succ u1} α (fun (m : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) => forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x s) -> (Not (r x m))))))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, Iff (WellFounded.{succ u1} α r) (forall (s : Set.{u1} α), (Set.Nonempty.{u1} α s) -> (Exists.{succ u1} α (fun (m : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m s) (forall (x : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x s) -> (Not (r x m))))))
-Case conversion may be inaccurate. Consider using '#align well_founded.well_founded_iff_has_min WellFounded.wellFounded_iff_has_minₓ'. -/
 theorem wellFounded_iff_has_min {r : α → α → Prop} :
     WellFounded r ↔ ∀ s : Set α, s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m :=
   by
@@ -168,12 +156,6 @@ section LinearOrder
 variable {β : Type _} [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) {γ : Type _}
   [PartialOrder γ]
 
-/- warning: well_founded.min_le -> WellFounded.min_le is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) {x : β} {s : Set.{u1} β} (hx : Membership.Mem.{u1, u1} β (Set.{u1} β) (Set.hasMem.{u1} β) x s) (hne : optParam.{0} (Set.Nonempty.{u1} β s) (Exists.intro.{succ u1} β (fun (x : β) => Membership.Mem.{u1, u1} β (Set.{u1} β) (Set.hasMem.{u1} β) x s) x hx)), LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))) (WellFounded.min.{u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))))) h s hne) x
-but is expected to have type
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.921 : β) (x._@.Mathlib.Order.WellFounded._hyg.923 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.921 x._@.Mathlib.Order.WellFounded._hyg.923)) {x : β} {s : Set.{u1} β} (hx : Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) (hne : optParam.{0} (Set.Nonempty.{u1} β s) (Exists.intro.{succ u1} β (fun (x : β) => Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) x hx)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (WellFounded.min.{u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.921 : β) (x._@.Mathlib.Order.WellFounded._hyg.923 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.921 x._@.Mathlib.Order.WellFounded._hyg.923) h s hne) x
-Case conversion may be inaccurate. Consider using '#align well_founded.min_le WellFounded.min_leₓ'. -/
 theorem min_le {x : β} {s : Set β} (hx : x ∈ s) (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x :=
   not_lt.1 <| h.not_lt_min _ _ hx
 #align well_founded.min_le WellFounded.min_le
@@ -192,12 +174,6 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
 
 include h
 
-/- warning: well_founded.eq_strict_mono_iff_eq_range -> WellFounded.eq_strictMono_iff_eq_range is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {γ : Type.{u2}} [_inst_2 : PartialOrder.{u2} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) f) -> (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) g) -> (Iff (Eq.{succ u2} (Set.{u2} γ) (Set.range.{u2, succ u1} γ β f) (Set.range.{u2, succ u1} γ β g)) (Eq.{max (succ u1) (succ u2)} (β -> γ) f g)))
-but is expected to have type
-  forall {β : Type.{u2}} [_inst_1 : LinearOrder.{u2} β], (WellFounded.{succ u2} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1220 : β) (x._@.Mathlib.Order.WellFounded._hyg.1222 : β) => LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1220 x._@.Mathlib.Order.WellFounded._hyg.1222)) -> (forall {γ : Type.{u1}} [_inst_2 : PartialOrder.{u1} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) f) -> (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) g) -> (Iff (Eq.{succ u1} (Set.{u1} γ) (Set.range.{u1, succ u2} γ β f) (Set.range.{u1, succ u2} γ β g)) (Eq.{max (succ u2) (succ u1)} (β -> γ) f g)))
-Case conversion may be inaccurate. Consider using '#align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_rangeₓ'. -/
 theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : StrictMono g) :
     Set.range f = Set.range g ↔ f = g :=
   ⟨fun hfg => by
@@ -209,12 +185,6 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
     congr_arg _⟩
 #align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_range
 
-/- warning: well_founded.self_le_of_strict_mono -> WellFounded.self_le_of_strictMono is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {f : β -> β}, (StrictMono.{u1, u1} β β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) f) -> (forall (n : β), LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))) n (f n)))
-but is expected to have type
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1325 : β) (x._@.Mathlib.Order.WellFounded._hyg.1327 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1325 x._@.Mathlib.Order.WellFounded._hyg.1327)) -> (forall {f : β -> β}, (StrictMono.{u1, u1} β β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) f) -> (forall (n : β), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) n (f n)))
-Case conversion may be inaccurate. Consider using '#align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMonoₓ'. -/
 theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra' h₁;
   have h₂ := h.min_mem _ h₁; exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
@@ -239,12 +209,6 @@ noncomputable def argmin [Nonempty α] : α :=
 #align function.argmin Function.argmin
 -/
 
-/- warning: function.not_lt_argmin -> Function.not_lt_argmin is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) [_inst_2 : Nonempty.{succ u1} α] (a : α), Not (LT.lt.{u2} β _inst_1 (f a) (f (Function.argmin.{u1, u2} α β f _inst_1 h _inst_2)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1526 : β) (x._@.Mathlib.Order.WellFounded._hyg.1528 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1526 x._@.Mathlib.Order.WellFounded._hyg.1528)) [_inst_2 : Nonempty.{succ u2} α] (a : α), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argmin.{u2, u1} α β f _inst_1 h _inst_2)))
-Case conversion may be inaccurate. Consider using '#align function.not_lt_argmin Function.not_lt_argminₓ'. -/
 theorem not_lt_argmin [Nonempty α] (a : α) : ¬f a < f (argmin f h) :=
   WellFounded.not_lt_min (InvImage.wf f h) _ _ (Set.mem_univ a)
 #align function.not_lt_argmin Function.not_lt_argmin
@@ -258,23 +222,11 @@ noncomputable def argminOn (s : Set α) (hs : s.Nonempty) : α :=
 #align function.argmin_on Function.argminOn
 -/
 
-/- warning: function.argmin_on_mem -> Function.argminOn_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) (s : Set.{u1} α) (hs : Set.Nonempty.{u1} α s), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Function.argminOn.{u1, u2} α β f _inst_1 h s hs) s
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1634 : β) (x._@.Mathlib.Order.WellFounded._hyg.1636 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1634 x._@.Mathlib.Order.WellFounded._hyg.1636)) (s : Set.{u2} α) (hs : Set.Nonempty.{u2} α s), Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) (Function.argminOn.{u2, u1} α β f _inst_1 h s hs) s
-Case conversion may be inaccurate. Consider using '#align function.argmin_on_mem Function.argminOn_memₓ'. -/
 @[simp]
 theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s :=
   WellFounded.min_mem _ _ _
 #align function.argmin_on_mem Function.argminOn_mem
 
-/- warning: function.not_lt_argmin_on -> Function.not_lt_argminOn is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), Not (LT.lt.{u2} β _inst_1 (f a) (f (Function.argminOn.{u1, u2} α β f _inst_1 h s hs)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1683 : β) (x._@.Mathlib.Order.WellFounded._hyg.1685 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1683 x._@.Mathlib.Order.WellFounded._hyg.1685)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argminOn.{u2, u1} α β f _inst_1 h s hs)))
-Case conversion may be inaccurate. Consider using '#align function.not_lt_argmin_on Function.not_lt_argminOnₓ'. -/
 @[simp]
 theorem not_lt_argminOn (s : Set α) {a : α} (ha : a ∈ s)
     (hs : s.Nonempty := Set.nonempty_of_mem ha) : ¬f a < f (argminOn f h s hs) :=
@@ -287,23 +239,11 @@ section LinearOrder
 
 variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop))
 
-/- warning: function.argmin_le -> Function.argmin_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (a : α) [_inst_2 : Nonempty.{succ u1} α], LE.le.{u2} β (Preorder.toHasLe.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argmin.{u1, u2} α β f (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h _inst_2)) (f a)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1789 : β) (x._@.Mathlib.Order.WellFounded._hyg.1791 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1789 x._@.Mathlib.Order.WellFounded._hyg.1791)) (a : α) [_inst_2 : Nonempty.{succ u2} α], LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argmin.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h _inst_2)) (f a)
-Case conversion may be inaccurate. Consider using '#align function.argmin_le Function.argmin_leₓ'. -/
 @[simp]
 theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
   not_lt.mp <| not_lt_argmin f h a
 #align function.argmin_le Function.argmin_le
 
-/- warning: function.argmin_on_le -> Function.argminOn_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), LE.le.{u2} β (Preorder.toHasLe.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argminOn.{u1, u2} α β f (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h s hs)) (f a)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1844 : β) (x._@.Mathlib.Order.WellFounded._hyg.1846 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1844 x._@.Mathlib.Order.WellFounded._hyg.1846)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argminOn.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h s hs)) (f a)
-Case conversion may be inaccurate. Consider using '#align function.argmin_on_le Function.argminOn_leₓ'. -/
 @[simp]
 theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
     f (argminOn f h s hs) ≤ f a :=
@@ -316,12 +256,6 @@ end Function
 
 section Induction
 
-/- warning: acc.induction_bot' -> Acc.induction_bot' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {r : α -> α -> Prop} {a : α} {bot : α}, (Acc.{u1} α r a) -> (forall {C : β -> Prop} {f : α -> β}, (forall (b : α), (Ne.{u2} β (f b) (f bot)) -> (C (f b)) -> (Exists.{u1} α (fun (c : α) => And (r c b) (C (f c))))) -> (C (f a)) -> (C (f bot)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {r : α -> α -> Prop} {a : α} {bot : α}, (Acc.{u2} α r a) -> (forall {C : β -> Prop} {f : α -> β}, (forall (b : α), (Ne.{u1} β (f b) (f bot)) -> (C (f b)) -> (Exists.{u2} α (fun (c : α) => And (r c b) (C (f c))))) -> (C (f a)) -> (C (f bot)))
-Case conversion may be inaccurate. Consider using '#align acc.induction_bot' Acc.induction_bot'ₓ'. -/
 /-- Let `r` be a relation on `α`, let `f : α → β` be a function, let `C : β → Prop`, and
 let `bot : α`. This induction principle shows that `C (f bot)` holds, given that
 * some `a` that is accessible by `r` satisfies `C (f a)`, and
@@ -346,12 +280,6 @@ theorem Acc.induction_bot {α} {r : α → α → Prop} {a bot : α} (ha : Acc r
 #align acc.induction_bot Acc.induction_bot
 -/
 
-/- warning: well_founded.induction_bot' -> WellFounded.induction_bot' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {r : α -> α -> Prop}, (WellFounded.{u1} α r) -> (forall {a : α} {bot : α} {C : β -> Prop} {f : α -> β}, (forall (b : α), (Ne.{u2} β (f b) (f bot)) -> (C (f b)) -> (Exists.{u1} α (fun (c : α) => And (r c b) (C (f c))))) -> (C (f a)) -> (C (f bot)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {r : α -> α -> Prop}, (WellFounded.{u2} α r) -> (forall {a : α} {bot : α} {C : β -> Prop} {f : α -> β}, (forall (b : α), (Ne.{u1} β (f b) (f bot)) -> (C (f b)) -> (Exists.{u2} α (fun (c : α) => And (r c b) (C (f c))))) -> (C (f a)) -> (C (f bot)))
-Case conversion may be inaccurate. Consider using '#align well_founded.induction_bot' WellFounded.induction_bot'ₓ'. -/
 /-- Let `r` be a well-founded relation on `α`, let `f : α → β` be a function,
 let `C : β → Prop`, and  let `bot : α`.
 This induction principle shows that `C (f bot)` holds, given that
Diff
@@ -140,9 +140,7 @@ protected noncomputable def succ {r : α → α → Prop} (wf : WellFounded r) (
 
 #print WellFounded.lt_succ /-
 protected theorem lt_succ {r : α → α → Prop} (wf : WellFounded r) {x : α} (h : ∃ y, r x y) :
-    r x (wf.succ x) := by
-  rw [WellFounded.succ, dif_pos h]
-  apply min_mem
+    r x (wf.succ x) := by rw [WellFounded.succ, dif_pos h]; apply min_mem
 #align well_founded.lt_succ WellFounded.lt_succ
 -/
 
@@ -153,18 +151,14 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
     (y : α) : r y (wo.wf.succ x) ↔ r y x ∨ y = x :=
   by
   constructor
-  · intro h'
+  · intro h';
     have : ¬r x y := by
-      intro hy
-      rw [WellFounded.succ, dif_pos] at h'
+      intro hy; rw [WellFounded.succ, dif_pos] at h'
       exact wo.wf.not_lt_min _ h hy h'
     rcases trichotomous_of r x y with (hy | hy | hy)
-    exfalso
-    exact this hy
-    right
-    exact hy.symm
-    left
-    exact hy
+    exfalso; exact this hy
+    right; exact hy.symm
+    left; exact hy
   rintro (hy | rfl); exact trans hy (wo.wf.lt_succ h); exact wo.wf.lt_succ h
 #align well_founded.lt_succ_iff WellFounded.lt_succ_iff
 -/
@@ -188,9 +182,7 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
     (hg : StrictMono g) (hfg : Set.range f = Set.range g) {b : β} (H : ∀ a < b, f a = g a) :
     f b ≤ g b :=
   by
-  obtain ⟨c, hc⟩ : g b ∈ Set.range f := by
-    rw [hfg]
-    exact Set.mem_range_self b
+  obtain ⟨c, hc⟩ : g b ∈ Set.range f := by rw [hfg]; exact Set.mem_range_self b
   cases' lt_or_le c b with hcb hbc
   · rw [H c hcb] at hc
     rw [hg.injective hc] at hcb
@@ -223,11 +215,8 @@ lean 3 declaration is
 but is expected to have type
   forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1325 : β) (x._@.Mathlib.Order.WellFounded._hyg.1327 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1325 x._@.Mathlib.Order.WellFounded._hyg.1327)) -> (forall {f : β -> β}, (StrictMono.{u1, u1} β β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) f) -> (forall (n : β), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) n (f n)))
 Case conversion may be inaccurate. Consider using '#align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMonoₓ'. -/
-theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n :=
-  by
-  by_contra' h₁
-  have h₂ := h.min_mem _ h₁
-  exact h.not_lt_min _ h₁ (hf h₂) h₂
+theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by by_contra' h₁;
+  have h₂ := h.min_mem _ h₁; exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
 
 end LinearOrder
Diff
@@ -197,7 +197,6 @@ private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMo
     exact hcb.false.elim
   · rw [← hc]
     exact hf.monotone hbc
-#align well_founded.eq_strict_mono_iff_eq_range_aux well_founded.eq_strict_mono_iff_eq_range_aux
 
 include h
 
Diff
@@ -174,11 +174,15 @@ section LinearOrder
 variable {β : Type _} [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) {γ : Type _}
   [PartialOrder γ]
 
-#print WellFounded.min_le /-
+/- warning: well_founded.min_le -> WellFounded.min_le is a dubious translation:
+lean 3 declaration is
+  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) {x : β} {s : Set.{u1} β} (hx : Membership.Mem.{u1, u1} β (Set.{u1} β) (Set.hasMem.{u1} β) x s) (hne : optParam.{0} (Set.Nonempty.{u1} β s) (Exists.intro.{succ u1} β (fun (x : β) => Membership.Mem.{u1, u1} β (Set.{u1} β) (Set.hasMem.{u1} β) x s) x hx)), LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))) (WellFounded.min.{u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))))) h s hne) x
+but is expected to have type
+  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.921 : β) (x._@.Mathlib.Order.WellFounded._hyg.923 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.921 x._@.Mathlib.Order.WellFounded._hyg.923)) {x : β} {s : Set.{u1} β} (hx : Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) (hne : optParam.{0} (Set.Nonempty.{u1} β s) (Exists.intro.{succ u1} β (fun (x : β) => Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) x hx)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (WellFounded.min.{u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.921 : β) (x._@.Mathlib.Order.WellFounded._hyg.923 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.921 x._@.Mathlib.Order.WellFounded._hyg.923) h s hne) x
+Case conversion may be inaccurate. Consider using '#align well_founded.min_le WellFounded.min_leₓ'. -/
 theorem min_le {x : β} {s : Set β} (hx : x ∈ s) (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x :=
   not_lt.1 <| h.not_lt_min _ _ hx
 #align well_founded.min_le WellFounded.min_le
--/
 
 private theorem eq_strict_mono_iff_eq_range_aux {f g : β → γ} (hf : StrictMono f)
     (hg : StrictMono g) (hfg : Set.range f = Set.range g) {b : β} (H : ∀ a < b, f a = g a) :
@@ -199,7 +203,7 @@ include h
 
 /- warning: well_founded.eq_strict_mono_iff_eq_range -> WellFounded.eq_strictMono_iff_eq_range is a dubious translation:
 lean 3 declaration is
-  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {γ : Type.{u2}} [_inst_2 : PartialOrder.{u2} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) f) -> (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) g) -> (Iff (Eq.{succ u2} (Set.{u2} γ) (Set.range.{u2, succ u1} γ β f) (Set.range.{u2, succ u1} γ β g)) (Eq.{max (succ u1) (succ u2)} (β -> γ) f g)))
+  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {γ : Type.{u2}} [_inst_2 : PartialOrder.{u2} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) f) -> (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) g) -> (Iff (Eq.{succ u2} (Set.{u2} γ) (Set.range.{u2, succ u1} γ β f) (Set.range.{u2, succ u1} γ β g)) (Eq.{max (succ u1) (succ u2)} (β -> γ) f g)))
 but is expected to have type
   forall {β : Type.{u2}} [_inst_1 : LinearOrder.{u2} β], (WellFounded.{succ u2} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1220 : β) (x._@.Mathlib.Order.WellFounded._hyg.1222 : β) => LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1220 x._@.Mathlib.Order.WellFounded._hyg.1222)) -> (forall {γ : Type.{u1}} [_inst_2 : PartialOrder.{u1} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) f) -> (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) g) -> (Iff (Eq.{succ u1} (Set.{u1} γ) (Set.range.{u1, succ u2} γ β f) (Set.range.{u1, succ u2} γ β g)) (Eq.{max (succ u2) (succ u1)} (β -> γ) f g)))
 Case conversion may be inaccurate. Consider using '#align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_rangeₓ'. -/
@@ -214,14 +218,18 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
     congr_arg _⟩
 #align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_range
 
-#print WellFounded.self_le_of_strictMono /-
+/- warning: well_founded.self_le_of_strict_mono -> WellFounded.self_le_of_strictMono is a dubious translation:
+lean 3 declaration is
+  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {f : β -> β}, (StrictMono.{u1, u1} β β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) f) -> (forall (n : β), LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))) n (f n)))
+but is expected to have type
+  forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1325 : β) (x._@.Mathlib.Order.WellFounded._hyg.1327 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1325 x._@.Mathlib.Order.WellFounded._hyg.1327)) -> (forall {f : β -> β}, (StrictMono.{u1, u1} β β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1))))) f) -> (forall (n : β), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) n (f n)))
+Case conversion may be inaccurate. Consider using '#align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMonoₓ'. -/
 theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n :=
   by
   by_contra' h₁
   have h₂ := h.min_mem _ h₁
   exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
--/
 
 end LinearOrder
 
@@ -293,7 +301,7 @@ variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop))
 
 /- warning: function.argmin_le -> Function.argmin_le is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (a : α) [_inst_2 : Nonempty.{succ u1} α], LE.le.{u2} β (Preorder.toLE.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argmin.{u1, u2} α β f (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h _inst_2)) (f a)
+  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (a : α) [_inst_2 : Nonempty.{succ u1} α], LE.le.{u2} β (Preorder.toHasLe.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argmin.{u1, u2} α β f (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h _inst_2)) (f a)
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1789 : β) (x._@.Mathlib.Order.WellFounded._hyg.1791 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1789 x._@.Mathlib.Order.WellFounded._hyg.1791)) (a : α) [_inst_2 : Nonempty.{succ u2} α], LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argmin.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h _inst_2)) (f a)
 Case conversion may be inaccurate. Consider using '#align function.argmin_le Function.argmin_leₓ'. -/
@@ -304,7 +312,7 @@ theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
 
 /- warning: function.argmin_on_le -> Function.argminOn_le is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), LE.le.{u2} β (Preorder.toLE.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argminOn.{u1, u2} α β f (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h s hs)) (f a)
+  forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), LE.le.{u2} β (Preorder.toHasLe.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argminOn.{u1, u2} α β f (Preorder.toHasLt.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h s hs)) (f a)
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1844 : β) (x._@.Mathlib.Order.WellFounded._hyg.1846 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1844 x._@.Mathlib.Order.WellFounded._hyg.1846)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argminOn.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h s hs)) (f a)
 Case conversion may be inaccurate. Consider using '#align function.argmin_on_le Function.argminOn_leₓ'. -/
Diff
@@ -201,7 +201,7 @@ include h
 lean 3 declaration is
   forall {β : Type.{u1}} [_inst_1 : LinearOrder.{u1} β], (WellFounded.{succ u1} β (LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1))))))) -> (forall {γ : Type.{u2}} [_inst_2 : PartialOrder.{u2} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) f) -> (StrictMono.{u1, u2} β γ (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (LinearOrder.toLattice.{u1} β _inst_1)))) (PartialOrder.toPreorder.{u2} γ _inst_2) g) -> (Iff (Eq.{succ u2} (Set.{u2} γ) (Set.range.{u2, succ u1} γ β f) (Set.range.{u2, succ u1} γ β g)) (Eq.{max (succ u1) (succ u2)} (β -> γ) f g)))
 but is expected to have type
-  forall {β : Type.{u2}} [_inst_1 : LinearOrder.{u2} β], (WellFounded.{succ u2} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1491 : β) (x._@.Mathlib.Order.WellFounded._hyg.1493 : β) => LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1491 x._@.Mathlib.Order.WellFounded._hyg.1493)) -> (forall {γ : Type.{u1}} [_inst_2 : PartialOrder.{u1} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) f) -> (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) g) -> (Iff (Eq.{succ u1} (Set.{u1} γ) (Set.range.{u1, succ u2} γ β f) (Set.range.{u1, succ u2} γ β g)) (Eq.{max (succ u2) (succ u1)} (β -> γ) f g)))
+  forall {β : Type.{u2}} [_inst_1 : LinearOrder.{u2} β], (WellFounded.{succ u2} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1220 : β) (x._@.Mathlib.Order.WellFounded._hyg.1222 : β) => LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1220 x._@.Mathlib.Order.WellFounded._hyg.1222)) -> (forall {γ : Type.{u1}} [_inst_2 : PartialOrder.{u1} γ] {f : β -> γ} {g : β -> γ}, (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) f) -> (StrictMono.{u2, u1} β γ (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (DistribLattice.toLattice.{u2} β (instDistribLattice.{u2} β _inst_1))))) (PartialOrder.toPreorder.{u1} γ _inst_2) g) -> (Iff (Eq.{succ u1} (Set.{u1} γ) (Set.range.{u1, succ u2} γ β f) (Set.range.{u1, succ u2} γ β g)) (Eq.{max (succ u2) (succ u1)} (β -> γ) f g)))
 Case conversion may be inaccurate. Consider using '#align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_rangeₓ'. -/
 theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : StrictMono g) :
     Set.range f = Set.range g ↔ f = g :=
@@ -247,7 +247,7 @@ noncomputable def argmin [Nonempty α] : α :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) [_inst_2 : Nonempty.{succ u1} α] (a : α), Not (LT.lt.{u2} β _inst_1 (f a) (f (Function.argmin.{u1, u2} α β f _inst_1 h _inst_2)))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1797 : β) (x._@.Mathlib.Order.WellFounded._hyg.1799 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1797 x._@.Mathlib.Order.WellFounded._hyg.1799)) [_inst_2 : Nonempty.{succ u2} α] (a : α), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argmin.{u2, u1} α β f _inst_1 h _inst_2)))
+  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1526 : β) (x._@.Mathlib.Order.WellFounded._hyg.1528 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1526 x._@.Mathlib.Order.WellFounded._hyg.1528)) [_inst_2 : Nonempty.{succ u2} α] (a : α), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argmin.{u2, u1} α β f _inst_1 h _inst_2)))
 Case conversion may be inaccurate. Consider using '#align function.not_lt_argmin Function.not_lt_argminₓ'. -/
 theorem not_lt_argmin [Nonempty α] (a : α) : ¬f a < f (argmin f h) :=
   WellFounded.not_lt_min (InvImage.wf f h) _ _ (Set.mem_univ a)
@@ -266,7 +266,7 @@ noncomputable def argminOn (s : Set α) (hs : s.Nonempty) : α :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) (s : Set.{u1} α) (hs : Set.Nonempty.{u1} α s), Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Function.argminOn.{u1, u2} α β f _inst_1 h s hs) s
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1905 : β) (x._@.Mathlib.Order.WellFounded._hyg.1907 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1905 x._@.Mathlib.Order.WellFounded._hyg.1907)) (s : Set.{u2} α) (hs : Set.Nonempty.{u2} α s), Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) (Function.argminOn.{u2, u1} α β f _inst_1 h s hs) s
+  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1634 : β) (x._@.Mathlib.Order.WellFounded._hyg.1636 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1634 x._@.Mathlib.Order.WellFounded._hyg.1636)) (s : Set.{u2} α) (hs : Set.Nonempty.{u2} α s), Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) (Function.argminOn.{u2, u1} α β f _inst_1 h s hs) s
 Case conversion may be inaccurate. Consider using '#align function.argmin_on_mem Function.argminOn_memₓ'. -/
 @[simp]
 theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s :=
@@ -277,7 +277,7 @@ theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LT.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β _inst_1)) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), Not (LT.lt.{u2} β _inst_1 (f a) (f (Function.argminOn.{u1, u2} α β f _inst_1 h s hs)))
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1954 : β) (x._@.Mathlib.Order.WellFounded._hyg.1956 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1954 x._@.Mathlib.Order.WellFounded._hyg.1956)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argminOn.{u2, u1} α β f _inst_1 h s hs)))
+  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LT.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1683 : β) (x._@.Mathlib.Order.WellFounded._hyg.1685 : β) => LT.lt.{u1} β _inst_1 x._@.Mathlib.Order.WellFounded._hyg.1683 x._@.Mathlib.Order.WellFounded._hyg.1685)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), Not (LT.lt.{u1} β _inst_1 (f a) (f (Function.argminOn.{u2, u1} α β f _inst_1 h s hs)))
 Case conversion may be inaccurate. Consider using '#align function.not_lt_argmin_on Function.not_lt_argminOnₓ'. -/
 @[simp]
 theorem not_lt_argminOn (s : Set α) {a : α} (ha : a ∈ s)
@@ -295,7 +295,7 @@ variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop))
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (a : α) [_inst_2 : Nonempty.{succ u1} α], LE.le.{u2} β (Preorder.toLE.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argmin.{u1, u2} α β f (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h _inst_2)) (f a)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.2060 : β) (x._@.Mathlib.Order.WellFounded._hyg.2062 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.2060 x._@.Mathlib.Order.WellFounded._hyg.2062)) (a : α) [_inst_2 : Nonempty.{succ u2} α], LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argmin.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h _inst_2)) (f a)
+  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1789 : β) (x._@.Mathlib.Order.WellFounded._hyg.1791 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1789 x._@.Mathlib.Order.WellFounded._hyg.1791)) (a : α) [_inst_2 : Nonempty.{succ u2} α], LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argmin.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h _inst_2)) (f a)
 Case conversion may be inaccurate. Consider using '#align function.argmin_le Function.argmin_leₓ'. -/
 @[simp]
 theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
@@ -306,7 +306,7 @@ theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) [_inst_1 : LinearOrder.{u2} β] (h : WellFounded.{succ u2} β (LT.lt.{u2} β (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))))) (s : Set.{u1} α) {a : α} (ha : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (hs : optParam.{0} (Set.Nonempty.{u1} α s) (Set.nonempty_of_mem.{u1} α s a ha)), LE.le.{u2} β (Preorder.toLE.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) (f (Function.argminOn.{u1, u2} α β f (Preorder.toLT.{u2} β (PartialOrder.toPreorder.{u2} β (SemilatticeInf.toPartialOrder.{u2} β (Lattice.toSemilatticeInf.{u2} β (LinearOrder.toLattice.{u2} β _inst_1))))) h s hs)) (f a)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.2115 : β) (x._@.Mathlib.Order.WellFounded._hyg.2117 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.2115 x._@.Mathlib.Order.WellFounded._hyg.2117)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argminOn.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h s hs)) (f a)
+  forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) [_inst_1 : LinearOrder.{u1} β] (h : WellFounded.{succ u1} β (fun (x._@.Mathlib.Order.WellFounded._hyg.1844 : β) (x._@.Mathlib.Order.WellFounded._hyg.1846 : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) x._@.Mathlib.Order.WellFounded._hyg.1844 x._@.Mathlib.Order.WellFounded._hyg.1846)) (s : Set.{u2} α) {a : α} (ha : Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (hs : optParam.{0} (Set.Nonempty.{u2} α s) (Set.nonempty_of_mem.{u2} α s a ha)), LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) (f (Function.argminOn.{u2, u1} α β f (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β (SemilatticeInf.toPartialOrder.{u1} β (Lattice.toSemilatticeInf.{u1} β (DistribLattice.toLattice.{u1} β (instDistribLattice.{u1} β _inst_1)))))) h s hs)) (f a)
 Case conversion may be inaccurate. Consider using '#align function.argmin_on_le Function.argminOn_leₓ'. -/
 @[simp]
 theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.well_founded
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
+! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -109,44 +109,6 @@ theorem wellFounded_iff_has_min {r : α → α → Prop} :
   exact hm' y hy' hy
 #align well_founded.well_founded_iff_has_min WellFounded.wellFounded_iff_has_min
 
-#print WellFounded.eq_iff_not_lt_of_le /-
-theorem eq_iff_not_lt_of_le {α} [PartialOrder α] {x y : α} : x ≤ y → y = x ↔ ¬x < y :=
-  by
-  constructor
-  · intro xle nge
-    cases le_not_le_of_lt nge
-    rw [xle left] at nge
-    exact lt_irrefl x nge
-  · intro ngt xle
-    contrapose! ngt
-    exact lt_of_le_of_ne xle (Ne.symm ngt)
-#align well_founded.eq_iff_not_lt_of_le WellFounded.eq_iff_not_lt_of_le
--/
-
-/- warning: well_founded.well_founded_iff_has_max' -> WellFounded.wellFounded_iff_has_max' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)))) (forall (p : Set.{u1} α), (Set.Nonempty.{u1} α p) -> (Exists.{succ u1} α (fun (m : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m p) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m p) => forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x p) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) m x) -> (Eq.{succ u1} α x m)))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (fun (x._@.Mathlib.Order.WellFounded._hyg.641 : α) (x._@.Mathlib.Order.WellFounded._hyg.643 : α) => GT.gt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) x._@.Mathlib.Order.WellFounded._hyg.641 x._@.Mathlib.Order.WellFounded._hyg.643)) (forall (p : Set.{u1} α), (Set.Nonempty.{u1} α p) -> (Exists.{succ u1} α (fun (m : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m p) (forall (x : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x p) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) m x) -> (Eq.{succ u1} α x m)))))
-Case conversion may be inaccurate. Consider using '#align well_founded.well_founded_iff_has_max' WellFounded.wellFounded_iff_has_max'ₓ'. -/
-theorem wellFounded_iff_has_max' [PartialOrder α] :
-    WellFounded ((· > ·) : α → α → Prop) ↔
-      ∀ p : Set α, p.Nonempty → ∃ m ∈ p, ∀ x ∈ p, m ≤ x → x = m :=
-  by simp only [eq_iff_not_lt_of_le, well_founded_iff_has_min]
-#align well_founded.well_founded_iff_has_max' WellFounded.wellFounded_iff_has_max'
-
-/- warning: well_founded.well_founded_iff_has_min' -> WellFounded.wellFounded_iff_has_min' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)))) (forall (p : Set.{u1} α), (Set.Nonempty.{u1} α p) -> (Exists.{succ u1} α (fun (m : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m p) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m p) => forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x p) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) x m) -> (Eq.{succ u1} α x m)))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : PartialOrder.{u1} α], Iff (WellFounded.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)))) (forall (p : Set.{u1} α), (Set.Nonempty.{u1} α p) -> (Exists.{succ u1} α (fun (m : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m p) (forall (x : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) x p) -> (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α _inst_1)) x m) -> (Eq.{succ u1} α x m)))))
-Case conversion may be inaccurate. Consider using '#align well_founded.well_founded_iff_has_min' WellFounded.wellFounded_iff_has_min'ₓ'. -/
-theorem wellFounded_iff_has_min' [PartialOrder α] :
-    WellFounded (LT.lt : α → α → Prop) ↔
-      ∀ p : Set α, p.Nonempty → ∃ m ∈ p, ∀ x ∈ p, x ≤ m → x = m :=
-  @wellFounded_iff_has_max' αᵒᵈ _
-#align well_founded.well_founded_iff_has_min' WellFounded.wellFounded_iff_has_min'
-
 open Set
 
 #print WellFounded.sup /-

Changes in mathlib4

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

A PR accompanying #12339.

Zulip discussion

Diff
@@ -129,13 +129,13 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
       rw [WellFounded.succ, dif_pos] at h'
       exact wo.wf.not_lt_min _ h hy h'
     rcases trichotomous_of r x y with (hy | hy | hy)
-    exfalso
-    exact this hy
-    right
-    exact hy.symm
+    · exfalso
+      exact this hy
+    · right
+      exact hy.symm
     left
     exact hy
-  rintro (hy | rfl); exact _root_.trans hy (wo.wf.lt_succ h); exact wo.wf.lt_succ h
+  rintro (hy | rfl); (· exact _root_.trans hy (wo.wf.lt_succ h)); exact wo.wf.lt_succ h
 #align well_founded.lt_succ_iff WellFounded.lt_succ_iff
 
 section LinearOrder
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -104,7 +104,7 @@ protected theorem lt_sup {r : α → α → Prop} (wf : WellFounded r) {s : Set
 
 section
 
-open Classical
+open scoped Classical
 
 /-- A successor of an element `x` in a well-founded order is a minimal element `y` such that
 `x < y` if one exists. Otherwise it is `x` itself. -/
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
@@ -227,7 +227,7 @@ theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
   not_lt.mp <| not_lt_argmin f h a
 #align function.argmin_le Function.argmin_le
 
--- sPorting note (#11119): @[simp] removed as it will never apply
+-- Porting note (#11119): @[simp] removed as it will never apply
 theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
     f (argminOn f h s hs) ≤ f a :=
   not_lt.mp <| not_lt_argminOn f h s ha hs
chore: classify @[simp] removed porting notes (#11121)

Classifies by adding issue number #11119 to porting notes claiming anything semantically equivalent to:

  • "@[simp] removed [...]"
  • "@[simp] removed [...]"
  • "removed @[simp]"
Diff
@@ -210,7 +210,7 @@ theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s :=
   WellFounded.min_mem _ _ _
 #align function.argmin_on_mem Function.argminOn_mem
 
---Porting note: @[simp] removed as it will never apply
+-- Porting note (#11119): @[simp] removed as it will never apply
 theorem not_lt_argminOn (s : Set α) {a : α} (ha : a ∈ s)
     (hs : s.Nonempty := Set.nonempty_of_mem ha) : ¬f a < f (argminOn f h s hs) :=
   WellFounded.not_lt_min (InvImage.wf f h) s hs ha
@@ -222,12 +222,12 @@ section LinearOrder
 
 variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop))
 
---Porting note: @[simp] removed as it will never apply
+-- Porting note (#11119): @[simp] removed as it will never apply
 theorem argmin_le (a : α) [Nonempty α] : f (argmin f h) ≤ f a :=
   not_lt.mp <| not_lt_argmin f h a
 #align function.argmin_le Function.argmin_le
 
---Porting note: @[simp] removed as it will never apply
+-- sPorting note (#11119): @[simp] removed as it will never apply
 theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
     f (argminOn f h s hs) ≤ f a :=
   not_lt.mp <| not_lt_argminOn f h s ha hs
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

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

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 -/
-import Mathlib.Data.Set.Image
+import Mathlib.Data.Set.Basic
 
 #align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
 
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
@@ -171,7 +171,7 @@ theorem eq_strictMono_iff_eq_range {f g : β → γ} (hf : StrictMono f) (hg : S
 #align well_founded.eq_strict_mono_iff_eq_range WellFounded.eq_strictMono_iff_eq_range
 
 theorem self_le_of_strictMono {f : β → β} (hf : StrictMono f) : ∀ n, n ≤ f n := by
-  by_contra' h₁
+  by_contra! h₁
   have h₂ := h.min_mem _ h₁
   exact h.not_lt_min _ h₁ (hf h₂) h₂
 #align well_founded.self_le_of_strict_mono WellFounded.self_le_of_strictMono
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
@@ -20,7 +20,7 @@ and an induction principle `WellFounded.induction_bot`.
 -/
 
 
-variable {α β γ : Type _}
+variable {α β γ : Type*}
 
 namespace WellFounded
 
@@ -43,7 +43,7 @@ theorem mono (hr : WellFounded r) (h : ∀ a b, r' a b → r a b) : WellFounded
   Subrelation.wf (h _ _) hr
 #align well_founded.mono WellFounded.mono
 
-theorem onFun {α β : Sort _} {r : β → β → Prop} {f : α → β} :
+theorem onFun {α β : Sort*} {r : β → β → Prop} {f : α → β} :
     WellFounded r → WellFounded (r on f) :=
   InvImage.wf _
 #align well_founded.on_fun WellFounded.onFun
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,14 +2,11 @@
 Copyright (c) 2020 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
-
-! This file was ported from Lean 3 source module order.well_founded
-! 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.Data.Set.Image
 
+#align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
+
 /-!
 # Well-founded relations
 
chore: cleanup whitespace (#5988)

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

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

Diff
@@ -265,7 +265,7 @@ theorem Acc.induction_bot {α} {r : α → α → Prop} {a bot : α} (ha : Acc r
 #align acc.induction_bot Acc.induction_bot
 
 /-- Let `r` be a well-founded relation on `α`, let `f : α → β` be a function,
-let `C : β → Prop`, and  let `bot : α`.
+let `C : β → Prop`, and let `bot : α`.
 This induction principle shows that `C (f bot)` holds, given that
 * some `a` satisfies `C (f a)`, and
 * for each `b` such that `f b ≠ f bot` and `C (f b)` holds, there is `c`
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,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.well_founded
-! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
+! leanprover-community/mathlib commit 2c84c2c5496117349007d97104e7bbb471381592
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -23,25 +23,33 @@ and an induction principle `WellFounded.induction_bot`.
 -/
 
 
-variable {α : Type _}
+variable {α β γ : Type _}
 
 namespace WellFounded
 
+variable {r r' : α → α → Prop}
+
 #align well_founded_relation.r WellFoundedRelation.rel
 
-protected theorem isAsymm {α : Sort _} {r : α → α → Prop} (h : WellFounded r) : IsAsymm α r :=
-  ⟨h.asymmetric⟩
+protected theorem isAsymm (h : WellFounded r) : IsAsymm α r := ⟨h.asymmetric⟩
 #align well_founded.is_asymm WellFounded.isAsymm
 
-instance {α : Sort _} [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.rel :=
+protected theorem isIrrefl (h : WellFounded r) : IsIrrefl α r := @IsAsymm.isIrrefl α r h.isAsymm
+#align well_founded.is_irrefl WellFounded.isIrrefl
+
+instance [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.rel :=
   WellFoundedRelation.wf.isAsymm
 
-protected theorem isIrrefl {α : Sort _} {r : α → α → Prop} (h : WellFounded r) : IsIrrefl α r :=
-  @IsAsymm.isIrrefl α r h.isAsymm
-#align well_founded.is_irrefl WellFounded.isIrrefl
+instance : IsIrrefl α WellFoundedRelation.rel := IsAsymm.isIrrefl
+
+theorem mono (hr : WellFounded r) (h : ∀ a b, r' a b → r a b) : WellFounded r' :=
+  Subrelation.wf (h _ _) hr
+#align well_founded.mono WellFounded.mono
 
-instance {α : Sort _} [WellFoundedRelation α] : IsIrrefl α WellFoundedRelation.rel :=
-  IsAsymm.isIrrefl
+theorem onFun {α β : Sort _} {r : β → β → Prop} {f : α → β} :
+    WellFounded r → WellFounded (r on f) :=
+  InvImage.wf _
+#align well_founded.on_fun WellFounded.onFun
 
 /-- If `r` is a well-founded relation, then any nonempty set has a minimal element
 with respect to `r`. -/
@@ -135,8 +143,7 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
 
 section LinearOrder
 
-variable {β : Type _} [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) {γ : Type _}
-  [PartialOrder γ]
+variable [LinearOrder β] (h : WellFounded ((· < ·) : β → β → Prop)) [PartialOrder γ]
 
 theorem min_le {x : β} {s : Set β} (hx : x ∈ s) (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x :=
   not_lt.1 <| h.not_lt_min _ _ hx
@@ -178,7 +185,7 @@ end WellFounded
 
 namespace Function
 
-variable {β : Type _} (f : α → β)
+variable (f : α → β)
 
 section LT
 
feat: add Mathlib.Tactic.Common, and import (#4056)

This makes a mathlib4 version of mathlib3's tactic.basic, now called Mathlib.Tactic.Common, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.

This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.

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

Diff
@@ -8,7 +8,6 @@ Authors: Jeremy Avigad, Mario Carneiro
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathlib.Tactic.ByContra
 import Mathlib.Data.Set.Image
 
 /-!
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
 
 ! This file was ported from Lean 3 source module order.well_founded
-! leanprover-community/mathlib commit 1c521b4fb909320eca16b2bb6f8b5b0490b1cb5e
+! leanprover-community/mathlib commit 210657c4ea4a4a7b234392f70a3a2a83346dfa90
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -85,28 +85,6 @@ theorem wellFounded_iff_has_min {r : α → α → Prop} :
   exact hm' y hy' hy
 #align well_founded.well_founded_iff_has_min WellFounded.wellFounded_iff_has_min
 
-theorem eq_iff_not_lt_of_le {α} [PartialOrder α] {x y : α} : (x ≤ y → y = x) ↔ ¬x < y := by
-  constructor
-  · intro xle nge
-    rw [xle (le_not_le_of_lt nge).1] at nge
-    exact lt_irrefl x nge
-  . intro ngt xle
-    contrapose! ngt
-    exact lt_of_le_of_ne xle (Ne.symm ngt)
-#align well_founded.eq_iff_not_lt_of_le WellFounded.eq_iff_not_lt_of_le
-
-theorem wellFounded_iff_has_max' [PartialOrder α] :
-    WellFounded ((· > ·) : α → α → Prop) ↔
-      ∀ p : Set α, p.Nonempty → ∃ m ∈ p, ∀ x ∈ p, m ≤ x → x = m :=
-  by simp [eq_iff_not_lt_of_le, wellFounded_iff_has_min]
-#align well_founded.well_founded_iff_has_max' WellFounded.wellFounded_iff_has_max'
-
-theorem wellFounded_iff_has_min' [PartialOrder α] :
-    WellFounded (LT.lt : α → α → Prop) ↔
-      ∀ p : Set α, p.Nonempty → ∃ m ∈ p, ∀ x ∈ p, x ≤ m → x = m :=
-  @wellFounded_iff_has_max' αᵒᵈ _
-#align well_founded.well_founded_iff_has_min' WellFounded.wellFounded_iff_has_min'
-
 open Set
 
 /-- The supremum of a bounded, well-founded order -/
Feat: prove IsTrans α r → Trans r r r and Trans r r r → IsTrans α r (#1522)

Now Trans.trans conflicts with _root_.trans.

Diff
@@ -153,7 +153,7 @@ protected theorem lt_succ_iff {r : α → α → Prop} [wo : IsWellOrder α r] {
     exact hy.symm
     left
     exact hy
-  rintro (hy | rfl); exact trans hy (wo.wf.lt_succ h); exact wo.wf.lt_succ h
+  rintro (hy | rfl); exact _root_.trans hy (wo.wf.lt_succ h); exact wo.wf.lt_succ h
 #align well_founded.lt_succ_iff WellFounded.lt_succ_iff
 
 section LinearOrder
chore: add source headers to ported theory files (#1094)

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

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2020 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Mario Carneiro
+
+! This file was ported from Lean 3 source module order.well_founded
+! leanprover-community/mathlib commit 1c521b4fb909320eca16b2bb6f8b5b0490b1cb5e
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Tactic.ByContra
 import Mathlib.Data.Set.Image

Dependencies 37

38 files ported (100.0%)
20995 lines ported (100.0%)

All dependencies are ported!