File: Mathlib/Order/WellFoundedSet.lean

full_name: Set.WellFoundedOn
code: /-- `s.WellFoundedOn r` indicates that the relation `r` is well-founded when restricted to `s`. -/
def WellFoundedOn (s : Set α) (r : α → α → Prop) : Prop 
goal: Prop

full_name: Set.wellFoundedOn_empty
code: @[simp]
theorem wellFoundedOn_empty (r : α → α → Prop) : WellFoundedOn ∅ r 
goal: ∅.WellFoundedOn r

full_name: Set.wellFoundedOn_iff
code: theorem wellFoundedOn_iff :
    s.WellFoundedOn r ↔ WellFounded fun a b : α => r a b ∧ a ∈ s ∧ b ∈ s 
goal: s.WellFoundedOn r ↔ WellFounded fun a b => r a b ∧ a ∈ s ∧ b ∈ s

full_name: Set.wellFoundedOn_univ
code: @[simp]
theorem wellFoundedOn_univ : (univ : Set α).WellFoundedOn r ↔ WellFounded r 
goal: Set.univ.WellFoundedOn r ↔ WellFounded r

full_name: WellFounded.wellFoundedOn
code: theorem _root_.WellFounded.wellFoundedOn : WellFounded r → s.WellFoundedOn r 
goal: WellFounded r → s.WellFoundedOn r

full_name: Set.wellFoundedOn_range
code: @[simp]
theorem wellFoundedOn_range : (range f).WellFoundedOn r ↔ WellFounded (r on f) 
goal: (Set.range f).WellFoundedOn r ↔ WellFounded (r on f)

full_name: Set.wellFoundedOn_image
code: @[simp]
theorem wellFoundedOn_image {s : Set β} : (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f) 
goal: (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f)

full_name: Set.WellFoundedOn.induction
code: protected theorem induction (hs : s.WellFoundedOn r) (hx : x ∈ s) {P : α → Prop}
    (hP : ∀ y ∈ s, (∀ z ∈ s, r z y → P z) → P y) : P x 
goal: P x

full_name: Set.WellFoundedOn.mono
code: protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t) :
    s.WellFoundedOn r 
goal: s.WellFoundedOn r

full_name: Set.WellFoundedOn.mono'
code: theorem mono' (h : ∀ (a) (_ : a ∈ s) (b) (_ : b ∈ s), r' a b → r a b) :
    s.WellFoundedOn r → s.WellFoundedOn r' 
goal: s.WellFoundedOn r → s.WellFoundedOn r'

full_name: Set.WellFoundedOn.subset
code: theorem subset (h : t.WellFoundedOn r) (hst : s ⊆ t) : s.WellFoundedOn r 
goal: s.WellFoundedOn r

full_name: Set.WellFoundedOn.acc_iff_wellFoundedOn
code: /-- `a` is accessible under the relation `r` iff `r` is well-founded on the downward transitive
closure of `a` under `r` (including `a` or not). -/
theorem acc_iff_wellFoundedOn {α} {r : α → α → Prop} {a : α} :
    TFAE [Acc r a,
      WellFoundedOn { b | ReflTransGen r b a } r,
      WellFoundedOn { b | TransGen r b a } r] 
goal: [Acc r a, {b | Relation.ReflTransGen r b a}.WellFoundedOn r, {b | Relation.TransGen r b a}.WellFoundedOn r].TFAE

full_name: Set.IsStrictOrder.subset
code: instance IsStrictOrder.subset : IsStrictOrder α fun a b : α => r a b ∧ a ∈ s ∧ b ∈ s 
goal: IsStrictOrder α fun a b => r a b ∧ a ∈ s ∧ b ∈ s

full_name: Set.wellFoundedOn_iff_no_descending_seq
code: theorem wellFoundedOn_iff_no_descending_seq :
    s.WellFoundedOn r ↔ ∀ f : ((· > ·) : ℕ → ℕ → Prop) ↪r r, ¬∀ n, f n ∈ s 
goal: s.WellFoundedOn r ↔ ∀ (f : (fun x x_1 => x > x_1) ↪r r), ¬∀ (n : ℕ), f n ∈ s

full_name: Set.WellFoundedOn.union
code: theorem WellFoundedOn.union (hs : s.WellFoundedOn r) (ht : t.WellFoundedOn r) :
    (s ∪ t).WellFoundedOn r 
goal: (s ∪ t).WellFoundedOn r

full_name: Set.wellFoundedOn_union
code: @[simp]
theorem wellFoundedOn_union : (s ∪ t).WellFoundedOn r ↔ s.WellFoundedOn r ∧ t.WellFoundedOn r 
goal: (s ∪ t).WellFoundedOn r ↔ s.WellFoundedOn r ∧ t.WellFoundedOn r

full_name: Set.IsWF
code: /-- `s.IsWF` indicates that `<` is well-founded when restricted to `s`. -/
def IsWF (s : Set α) : Prop 
goal: Prop

full_name: Set.isWF_empty
code: @[simp]
theorem isWF_empty : IsWF (∅ : Set α) 
goal: ∅.IsWF

full_name: Set.isWF_univ_iff
code: theorem isWF_univ_iff : IsWF (univ : Set α) ↔ WellFounded ((· < ·) : α → α → Prop) 
goal: Set.univ.IsWF ↔ WellFounded fun x x_1 => x < x_1

full_name: Set.IsWF.mono
code: theorem IsWF.mono (h : IsWF t) (st : s ⊆ t) : IsWF s 
goal: s.IsWF

full_name: Set.IsWF.union
code: protected nonrec theorem IsWF.union (hs : IsWF s) (ht : IsWF t) : IsWF (s ∪ t) 
goal: (s ∪ t).IsWF

full_name: Set.isWF_union
code: @[simp] theorem isWF_union : IsWF (s ∪ t) ↔ IsWF s ∧ IsWF t 
goal: (s ∪ t).IsWF ↔ s.IsWF ∧ t.IsWF

full_name: Set.isWF_iff_no_descending_seq
code: theorem isWF_iff_no_descending_seq :
    IsWF s ↔ ∀ f : ℕ → α, StrictAnti f → ¬∀ n, f (OrderDual.toDual n) ∈ s 
goal: s.IsWF ↔ ∀ (f : ℕ → α), StrictAnti f → ¬∀ (n : ℕ), f (OrderDual.toDual n) ∈ s

full_name: Set.PartiallyWellOrderedOn
code: /-- A subset is partially well-ordered by a relation `r` when any infinite sequence contains
  two elements where the first is related to the second by `r`. -/
def PartiallyWellOrderedOn (s : Set α) (r : α → α → Prop) : Prop 
goal: Prop

full_name: Set.PartiallyWellOrderedOn.mono
code: theorem PartiallyWellOrderedOn.mono (ht : t.PartiallyWellOrderedOn r) (h : s ⊆ t) :
    s.PartiallyWellOrderedOn r 
goal: s.PartiallyWellOrderedOn r

full_name: Set.partiallyWellOrderedOn_empty
code: @[simp]
theorem partiallyWellOrderedOn_empty (r : α → α → Prop) : PartiallyWellOrderedOn ∅ r 
goal: ∅.PartiallyWellOrderedOn r

full_name: Set.PartiallyWellOrderedOn.union
code: theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
    (ht : t.PartiallyWellOrderedOn r) : (s ∪ t).PartiallyWellOrderedOn r 
goal: (s ∪ t).PartiallyWellOrderedOn r

full_name: Set.partiallyWellOrderedOn_union
code: @[simp]
theorem partiallyWellOrderedOn_union :
    (s ∪ t).PartiallyWellOrderedOn r ↔ s.PartiallyWellOrderedOn r ∧ t.PartiallyWellOrderedOn r 
goal: (s ∪ t).PartiallyWellOrderedOn r ↔ s.PartiallyWellOrderedOn r ∧ t.PartiallyWellOrderedOn r

full_name: Set.PartiallyWellOrderedOn.image_of_monotone_on
code: theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrderedOn r)
    (hf : ∀ a₁ ∈ s, ∀ a₂ ∈ s, r a₁ a₂ → r' (f a₁) (f a₂)) : (f '' s).PartiallyWellOrderedOn r' 
goal: (f '' s).PartiallyWellOrderedOn r'

full_name: IsAntichain.finite_of_partiallyWellOrderedOn
code: theorem _root_.IsAntichain.finite_of_partiallyWellOrderedOn (ha : IsAntichain r s)
    (hp : s.PartiallyWellOrderedOn r) : s.Finite 
goal: s.Finite

full_name: Set.Finite.partiallyWellOrderedOn
code: protected theorem Finite.partiallyWellOrderedOn (hs : s.Finite) : s.PartiallyWellOrderedOn r 
goal: s.PartiallyWellOrderedOn r

full_name: IsAntichain.partiallyWellOrderedOn_iff
code: theorem _root_.IsAntichain.partiallyWellOrderedOn_iff (hs : IsAntichain r s) :
    s.PartiallyWellOrderedOn r ↔ s.Finite 
goal: s.PartiallyWellOrderedOn r ↔ s.Finite

full_name: Set.partiallyWellOrderedOn_singleton
code: @[simp]
theorem partiallyWellOrderedOn_singleton (a : α) : PartiallyWellOrderedOn {a} r 
goal: {a}.PartiallyWellOrderedOn r

full_name: Set.Subsingleton.partiallyWellOrderedOn
code: @[nontriviality]
theorem Subsingleton.partiallyWellOrderedOn (hs : s.Subsingleton) : PartiallyWellOrderedOn s r 
goal: s.PartiallyWellOrderedOn r

full_name: Set.partiallyWellOrderedOn_insert
code: @[simp]
theorem partiallyWellOrderedOn_insert :
    PartiallyWellOrderedOn (insert a s) r ↔ PartiallyWellOrderedOn s r 
goal: (insert a s).PartiallyWellOrderedOn r ↔ s.PartiallyWellOrderedOn r

full_name: Set.PartiallyWellOrderedOn.insert
code: protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r) (a : α) :
    PartiallyWellOrderedOn (insert a s) r 
goal: (insert a s).PartiallyWellOrderedOn r

full_name: Set.partiallyWellOrderedOn_iff_finite_antichains
code: theorem partiallyWellOrderedOn_iff_finite_antichains [IsSymm α r] :
    s.PartiallyWellOrderedOn r ↔ ∀ t, t ⊆ s → IsAntichain r t → t.Finite 
goal: s.PartiallyWellOrderedOn r ↔ ∀ t ⊆ s, IsAntichain r t → t.Finite

full_name: Set.PartiallyWellOrderedOn.exists_monotone_subseq
code: theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
    (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) 
goal: ∃ g, ∀ (m n : ℕ), m ≤ n → r (f (g m)) (f (g n))

full_name: Set.partiallyWellOrderedOn_iff_exists_monotone_subseq
code: theorem partiallyWellOrderedOn_iff_exists_monotone_subseq :
    s.PartiallyWellOrderedOn r ↔
      ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) 
goal: s.PartiallyWellOrderedOn r ↔ ∀ (f : ℕ → α), (∀ (n : ℕ), f n ∈ s) → ∃ g, ∀ (m n : ℕ), m ≤ n → r (f (g m)) (f (g n))

full_name: Set.PartiallyWellOrderedOn.prod
code: protected theorem PartiallyWellOrderedOn.prod {t : Set β} (hs : PartiallyWellOrderedOn s r)
    (ht : PartiallyWellOrderedOn t r') :
    PartiallyWellOrderedOn (s ×ˢ t) fun x y : α × β => r x.1 y.1 ∧ r' x.2 y.2 
goal: (s ×ˢ t).PartiallyWellOrderedOn fun x y => r x.1 y.1 ∧ r' x.2 y.2

full_name: Set.PartiallyWellOrderedOn.wellFoundedOn
code: theorem PartiallyWellOrderedOn.wellFoundedOn [IsPreorder α r] (h : s.PartiallyWellOrderedOn r) :
    s.WellFoundedOn fun a b => r a b ∧ ¬r b a 
goal: s.WellFoundedOn fun a b => r a b ∧ ¬r b a

full_name: Set.IsPWO
code: /-- A subset of a preorder is partially well-ordered when any infinite sequence contains
  a monotone subsequence of length 2 (or equivalently, an infinite monotone subsequence). -/
def IsPWO (s : Set α) : Prop 
goal: Prop

full_name: Set.IsPWO.mono
code: nonrec theorem IsPWO.mono (ht : t.IsPWO) : s ⊆ t → s.IsPWO 
goal: s ⊆ t → s.IsPWO

full_name: Set.IsPWO.exists_monotone_subseq
code: nonrec theorem IsPWO.exists_monotone_subseq (h : s.IsPWO) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
    ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) 
goal: ∃ g, Monotone (f ∘ ⇑g)

full_name: Set.isPWO_iff_exists_monotone_subseq
code: theorem isPWO_iff_exists_monotone_subseq :
    s.IsPWO ↔ ∀ f : ℕ → α, (∀ n, f n ∈ s) → ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g) 
goal: s.IsPWO ↔ ∀ (f : ℕ → α), (∀ (n : ℕ), f n ∈ s) → ∃ g, Monotone (f ∘ ⇑g)

full_name: Set.IsPWO.isWF
code: protected theorem IsPWO.isWF (h : s.IsPWO) : s.IsWF 
goal: s.IsWF

full_name: Set.IsPWO.prod
code: nonrec theorem IsPWO.prod {t : Set β} (hs : s.IsPWO) (ht : t.IsPWO) : IsPWO (s ×ˢ t) 
goal: (s ×ˢ t).IsPWO

full_name: Set.IsPWO.image_of_monotoneOn
code: theorem IsPWO.image_of_monotoneOn (hs : s.IsPWO) {f : α → β} (hf : MonotoneOn f s) :
    IsPWO (f '' s) 
goal: (f '' s).IsPWO

full_name: Set.IsPWO.image_of_monotone
code: theorem IsPWO.image_of_monotone (hs : s.IsPWO) {f : α → β} (hf : Monotone f) : IsPWO (f '' s) 
goal: (f '' s).IsPWO

full_name: Set.IsPWO.union
code: protected nonrec theorem IsPWO.union (hs : IsPWO s) (ht : IsPWO t) : IsPWO (s ∪ t) 
goal: (s ∪ t).IsPWO

full_name: Set.isPWO_union
code: @[simp]
theorem isPWO_union : IsPWO (s ∪ t) ↔ IsPWO s ∧ IsPWO t 
goal: (s ∪ t).IsPWO ↔ s.IsPWO ∧ t.IsPWO

full_name: Set.Finite.isPWO
code: protected theorem Finite.isPWO (hs : s.Finite) : IsPWO s 
goal: s.IsPWO

full_name: Set.isPWO_of_finite
code: @[simp] theorem isPWO_of_finite [Finite α] : s.IsPWO 
goal: s.IsPWO

full_name: Set.isPWO_singleton
code: @[simp] theorem isPWO_singleton (a : α) : IsPWO ({a} : Set α) 
goal: {a}.IsPWO

full_name: Set.isPWO_empty
code: @[simp] theorem isPWO_empty : IsPWO (∅ : Set α) 
goal: ∅.IsPWO

full_name: Set.Subsingleton.isPWO
code: protected theorem Subsingleton.isPWO (hs : s.Subsingleton) : IsPWO s 
goal: s.IsPWO

full_name: Set.isPWO_insert
code: @[simp]
theorem isPWO_insert {a} : IsPWO (insert a s) ↔ IsPWO s 
goal: (insert a s).IsPWO ↔ s.IsPWO

full_name: Set.IsPWO.insert
code: protected theorem IsPWO.insert (h : IsPWO s) (a : α) : IsPWO (insert a s) 
goal: (insert a s).IsPWO

full_name: Set.Finite.isWF
code: protected theorem Finite.isWF (hs : s.Finite) : IsWF s 
goal: s.IsWF

full_name: Set.isWF_singleton
code: @[simp] theorem isWF_singleton {a : α} : IsWF ({a} : Set α) 
goal: {a}.IsWF

full_name: Set.Subsingleton.isWF
code: protected theorem Subsingleton.isWF (hs : s.Subsingleton) : IsWF s 
goal: s.IsWF

full_name: Set.isWF_insert
code: @[simp]
theorem isWF_insert {a} : IsWF (insert a s) ↔ IsWF s 
goal: (insert a s).IsWF ↔ s.IsWF

full_name: Set.IsWF.insert
code: protected theorem IsWF.insert (h : IsWF s) (a : α) : IsWF (insert a s) 
goal: (insert a s).IsWF

full_name: Set.Finite.wellFoundedOn
code: protected theorem Finite.wellFoundedOn (hs : s.Finite) : s.WellFoundedOn r 
goal: s.WellFoundedOn r

full_name: Set.wellFoundedOn_singleton
code: @[simp]
theorem wellFoundedOn_singleton : WellFoundedOn ({a} : Set α) r 
goal: {a}.WellFoundedOn r

full_name: Set.Subsingleton.wellFoundedOn
code: protected theorem Subsingleton.wellFoundedOn (hs : s.Subsingleton) : s.WellFoundedOn r 
goal: s.WellFoundedOn r

full_name: Set.wellFoundedOn_insert
code: @[simp]
theorem wellFoundedOn_insert : WellFoundedOn (insert a s) r ↔ WellFoundedOn s r 
goal: (insert a s).WellFoundedOn r ↔ s.WellFoundedOn r

full_name: Set.WellFoundedOn.insert
code: protected theorem WellFoundedOn.insert (h : WellFoundedOn s r) (a : α) :
    WellFoundedOn (insert a s) r 
goal: (insert a s).WellFoundedOn r

full_name: Set.IsWF.isPWO
code: protected theorem IsWF.isPWO (hs : s.IsWF) : s.IsPWO 
goal: s.IsPWO

full_name: Set.isWF_iff_isPWO
code: /-- In a linear order, the predicates `Set.IsWF` and `Set.IsPWO` are equivalent. -/
theorem isWF_iff_isPWO : s.IsWF ↔ s.IsPWO 
goal: s.IsWF ↔ s.IsPWO

full_name: Finset.partiallyWellOrderedOn
code: @[simp]
protected theorem partiallyWellOrderedOn [IsRefl α r] (s : Finset α) :
    (s : Set α).PartiallyWellOrderedOn r 
goal: (↑s).PartiallyWellOrderedOn r

full_name: Finset.isPWO
code: @[simp]
protected theorem isPWO [Preorder α] (s : Finset α) : Set.IsPWO (↑s : Set α) 
goal: (↑s).IsPWO

full_name: Finset.isWF
code: @[simp]
protected theorem isWF [Preorder α] (s : Finset α) : Set.IsWF (↑s : Set α) 
goal: (↑s).IsWF

full_name: Finset.wellFoundedOn
code: @[simp]
protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
    Set.WellFoundedOn (↑s : Set α) r 
goal: (↑s).WellFoundedOn r

full_name: Finset.wellFoundedOn_sup
code: theorem wellFoundedOn_sup [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
    (s.sup f).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r 
goal: (s.sup f).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r

full_name: Finset.partiallyWellOrderedOn_sup
code: theorem partiallyWellOrderedOn_sup (s : Finset ι) {f : ι → Set α} :
    (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r 
goal: (s.sup f).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r

full_name: Finset.isWF_sup
code: theorem isWF_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (s.sup f).IsWF ↔ ∀ i ∈ s, (f i).IsWF 
goal: (s.sup f).IsWF ↔ ∀ i ∈ s, (f i).IsWF

full_name: Finset.isPWO_sup
code: theorem isPWO_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO 
goal: (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO

full_name: Finset.wellFoundedOn_bUnion
code: @[simp]
theorem wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} :
    (⋃ i ∈ s, f i).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r 
goal: (⋃ i ∈ s, f i).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r

full_name: Finset.partiallyWellOrderedOn_bUnion
code: @[simp]
theorem partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} :
    (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r 
goal: (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r

full_name: Finset.isWF_bUnion
code: @[simp]
theorem isWF_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF 
goal: (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF

full_name: Finset.isPWO_bUnion
code: @[simp]
theorem isPWO_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (⋃ i ∈ s, f i).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO 
goal: (⋃ i ∈ s, f i).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO

full_name: Set.IsWF.min
code: /-- `Set.IsWF.min` returns a minimal element of a nonempty well-founded set. -/
noncomputable nonrec def IsWF.min (hs : IsWF s) (hn : s.Nonempty) : α 
goal: α

full_name: Set.IsWF.min_mem
code: theorem IsWF.min_mem (hs : IsWF s) (hn : s.Nonempty) : hs.min hn ∈ s 
goal: hs.min hn ∈ s

full_name: Set.IsWF.not_lt_min
code: nonrec theorem IsWF.not_lt_min (hs : IsWF s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn 
goal: ¬a < hs.min hn

full_name: Set.IsWF.min_of_subset_not_lt_min
code: theorem IsWF.min_of_subset_not_lt_min {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF}
    {htn : t.Nonempty} (hst : s ⊆ t) : ¬hs.min hsn < ht.min htn 
goal: ¬hs.min hsn < ht.min htn

full_name: Set.isWF_min_singleton
code: @[simp]
theorem isWF_min_singleton (a) {hs : IsWF ({a} : Set α)} {hn : ({a} : Set α).Nonempty} :
    hs.min hn = a 
goal: hs.min hn = a

full_name: Set.IsWF.min_le
code: theorem IsWF.min_le (hs : s.IsWF) (hn : s.Nonempty) (ha : a ∈ s) : hs.min hn ≤ a 
goal: hs.min hn ≤ a

full_name: Set.IsWF.le_min_iff
code: theorem IsWF.le_min_iff (hs : s.IsWF) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b 
goal: a ≤ hs.min hn ↔ ∀ b ∈ s, a ≤ b

full_name: Set.IsWF.min_le_min_of_subset
code: theorem IsWF.min_le_min_of_subset {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF} {htn : t.Nonempty}
    (hst : s ⊆ t) : ht.min htn ≤ hs.min hsn 
goal: ht.min htn ≤ hs.min hsn

full_name: Set.IsWF.min_union
code: theorem IsWF.min_union (hs : s.IsWF) (hsn : s.Nonempty) (ht : t.IsWF) (htn : t.Nonempty) :
    (hs.union ht).min (union_nonempty.2 (Or.intro_left _ hsn)) =
      Min.min (hs.min hsn) (ht.min htn) 
goal: ⋯.min ⋯ = min (hs.min hsn) (ht.min htn)

full_name: BddBelow.wellFoundedOn_lt
code: theorem BddBelow.wellFoundedOn_lt : BddBelow s → s.WellFoundedOn (· < ·) 
goal: BddBelow s → s.WellFoundedOn fun x x_1 => x < x_1

full_name: BddAbove.wellFoundedOn_gt
code: theorem BddAbove.wellFoundedOn_gt : BddAbove s → s.WellFoundedOn (· > ·) 
goal: BddAbove s → s.WellFoundedOn fun x x_1 => x > x_1

full_name: Set.PartiallyWellOrderedOn.IsBadSeq
code: /-- In the context of partial well-orderings, a bad sequence is a nonincreasing sequence
  whose range is contained in a particular set `s`. One exists if and only if `s` is not
  partially well-ordered. -/
def IsBadSeq (r : α → α → Prop) (s : Set α) (f : ℕ → α) : Prop 
goal: Prop

full_name: Set.PartiallyWellOrderedOn.iff_forall_not_isBadSeq
code: theorem iff_forall_not_isBadSeq (r : α → α → Prop) (s : Set α) :
    s.PartiallyWellOrderedOn r ↔ ∀ f, ¬IsBadSeq r s f 
goal: s.PartiallyWellOrderedOn r ↔ ∀ (f : ℕ → α), ¬Set.PartiallyWellOrderedOn.IsBadSeq r s f

full_name: Set.PartiallyWellOrderedOn.IsMinBadSeq
code: /-- This indicates that every bad sequence `g` that agrees with `f` on the first `n`
  terms has `rk (f n) ≤ rk (g n)`. -/
def IsMinBadSeq (r : α → α → Prop) (rk : α → ℕ) (s : Set α) (n : ℕ) (f : ℕ → α) : Prop 
goal: Prop

full_name: Set.PartiallyWellOrderedOn.minBadSeqOfBadSeq
code: /-- Given a bad sequence `f`, this constructs a bad sequence that agrees with `f` on the first `n`
  terms and is minimal at `n`.
-/
noncomputable def minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (s : Set α) (n : ℕ) (f : ℕ → α)
    (hf : IsBadSeq r s f) :
    { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } 
goal: { g //
  (∀ m < n, f m = g m) ∧ Set.PartiallyWellOrderedOn.IsBadSeq r s g ∧ Set.PartiallyWellOrderedOn.IsMinBadSeq r rk s n g }

full_name: Set.PartiallyWellOrderedOn.exists_min_bad_of_exists_bad
code: theorem exists_min_bad_of_exists_bad (r : α → α → Prop) (rk : α → ℕ) (s : Set α) :
    (∃ f, IsBadSeq r s f) → ∃ f, IsBadSeq r s f ∧ ∀ n, IsMinBadSeq r rk s n f 
goal: (∃ f, Set.PartiallyWellOrderedOn.IsBadSeq r s f) →
  ∃ f, Set.PartiallyWellOrderedOn.IsBadSeq r s f ∧ ∀ (n : ℕ), Set.PartiallyWellOrderedOn.IsMinBadSeq r rk s n f

full_name: Set.PartiallyWellOrderedOn.iff_not_exists_isMinBadSeq
code: theorem iff_not_exists_isMinBadSeq (rk : α → ℕ) {s : Set α} :
    s.PartiallyWellOrderedOn r ↔ ¬∃ f, IsBadSeq r s f ∧ ∀ n, IsMinBadSeq r rk s n f 
goal: s.PartiallyWellOrderedOn r ↔
  ¬∃ f, Set.PartiallyWellOrderedOn.IsBadSeq r s f ∧ ∀ (n : ℕ), Set.PartiallyWellOrderedOn.IsMinBadSeq r rk s n f

full_name: Set.PartiallyWellOrderedOn.partiallyWellOrderedOn_sublistForall₂
code: /-- Higman's Lemma, which states that for any reflexive, transitive relation `r` which is
  partially well-ordered on a set `s`, the relation `List.SublistForall₂ r` is partially
  well-ordered on the set of lists of elements of `s`. That relation is defined so that
  `List.SublistForall₂ r l₁ l₂` whenever `l₁` related pointwise by `r` to a sublist of `l₂`.  -/
theorem partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsRefl α r] [IsTrans α r]
    {s : Set α} (h : s.PartiallyWellOrderedOn r) :
    { l : List α | ∀ x, x ∈ l → x ∈ s }.PartiallyWellOrderedOn (List.SublistForall₂ r) 
goal: {l | ∀ x ∈ l, x ∈ s}.PartiallyWellOrderedOn (List.SublistForall₂ r)

full_name: Set.PartiallyWellOrderedOn.subsetProdLex
code: theorem subsetProdLex [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)}
    (hα : ((fun (x : α ×ₗ β) => (ofLex x).1)'' s).IsPWO)
    (hβ : ∀ a, {y | toLex (a, y) ∈ s}.IsPWO) : s.IsPWO 
goal: s.IsPWO

full_name: Set.PartiallyWellOrderedOn.imageProdLex
code: theorem imageProdLex [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)}
    (hαβ : s.IsPWO) : ((fun (x : α ×ₗ β) => (ofLex x).1)'' s).IsPWO 
goal: ((fun x => (ofLex x).1) '' s).IsPWO

full_name: Set.PartiallyWellOrderedOn.fiberProdLex
code: theorem fiberProdLex [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)}
    (hαβ : s.IsPWO) (a : α) : {y | toLex (a, y) ∈ s}.IsPWO 
goal: {y | toLex (a, y) ∈ s}.IsPWO

full_name: Set.PartiallyWellOrderedOn.ProdLex_iff
code: theorem ProdLex_iff [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)} :
    s.IsPWO ↔
      ((fun (x : α ×ₗ β) ↦ (ofLex x).1) '' s).IsPWO ∧ ∀ a, {y | toLex (a, y) ∈ s}.IsPWO 
goal: s.IsPWO ↔ ((fun x => (ofLex x).1) '' s).IsPWO ∧ ∀ (a : α), {y | toLex (a, y) ∈ s}.IsPWO

full_name: WellFounded.isWF
code: theorem WellFounded.isWF [LT α] (h : WellFounded ((· < ·) : α → α → Prop)) (s : Set α) : s.IsWF 
goal: s.IsWF

full_name: Pi.isPWO
code: /-- A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well
ordered, when `σ` is a `Fintype` and each `α s` is a linear well order.
This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order.
Some generalizations would be possible based on this proof, to include cases where the target is
partially well ordered, and also to consider the case of `Set.PartiallyWellOrderedOn` instead of
`Set.IsPWO`. -/
theorem Pi.isPWO {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)]
    [Finite ι] (s : Set (∀ i, α i)) : s.IsPWO 
goal: s.IsPWO

full_name: WellFounded.prod_lex_of_wellFoundedOn_fiber
code: /-- Stronger version of `WellFounded.prod_lex`. Instead of requiring `rβ on g` to be well-founded,
we only require it to be well-founded on fibers of `f`. -/
theorem WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f))
    (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
    WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) 
goal: WellFounded (Prod.Lex rα rβ on fun c => (f c, g c))

full_name: Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
code: theorem Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn (rα on f))
    (hβ : ∀ a, (s ∩ f ⁻¹' {a}).WellFoundedOn (rβ on g)) :
    s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) 
goal: s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c))

full_name: WellFounded.sigma_lex_of_wellFoundedOn_fiber
code: /-- Stronger version of `PSigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
require it to be well-founded on fibers of `f`. -/
theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
    (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
    WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) 
goal: WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩)

full_name: Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
code: theorem Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f))
    (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
    s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) 
goal: s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩)