l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeSup β
inst✝ : SupHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ f (sup' s hs g) = sup' s hs (⇑f ∘ g)

Next tactic:
refine' hs.cons_induction _ _
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeSup β
inst✝ : SupHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ ∀ (a : ι), f (sup' {a} (_ : Finset.Nonempty {a}) g) = sup' {a} (_ : Finset.Nonempty {a}) (⇑f ∘ g)

Next tactic:
intros
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeSup β
inst✝ : SupHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ ∀ ⦃a : ι⦄ (s : Finset ι) (h : a ∉ s) (hs : Finset.Nonempty s),
    f (sup' s hs g) = sup' s hs (⇑f ∘ g) →
      f (sup' (cons a s h) (_ : Finset.Nonempty (cons a s h)) g) =
        sup' (cons a s h) (_ : Finset.Nonempty (cons a s h)) (⇑f ∘ g)

Next tactic:
intros
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> intros <;> 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeSup β
inst✝ : SupHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
a✝ : ι
⊢ f (sup' {a✝} (_ : Finset.Nonempty {a✝}) g) = sup' {a✝} (_ : Finset.Nonempty {a✝}) (⇑f ∘ g)

Next tactic:
simp [*]
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> intros <;> 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeSup α
s✝¹ : Finset β
H : Finset.Nonempty s✝¹
f✝ : β → α
inst✝¹ : SemilatticeSup β
inst✝ : SupHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
a✝¹ : ι
s✝ : Finset ι
h✝ : a✝¹ ∉ s✝
hs✝ : Finset.Nonempty s✝
a✝ : f (sup' s✝ hs✝ g) = sup' s✝ hs✝ (⇑f ∘ g)
⊢ f (sup' (cons a✝¹ s✝ h✝) (_ : Finset.Nonempty (cons a✝¹ s✝ h✝)) g) =
    sup' (cons a✝¹ s✝ h✝) (_ : Finset.Nonempty (cons a✝¹ s✝ h✝)) (⇑f ∘ g)

Next tactic:
simp [*]
@[simp]
theorem sup'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) (hs' : s.Nonempty := (Nonempty.image_iff _).1 hs) :
    (s.image f).sup' hs g = s.sup' hs' (g ∘ f) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝ : DecidableEq β
s : Finset γ
f : γ → β
hs : Finset.Nonempty (image f s)
g : β → α
hs' : optParam (Finset.Nonempty s) (_ : Finset.Nonempty s)
⊢ sup' (image f s) hs g = sup' s hs' (g ∘ f)

Next tactic:
rw [← WithBot.coe_eq_coe]
@[simp]
theorem sup'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) (hs' : s.Nonempty := (Nonempty.image_iff _).1 hs) :
    (s.image f).sup' hs g = s.sup' hs' (g ∘ f) := by
  rw [← WithBot.coe_eq_coe]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝ : DecidableEq β
s : Finset γ
f : γ → β
hs : Finset.Nonempty (image f s)
g : β → α
hs' : optParam (Finset.Nonempty s) (_ : Finset.Nonempty s)
⊢ ↑(sup' (image f s) hs g) = ↑(sup' s hs' (g ∘ f))

Next tactic:
simp only [coe_sup', sup_image, WithBot.coe_sup]
@[simp]
theorem sup'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) (hs' : s.Nonempty := (Nonempty.image_iff _).1 hs) :
    (s.image f).sup' hs g = s.sup' hs' (g ∘ f) := by
  rw [← WithBot.coe_eq_coe]; simp only [coe_sup', sup_image, WithBot.coe_sup]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝ : DecidableEq β
s : Finset γ
f : γ → β
hs : Finset.Nonempty (image f s)
g : β → α
hs' : optParam (Finset.Nonempty s) (_ : Finset.Nonempty s)
⊢ sup s ((WithBot.some ∘ g) ∘ f) = sup s (WithBot.some ∘ g ∘ f)

Next tactic:
rfl
@[simp]
theorem sup'_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty)
    (hs' : s.Nonempty := Finset.map_nonempty.mp hs) : (s.map f).sup' hs g = s.sup' hs' (g ∘ f) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
s : Finset γ
f : γ ↪ β
g : β → α
hs : Finset.Nonempty (map f s)
hs' : optParam (Finset.Nonempty s) (_ : Finset.Nonempty s)
⊢ sup' (map f s) hs g = sup' s hs' (g ∘ ⇑f)

Next tactic:
rw [← WithBot.coe_eq_coe, coe_sup', sup_map, coe_sup']
@[simp]
theorem sup'_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty)
    (hs' : s.Nonempty := Finset.map_nonempty.mp hs) : (s.map f).sup' hs g = s.sup' hs' (g ∘ f) := by
  rw [← WithBot.coe_eq_coe, coe_sup', sup_map, coe_sup']
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : SemilatticeSup α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
s : Finset γ
f : γ ↪ β
g : β → α
hs : Finset.Nonempty (map f s)
hs' : optParam (Finset.Nonempty s) (_ : Finset.Nonempty s)
⊢ sup s ((WithBot.some ∘ g) ∘ ⇑f) = sup s (WithBot.some ∘ g ∘ ⇑f)

Next tactic:
rfl
/-- Given nonempty finset `s` then `s.inf' H f` is the infimum of its image under `f` in (possibly
unbounded) meet-semilattice `α`, where `H` is a proof of nonemptiness. If `α` has a top element you
may instead use `Finset.inf` which does not require `s` nonempty. -/
def inf' (s : Finset β) (H : s.Nonempty) (f : β → α) : α :=
  WithTop.untop (s.inf ((↑) ∘ f)) (by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : SemilatticeInf α
s : Finset β
H : Finset.Nonempty s
f : β → α
⊢ inf s (WithTop.some ∘ f) ≠ ⊤

Next tactic:
simpa using H
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeInf α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeInf β
inst✝ : InfHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ f (inf' s hs g) = inf' s hs (⇑f ∘ g)

Next tactic:
refine' hs.cons_induction _ _
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeInf α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeInf β
inst✝ : InfHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ ∀ (a : ι), f (inf' {a} (_ : Finset.Nonempty {a}) g) = inf' {a} (_ : Finset.Nonempty {a}) (⇑f ∘ g)

Next tactic:
intros
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeInf α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeInf β
inst✝ : InfHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
⊢ ∀ ⦃a : ι⦄ (s : Finset ι) (h : a ∉ s) (hs : Finset.Nonempty s),
    f (inf' s hs g) = inf' s hs (⇑f ∘ g) →
      f (inf' (cons a s h) (_ : Finset.Nonempty (cons a s h)) g) =
        inf' (cons a s h) (_ : Finset.Nonempty (cons a s h)) (⇑f ∘ g)

Next tactic:
intros
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> intros <;> 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeInf α
s✝ : Finset β
H : Finset.Nonempty s✝
f✝ : β → α
inst✝¹ : SemilatticeInf β
inst✝ : InfHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
a✝ : ι
⊢ f (inf' {a✝} (_ : Finset.Nonempty {a✝}) g) = inf' {a✝} (_ : Finset.Nonempty {a✝}) (⇑f ∘ g)

Next tactic:
simp [*]
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs)
    (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  refine' hs.cons_induction _ _ <;> intros <;> 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝² : SemilatticeInf α
s✝¹ : Finset β
H : Finset.Nonempty s✝¹
f✝ : β → α
inst✝¹ : SemilatticeInf β
inst✝ : InfHomClass F α β
f : F
s : Finset ι
hs : Finset.Nonempty s
g : ι → α
a✝¹ : ι
s✝ : Finset ι
h✝ : a✝¹ ∉ s✝
hs✝ : Finset.Nonempty s✝
a✝ : f (inf' s✝ hs✝ g) = inf' s✝ hs✝ (⇑f ∘ g)
⊢ f (inf' (cons a✝¹ s✝ h✝) (_ : Finset.Nonempty (cons a✝¹ s✝ h✝)) g) =
    inf' (cons a✝¹ s✝ h✝) (_ : Finset.Nonempty (cons a✝¹ s✝ h✝)) (⇑f ∘ g)

Next tactic:
simp [*]
theorem coe_sup_of_nonempty {s : Finset β} (h : s.Nonempty) (f : β → α) :
    (↑(s.sup f) : WithBot α) = s.sup ((↑) ∘ f) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : SemilatticeSup α
inst✝ : OrderBot α
s : Finset β
h : Finset.Nonempty s
f : β → α
⊢ ↑(sup s f) = sup s (WithBot.some ∘ f)

Next tactic:
simp only [← sup'_eq_sup h, coe_sup' h]
theorem sup'_inf_distrib_left (f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs λ i => a ⊓ f i := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s : Finset ι
t : Finset κ
hs : Finset.Nonempty s
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
⊢ a ⊓ sup' s hs f = sup' s hs fun i => a ⊓ f i

Next tactic:
refine' hs.cons_induction (fun i => _) fun i s hi hs ih => _
theorem sup'_inf_distrib_left (f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs λ i => a ⊓ f i := by
  refine' hs.cons_induction (fun i => _) fun i s hi hs ih => _
  · 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s : Finset ι
t : Finset κ
hs : Finset.Nonempty s
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
i : ι
⊢ a ⊓ sup' {i} (_ : Finset.Nonempty {i}) f = sup' {i} (_ : Finset.Nonempty {i}) fun i => a ⊓ f i

Next tactic:
simp
theorem sup'_inf_distrib_left (f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs λ i => a ⊓ f i := by
  refine' hs.cons_induction (fun i => _) fun i s hi hs ih => _
  · simp
  · 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s✝ : Finset ι
t : Finset κ
hs✝ : Finset.Nonempty s✝
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
i : ι
s : Finset ι
hi : i ∉ s
hs : Finset.Nonempty s
ih : a ⊓ sup' s hs f = sup' s hs fun i => a ⊓ f i
⊢ a ⊓ sup' (cons i s hi) (_ : Finset.Nonempty (cons i s hi)) f =
    sup' (cons i s hi) (_ : Finset.Nonempty (cons i s hi)) fun i => a ⊓ f i

Next tactic:
simp_rw [sup'_cons hs, inf_sup_left]
theorem sup'_inf_distrib_left (f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs λ i => a ⊓ f i := by
  refine' hs.cons_induction (fun i => _) fun i s hi hs ih => _
  · simp
  · simp_rw [sup'_cons hs, inf_sup_left]
    

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s✝ : Finset ι
t : Finset κ
hs✝ : Finset.Nonempty s✝
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
i : ι
s : Finset ι
hi : i ∉ s
hs : Finset.Nonempty s
ih : a ⊓ sup' s hs f = sup' s hs fun i => a ⊓ f i
⊢ a ⊓ f i ⊔ a ⊓ sup' s hs f = a ⊓ f i ⊔ sup' s hs fun i => a ⊓ f i

Next tactic:
rw [ih]
theorem sup'_inf_distrib_right (f : ι → α) (a : α) : s.sup' hs f ⊓ a = s.sup' hs fun i => f i ⊓ a :=
  by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s : Finset ι
t : Finset κ
hs : Finset.Nonempty s
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
⊢ sup' s hs f ⊓ a = sup' s hs fun i => f i ⊓ a

Next tactic:
rw [inf_comm, sup'_inf_distrib_left]
theorem sup'_inf_distrib_right (f : ι → α) (a : α) : s.sup' hs f ⊓ a = s.sup' hs fun i => f i ⊓ a :=
  by rw [inf_comm, sup'_inf_distrib_left]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s : Finset ι
t : Finset κ
hs : Finset.Nonempty s
ht : Finset.Nonempty t
f✝ : ι → α
g : κ → α
a✝ : α
f : ι → α
a : α
⊢ (sup' s hs fun i => a ⊓ f i) = sup' s hs fun i => f i ⊓ a

Next tactic:
simp_rw [inf_comm]
theorem sup'_inf_sup' (f : ι → α) (g : κ → α) :
    s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' (hs.product ht) fun i => f i.1 ⊓ g i.2 := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DistribLattice α
s : Finset ι
t : Finset κ
hs : Finset.Nonempty s
ht : Finset.Nonempty t
f✝ : ι → α
g✝ : κ → α
a : α
f : ι → α
g : κ → α
⊢ sup' s hs f ⊓ sup' t ht g = sup' (s ×ˢ t) (_ : Finset.Nonempty (s ×ˢ t)) fun i => f i.1 ⊓ g i.2

Next tactic:
simp_rw [Finset.sup'_inf_distrib_right, Finset.sup'_inf_distrib_left, sup'_product_left hs ht]
@[simp]
theorem le_sup'_iff : a ≤ s.sup' H f ↔ ∃ b ∈ s, a ≤ f b := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ a ≤ sup' s H f ↔ ∃ b ∈ s, a ≤ f b

Next tactic:
rw [← WithBot.coe_le_coe, coe_sup', Finset.le_sup_iff (WithBot.bot_lt_coe a)]
@[simp]
theorem le_sup'_iff : a ≤ s.sup' H f ↔ ∃ b ∈ s, a ≤ f b := by
  rw [← WithBot.coe_le_coe, coe_sup', Finset.le_sup_iff (WithBot.bot_lt_coe a)]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ (∃ b ∈ s, ↑a ≤ (WithBot.some ∘ f) b) ↔ ∃ b ∈ s, a ≤ f b

Next tactic:
exact exists_congr (fun _ => and_congr_right' WithBot.coe_le_coe)
@[simp]
theorem lt_sup'_iff : a < s.sup' H f ↔ ∃ b ∈ s, a < f b := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ a < sup' s H f ↔ ∃ b ∈ s, a < f b

Next tactic:
rw [← WithBot.coe_lt_coe, coe_sup', Finset.lt_sup_iff]
@[simp]
theorem lt_sup'_iff : a < s.sup' H f ↔ ∃ b ∈ s, a < f b := by
  rw [← WithBot.coe_lt_coe, coe_sup', Finset.lt_sup_iff]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ (∃ b ∈ s, ↑a < (WithBot.some ∘ f) b) ↔ ∃ b ∈ s, a < f b

Next tactic:
exact exists_congr (fun _ => and_congr_right' WithBot.coe_lt_coe)
@[simp]
theorem sup'_lt_iff : s.sup' H f < a ↔ ∀ i ∈ s, f i < a := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ sup' s H f < a ↔ ∀ i ∈ s, f i < a

Next tactic:
rw [← WithBot.coe_lt_coe, coe_sup', Finset.sup_lt_iff (WithBot.bot_lt_coe a)]
@[simp]
theorem sup'_lt_iff : s.sup' H f < a ↔ ∀ i ∈ s, f i < a := by
  rw [← WithBot.coe_lt_coe, coe_sup', Finset.sup_lt_iff (WithBot.bot_lt_coe a)]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f : ι → α
a : α
⊢ (∀ b ∈ s, (WithBot.some ∘ f) b < ↑a) ↔ ∀ i ∈ s, f i < a

Next tactic:
exact ball_congr (fun _ _ => WithBot.coe_lt_coe)
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f✝ : ι → α
a : α
f : ι → α
⊢ ∃ i ∈ s, sup' s H f = f i

Next tactic:
refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · 

Proof state:
case refine'_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset ι
H : Finset.Nonempty s
f✝ : ι → α
a : α
f : ι → α
c : ι
⊢ ∃ i ∈ {c}, sup' {c} (_ : Finset.Nonempty {c}) f = f i

Next tactic:
exact ⟨c, mem_singleton_self c, rfl⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · 

Proof state:
case refine'_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
ih : ∃ i ∈ s, sup' s hs f = f i
⊢ ∃ i ∈ cons c s hc, sup' (cons c s hc) (_ : Finset.Nonempty (cons c s hc)) f = f i

Next tactic:
rcases ih with ⟨b, hb, h'⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    

Proof state:
case refine'_2.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
⊢ ∃ i ∈ cons c s hc, sup' (cons c s hc) (_ : Finset.Nonempty (cons c s hc)) f = f i

Next tactic:
rw [sup'_cons hs, h']
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    

Proof state:
case refine'_2.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
cases le_total (f b) (f c) with
    | inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
    | inr h => exact ⟨b, mem_cons.2 (Or.inr hb), sup_eq_right.2 h⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    

Proof state:
case refine'_2.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
x✝ : f b ≤ f c ∨ f c ≤ f b
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
cases le_total (f b) (f c) with
    | inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
    | inr h => exact ⟨b, mem_cons.2 (Or.inr hb), sup_eq_right.2 h⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    cases le_total (f b) (f c) with
    

Proof state:
case refine'_2.intro.intro.inl
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
h : f b ≤ f c
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
| inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    cases le_total (f b) (f c) with
    | inl h => 

Proof state:
case refine'_2.intro.intro.inl
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
h : f b ≤ f c
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    cases le_total (f b) (f c) with
    | inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
    

Proof state:
case refine'_2.intro.intro.inr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
h : f c ≤ f b
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
| inr h => exact ⟨b, mem_cons.2 (Or.inr hb), sup_eq_right.2 h⟩
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  refine' H.cons_induction (fun c => _) fun c s hc hs ih => _
  · exact ⟨c, mem_singleton_self c, rfl⟩
  · rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    cases le_total (f b) (f c) with
    | inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
    | inr h => 

Proof state:
case refine'_2.intro.intro.inr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s✝ : Finset ι
H : Finset.Nonempty s✝
f✝ : ι → α
a : α
f : ι → α
c : ι
s : Finset ι
hc : c ∉ s
hs : Finset.Nonempty s
b : ι
hb : b ∈ s
h' : sup' s hs f = f b
h : f c ≤ f b
⊢ ∃ i ∈ cons c s hc, f c ⊔ f b = f i

Next tactic:
exact ⟨b, mem_cons.2 (Or.inr hb), sup_eq_right.2 h⟩
@[simp]
theorem max_singleton {a : α} : Finset.max {a} = (a : WithBot α) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
a : α
⊢ Finset.max {a} = ↑a

Next tactic:
rw [← insert_emptyc_eq]
@[simp]
theorem max_singleton {a : α} : Finset.max {a} = (a : WithBot α) := by
  rw [← insert_emptyc_eq]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
a : α
⊢ Finset.max (insert a ∅) = ↑a

Next tactic:
exact max_insert
theorem max_of_mem {s : Finset α} {a : α} (h : a ∈ s) : ∃ b : α, s.max = b := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
s : Finset α
a : α
h : a ∈ s
⊢ ∃ b, Finset.max s = ↑b

Next tactic:
obtain ⟨b, h, _⟩ := le_sup (α := WithBot α) h _ rfl