l3lab/ntp-mathlib huggingface dataset:
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) 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 α
i : α
s : Finset α
hs : Finset.Nonempty s
⊢ IsGLB (↑s) i ↔ IsLeast (↑s) i

Next tactic:
refine' ⟨fun his => _, IsLeast.isGLB⟩
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i := by
  refine' ⟨fun his => _, IsLeast.isGLB⟩
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
hs : Finset.Nonempty s
his : IsGLB (↑s) i
⊢ IsLeast (↑s) i

Next tactic:
suffices i = min' s hs by
    rw [this]
    exact isLeast_min' s hs
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i := by
  refine' ⟨fun his => _, IsLeast.isGLB⟩
  suffices i = min' s hs by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
hs : Finset.Nonempty s
his : IsGLB (↑s) i
this : i = min' s hs
⊢ IsLeast (↑s) i

Next tactic:
rw [this]
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i := by
  refine' ⟨fun his => _, IsLeast.isGLB⟩
  suffices i = min' s hs by
    rw [this]
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
hs : Finset.Nonempty s
his : IsGLB (↑s) i
this : i = min' s hs
⊢ IsLeast (↑s) (min' s hs)

Next tactic:
exact isLeast_min' s hs
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i := by
  refine' ⟨fun his => _, IsLeast.isGLB⟩
  suffices i = min' s hs by
    rw [this]
    exact isLeast_min' s hs
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
hs : Finset.Nonempty s
his : IsGLB (↑s) i
⊢ i = min' s hs

Next tactic:
rw [IsGLB, IsGreatest, mem_lowerBounds, mem_upperBounds] at his
theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i := by
  refine' ⟨fun his => _, IsLeast.isGLB⟩
  suffices i = min' s hs by
    rw [this]
    exact isLeast_min' s hs
  rw [IsGLB, IsGreatest, mem_lowerBounds, mem_upperBounds] at his
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
hs : Finset.Nonempty s
his : (∀ x ∈ ↑s, i ≤ x) ∧ ∀ x ∈ lowerBounds ↑s, x ≤ i
⊢ i = min' s hs

Next tactic:
exact le_antisymm (his.1 (Finset.min' s hs) (Finset.min'_mem s hs)) (his.2 _ (Finset.min'_le s))
theorem isGLB_mem [LinearOrder α] {i : α} (s : Finset α) (his : IsGLB (s : Set α) i)
    (hs : s.Nonempty) : i ∈ s := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
his : IsGLB (↑s) i
hs : Finset.Nonempty s
⊢ i ∈ s

Next tactic:
rw [← mem_coe]
theorem isGLB_mem [LinearOrder α] {i : α} (s : Finset α) (his : IsGLB (s : Set α) i)
    (hs : s.Nonempty) : i ∈ s := by
  rw [← mem_coe]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : LinearOrder α
i : α
s : Finset α
his : IsGLB (↑s) i
hs : Finset.Nonempty s
⊢ i ∈ ↑s

Next tactic:
exact ((isGLB_iff_isLeast i s hs).mp his).1
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DecidableEq β
s : Finset α
f : α → Multiset β
b : β
⊢ count b (Finset.sup s f) = Finset.sup s fun a => count b (f a)

Next tactic:
letI := Classical.decEq α
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DecidableEq β
s : Finset α
f : α → Multiset β
b : β
this : DecidableEq α := Classical.decEq α
⊢ count b (Finset.sup s f) = Finset.sup s fun a => count b (f a)

Next tactic:
refine' s.induction _ _
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  refine' s.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✝ : DecidableEq β
s : Finset α
f : α → Multiset β
b : β
this : DecidableEq α := Classical.decEq α
⊢ count b (Finset.sup ∅ f) = Finset.sup ∅ fun a => count b (f a)

Next tactic:
exact count_zero _
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  refine' s.induction _ _
  · exact count_zero _
  · 

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✝ : DecidableEq β
s : Finset α
f : α → Multiset β
b : β
this : DecidableEq α := Classical.decEq α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s →
      (count b (Finset.sup s f) = Finset.sup s fun a => count b (f a)) →
        count b (Finset.sup (insert a s) f) = Finset.sup (insert a s) fun a => count b (f a)

Next tactic:
intro i s _ ih
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  refine' s.induction _ _
  · exact count_zero _
  · intro i s _ ih
    

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✝ : DecidableEq β
s✝ : Finset α
f : α → Multiset β
b : β
this : DecidableEq α := Classical.decEq α
i : α
s : Finset α
a✝ : i ∉ s
ih : count b (Finset.sup s f) = Finset.sup s fun a => count b (f a)
⊢ count b (Finset.sup (insert i s) f) = Finset.sup (insert i s) fun a => count b (f a)

Next tactic:
rw [Finset.sup_insert, sup_eq_union, count_union, Finset.sup_insert, ih]
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  refine' s.induction _ _
  · exact count_zero _
  · intro i s _ ih
    rw [Finset.sup_insert, sup_eq_union, count_union, Finset.sup_insert, ih]
    

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✝ : DecidableEq β
s✝ : Finset α
f : α → Multiset β
b : β
this : DecidableEq α := Classical.decEq α
i : α
s : Finset α
a✝ : i ∉ s
ih : count b (Finset.sup s f) = Finset.sup s fun a => count b (f a)
⊢ max (count b (f i)) (Finset.sup s fun a => count b (f a)) = count b (f i) ⊔ Finset.sup s fun a => count b (f a)

Next tactic:
rfl
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
f : α → Multiset β
x : β
⊢ x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v

Next tactic:
classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · rintro ⟨v, hv, hfv⟩
        rw [Finset.mem_insert] at hv
        rcases hv with (rfl | hv)
        · exact Or.inl hfv
        · refine' Or.inr (hxs.mpr ⟨v, hv, hfv⟩)
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
f : α → Multiset β
x : β
⊢ x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v

Next tactic:
induction' s using Finset.induction_on with a s has hxs
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · 

Proof state:
case empty
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
⊢ x ∈ Finset.sup ∅ f ↔ ∃ v ∈ ∅, x ∈ f v

Next tactic:
simp
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · 

Proof state:
case insert
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
⊢ x ∈ Finset.sup (insert a s) f ↔ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      

Proof state:
case insert
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
⊢ x ∈ f a ∨ x ∈ Finset.sup s f ↔ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
constructor
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · 

Proof state:
case insert.mp
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
⊢ x ∈ f a ∨ x ∈ Finset.sup s f → ∃ v ∈ insert a s, x ∈ f v

Next tactic:
intro hxi
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        

Proof state:
case insert.mp
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hxi : x ∈ f a ∨ x ∈ Finset.sup s f
⊢ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
cases' hxi with hf hf
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · 

Proof state:
case insert.mp.inl
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hf : x ∈ f a
⊢ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
refine' ⟨a, _, hf⟩
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          

Proof state:
case insert.mp.inl
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hf : x ∈ f a
⊢ a ∈ insert a s

Next tactic:
simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · 

Proof state:
case insert.mp.inr
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hf : x ∈ Finset.sup s f
⊢ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
rcases hxs.mp hf with ⟨v, hv, hfv⟩
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          

Proof state:
case insert.mp.inr.intro.intro
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hf : x ∈ Finset.sup s f
v : α
hv : v ∈ s
hfv : x ∈ f v
⊢ ∃ v ∈ insert a s, x ∈ f v

Next tactic:
refine' ⟨v, _, hfv⟩
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          

Proof state:
case insert.mp.inr.intro.intro
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
hf : x ∈ Finset.sup s f
v : α
hv : v ∈ s
hfv : x ∈ f v
⊢ v ∈ insert a s

Next tactic:
simp only [hv, or_true_iff, Finset.mem_insert]
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · 

Proof state:
case insert.mpr
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
⊢ (∃ v ∈ insert a s, x ∈ f v) → x ∈ f a ∨ x ∈ Finset.sup s f

Next tactic:
rintro ⟨v, hv, hfv⟩
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · rintro ⟨v, hv, hfv⟩
        

Proof state:
case insert.mpr.intro.intro
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
v : α
hv : v ∈ insert a s
hfv : x ∈ f v
⊢ x ∈ f a ∨ x ∈ Finset.sup s f

Next tactic:
rw [Finset.mem_insert] at hv
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · rintro ⟨v, hv, hfv⟩
        rw [Finset.mem_insert] at hv
        

Proof state:
case insert.mpr.intro.intro
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
v : α
hv : v = a ∨ v ∈ s
hfv : x ∈ f v
⊢ x ∈ f a ∨ x ∈ Finset.sup s f

Next tactic:
rcases hv with (rfl | hv)
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · rintro ⟨v, hv, hfv⟩
        rw [Finset.mem_insert] at hv
        rcases hv with (rfl | hv)
        · 

Proof state:
case insert.mpr.intro.intro.inl
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
s : Finset α
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
v : α
hfv : x ∈ f v
has : v ∉ s
⊢ x ∈ f v ∨ x ∈ Finset.sup s f

Next tactic:
exact Or.inl hfv
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  classical
    induction' s using Finset.induction_on with a s has hxs
    · simp
    · rw [Finset.sup_insert, Multiset.sup_eq_union, Multiset.mem_union]
      constructor
      · intro hxi
        cases' hxi with hf hf
        · refine' ⟨a, _, hf⟩
          simp only [true_or_iff, eq_self_iff_true, Finset.mem_insert]
        · rcases hxs.mp hf with ⟨v, hv, hfv⟩
          refine' ⟨v, _, hfv⟩
          simp only [hv, or_true_iff, Finset.mem_insert]
      · rintro ⟨v, hv, hfv⟩
        rw [Finset.mem_insert] at hv
        rcases hv with (rfl | hv)
        · exact Or.inl hfv
        · 

Proof state:
case insert.mpr.intro.intro.inr
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
f : α → Multiset β
x : β
a : α
s : Finset α
has : a ∉ s
hxs : x ∈ Finset.sup s f ↔ ∃ v ∈ s, x ∈ f v
v : α
hfv : x ∈ f v
hv : v ∈ s
⊢ x ∈ f a ∨ x ∈ Finset.sup s f

Next tactic:
refine' Or.inr (hxs.mpr ⟨v, hv, hfv⟩)
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Finset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
f : α → Finset β
x : β
⊢ x ∈ sup s f ↔ ∃ v ∈ s, x ∈ f v

Next tactic:
change _ ↔ ∃ v ∈ s, x ∈ (f v).val
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Finset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  change _ ↔ ∃ v ∈ s, x ∈ (f v).val
  

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
f : α → Finset β
x : β
⊢ x ∈ sup s f ↔ ∃ v ∈ s, x ∈ (f v).val

Next tactic:
rw [← Multiset.mem_sup, ← Multiset.mem_toFinset, sup_toFinset]
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Finset β} {x : β} :
    x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  change _ ↔ ∃ v ∈ s, x ∈ (f v).val
  rw [← Multiset.mem_sup, ← Multiset.mem_toFinset, sup_toFinset]
  

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
f : α → Finset β
x : β
⊢ x ∈ sup s f ↔ x ∈ sup s fun x => Multiset.toFinset (f x).val

Next tactic:
simp_rw [val_toFinset]
theorem sup_eq_biUnion {α β} [DecidableEq β] (s : Finset α) (t : α → Finset β) :
    s.sup t = s.biUnion t := by
  

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
t : α → Finset β
⊢ sup s t = Finset.biUnion s t

Next tactic:
ext
theorem sup_eq_biUnion {α β} [DecidableEq β] (s : Finset α) (t : α → Finset β) :
    s.sup t = s.biUnion t := by
  ext
  

Proof state:
case a
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
α : Type u_7
β : Type u_8
inst✝ : DecidableEq β
s : Finset α
t : α → Finset β
a✝ : β
⊢ a✝ ∈ sup s t ↔ a✝ ∈ Finset.biUnion s t

Next tactic:
rw [mem_sup, mem_biUnion]
@[simp]
theorem sup_singleton'' [DecidableEq α] (s : Finset β) (f : β → α) :
    (s.sup fun b => {f b}) = s.image f := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DecidableEq α
s : Finset β
f : β → α
⊢ (sup s fun b => {f b}) = image f s

Next tactic:
ext a
@[simp]
theorem sup_singleton'' [DecidableEq α] (s : Finset β) (f : β → α) :
    (s.sup fun b => {f b}) = s.image f := by
  ext a
  

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DecidableEq α
s : Finset β
f : β → α
a : α
⊢ (a ∈ sup s fun b => {f b}) ↔ a ∈ image f s

Next tactic:
rw [mem_sup, mem_image]
@[simp]
theorem sup_singleton'' [DecidableEq α] (s : Finset β) (f : β → α) :
    (s.sup fun b => {f b}) = s.image f := by
  ext a
  rw [mem_sup, mem_image]
  

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : DecidableEq α
s : Finset β
f : β → α
a : α
⊢ (∃ v ∈ s, a ∈ {f v}) ↔ ∃ a_1 ∈ s, f a_1 = a

Next tactic:
simp only [mem_singleton, eq_comm]