l3lab/ntp-mathlib huggingface dataset:
instance (priority := low) [Preorder α] [DecidableRel ((· : α) < ·)] [LocallyFiniteOrder α] :
    LocallyFiniteOrderBot { x : α // y < x } where
  finsetIio a := (Finset.Ioo y ↑a).subtype _
  finsetIic a := (Finset.Ioc y ↑a).subtype _
  finset_mem_Iic a b := by
    simp only [Finset.mem_subtype, Finset.mem_Ioc, Subtype.coe_le_coe, and_iff_right_iff_imp]
    exact fun _ => b.property
  finset_mem_Iio a b := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁴ : Preorder α
p : α → Prop
inst✝³ : DecidablePred p
y : α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : LocallyFiniteOrder α
a b : { x // y < x }
⊢ b ∈ (fun a => Finset.subtype (fun x => y < x) (Ioo y ↑a)) a ↔ b < a

Next tactic:
simp only [Finset.mem_subtype, Finset.mem_Ioo, Subtype.coe_lt_coe, and_iff_right_iff_imp]
instance (priority := low) [Preorder α] [DecidableRel ((· : α) < ·)] [LocallyFiniteOrder α] :
    LocallyFiniteOrderBot { x : α // y < x } where
  finsetIio a := (Finset.Ioo y ↑a).subtype _
  finsetIic a := (Finset.Ioc y ↑a).subtype _
  finset_mem_Iic a b := by
    simp only [Finset.mem_subtype, Finset.mem_Ioc, Subtype.coe_le_coe, and_iff_right_iff_imp]
    exact fun _ => b.property
  finset_mem_Iio a b := by
    simp only [Finset.mem_subtype, Finset.mem_Ioo, Subtype.coe_lt_coe, and_iff_right_iff_imp]
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁴ : Preorder α
p : α → Prop
inst✝³ : DecidablePred p
y : α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : LocallyFiniteOrder α
a b : { x // y < x }
⊢ b < a → y < ↑b

Next tactic:
exact fun _ => b.property
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x ≤ y } := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ Finite { x // x ≤ y }

Next tactic:
apply Set.Finite.to_subtype
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x ≤ y } := by
  apply Set.Finite.to_subtype
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ Set.Finite fun x => Preorder.toLE.1 x y

Next tactic:
convert (Finset.Iic y).finite_toSet using 1
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x ≤ y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iic y).finite_toSet using 1
  

Proof state:
case h.e'_2
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ (fun x => Preorder.toLE.1 x y) = ↑(Iic y)

Next tactic:
ext
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x ≤ y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iic y).finite_toSet using 1
  ext
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLE.1 x y) ↔ x✝ ∈ ↑(Iic y)

Next tactic:
simp
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x ≤ y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iic y).finite_toSet using 1
  ext
  simp
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLE.1 x y) ↔ x✝ ≤ y

Next tactic:
rfl
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x < y } := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ Finite { x // x < y }

Next tactic:
apply Set.Finite.to_subtype
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x < y } := by
  apply Set.Finite.to_subtype
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ Set.Finite fun x => Preorder.toLT.1 x y

Next tactic:
convert (Finset.Iio y).finite_toSet using 1
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x < y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iio y).finite_toSet using 1
  

Proof state:
case h.e'_2
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
⊢ (fun x => Preorder.toLT.1 x y) = ↑(Iio y)

Next tactic:
ext
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x < y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iio y).finite_toSet using 1
  ext
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLT.1 x y) ↔ x✝ ∈ ↑(Iio y)

Next tactic:
simp
instance [Preorder α] [LocallyFiniteOrderBot α] : Finite { x : α // x < y } := by
  apply Set.Finite.to_subtype
  convert (Finset.Iio y).finite_toSet using 1
  ext
  simp
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderBot α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLT.1 x y) ↔ x✝ < y

Next tactic:
rfl
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y ≤ x } := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ Finite { x // y ≤ x }

Next tactic:
apply Set.Finite.to_subtype
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y ≤ x } := by
  apply Set.Finite.to_subtype
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ Set.Finite fun x => Preorder.toLE.1 y x

Next tactic:
convert (Finset.Ici y).finite_toSet using 1
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y ≤ x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ici y).finite_toSet using 1
  

Proof state:
case h.e'_2
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ (fun x => Preorder.toLE.1 y x) = ↑(Ici y)

Next tactic:
ext
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y ≤ x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ici y).finite_toSet using 1
  ext
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLE.1 y x) ↔ x✝ ∈ ↑(Ici y)

Next tactic:
simp
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y ≤ x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ici y).finite_toSet using 1
  ext
  simp
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLE.1 y x) ↔ y ≤ x✝

Next tactic:
rfl
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y < x } := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ Finite { x // y < x }

Next tactic:
apply Set.Finite.to_subtype
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y < x } := by
  apply Set.Finite.to_subtype
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ Set.Finite fun x => Preorder.toLT.1 y x

Next tactic:
convert (Finset.Ioi y).finite_toSet using 1
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y < x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ioi y).finite_toSet using 1
  

Proof state:
case h.e'_2
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
⊢ (fun x => Preorder.toLT.1 y x) = ↑(Ioi y)

Next tactic:
ext
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y < x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ioi y).finite_toSet using 1
  ext
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLT.1 y x) ↔ x✝ ∈ ↑(Ioi y)

Next tactic:
simp
instance [Preorder α] [LocallyFiniteOrderTop α] : Finite { x : α // y < x } := by
  apply Set.Finite.to_subtype
  convert (Finset.Ioi y).finite_toSet using 1
  ext
  simp
  

Proof state:
case h.e'_2.h
α : Type u_1
β : Type u_2
inst✝³ : Preorder α
p : α → Prop
inst✝² : DecidablePred p
y : α
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrderTop α
x✝ : α
⊢ (x✝ ∈ fun x => Preorder.toLT.1 y x) ↔ y < x✝

Next tactic:
rfl
@[simp] lemma toFinset_Icc (a b : α) [Fintype (Icc a b)] : (Icc a b).toFinset = Finset.Icc a b := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Icc a b)
⊢ toFinset (Icc a b) = Finset.Icc a b

Next tactic:
ext
@[simp] lemma toFinset_Icc (a b : α) [Fintype (Icc a b)] : (Icc a b).toFinset = Finset.Icc a b := by
  ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Icc a b)
a✝ : α
⊢ a✝ ∈ toFinset (Icc a b) ↔ a✝ ∈ Finset.Icc a b

Next tactic:
simp
@[simp] lemma toFinset_Ico (a b : α) [Fintype (Ico a b)] : (Ico a b).toFinset = Finset.Ico a b := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ico a b)
⊢ toFinset (Ico a b) = Finset.Ico a b

Next tactic:
ext
@[simp] lemma toFinset_Ico (a b : α) [Fintype (Ico a b)] : (Ico a b).toFinset = Finset.Ico a b := by
  ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ico a b)
a✝ : α
⊢ a✝ ∈ toFinset (Ico a b) ↔ a✝ ∈ Finset.Ico a b

Next tactic:
simp
@[simp] lemma toFinset_Ioc (a b : α) [Fintype (Ioc a b)] : (Ioc a b).toFinset = Finset.Ioc a b := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ioc a b)
⊢ toFinset (Ioc a b) = Finset.Ioc a b

Next tactic:
ext
@[simp] lemma toFinset_Ioc (a b : α) [Fintype (Ioc a b)] : (Ioc a b).toFinset = Finset.Ioc a b := by
  ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ioc a b)
a✝ : α
⊢ a✝ ∈ toFinset (Ioc a b) ↔ a✝ ∈ Finset.Ioc a b

Next tactic:
simp
@[simp] lemma toFinset_Ioo (a b : α) [Fintype (Ioo a b)] : (Ioo a b).toFinset = Finset.Ioo a b := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ioo a b)
⊢ toFinset (Ioo a b) = Finset.Ioo a b

Next tactic:
ext
@[simp] lemma toFinset_Ioo (a b : α) [Fintype (Ioo a b)] : (Ioo a b).toFinset = Finset.Ioo a b := by
  ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrder α
a b : α
inst✝ : Fintype ↑(Ioo a b)
a✝ : α
⊢ a✝ ∈ toFinset (Ioo a b) ↔ a✝ ∈ Finset.Ioo a b

Next tactic:
simp
@[simp]
lemma toFinset_Ici (a : α) [Fintype (Ici a)] : (Ici a).toFinset = Finset.Ici a := by 

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderTop α
a : α
inst✝ : Fintype ↑(Ici a)
⊢ toFinset (Ici a) = Finset.Ici a

Next tactic:
ext
@[simp]
lemma toFinset_Ici (a : α) [Fintype (Ici a)] : (Ici a).toFinset = Finset.Ici a := by ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderTop α
a : α
inst✝ : Fintype ↑(Ici a)
a✝ : α
⊢ a✝ ∈ toFinset (Ici a) ↔ a✝ ∈ Finset.Ici a

Next tactic:
simp
@[simp]
lemma toFinset_Ioi (a : α) [Fintype (Ioi a)] : (Ioi a).toFinset = Finset.Ioi a := by 

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderTop α
a : α
inst✝ : Fintype ↑(Ioi a)
⊢ toFinset (Ioi a) = Finset.Ioi a

Next tactic:
ext
@[simp]
lemma toFinset_Ioi (a : α) [Fintype (Ioi a)] : (Ioi a).toFinset = Finset.Ioi a := by ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderTop α
a : α
inst✝ : Fintype ↑(Ioi a)
a✝ : α
⊢ a✝ ∈ toFinset (Ioi a) ↔ a✝ ∈ Finset.Ioi a

Next tactic:
simp
@[simp]
lemma toFinset_Iic (a : α) [Fintype (Iic a)] : (Iic a).toFinset = Finset.Iic a := by 

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderBot α
a : α
inst✝ : Fintype ↑(Iic a)
⊢ toFinset (Iic a) = Finset.Iic a

Next tactic:
ext
@[simp]
lemma toFinset_Iic (a : α) [Fintype (Iic a)] : (Iic a).toFinset = Finset.Iic a := by ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderBot α
a : α
inst✝ : Fintype ↑(Iic a)
a✝ : α
⊢ a✝ ∈ toFinset (Iic a) ↔ a✝ ∈ Finset.Iic a

Next tactic:
simp
@[simp]
lemma toFinset_Iio (a : α) [Fintype (Iio a)] : (Iio a).toFinset = Finset.Iio a := by 

Proof state:
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderBot α
a : α
inst✝ : Fintype ↑(Iio a)
⊢ toFinset (Iio a) = Finset.Iio a

Next tactic:
ext
@[simp]
lemma toFinset_Iio (a : α) [Fintype (Iio a)] : (Iio a).toFinset = Finset.Iio a := by ext; 

Proof state:
case a
α✝ : Type u_1
β : Type u_2
inst✝⁴ : Preorder α✝
p : α✝ → Prop
inst✝³ : DecidablePred p
α : Type u_3
inst✝² : Preorder α
inst✝¹ : LocallyFiniteOrderBot α
a : α
inst✝ : Fintype ↑(Iio a)
a✝ : α
⊢ a✝ ∈ toFinset (Iio a) ↔ a✝ ∈ Finset.Iio a

Next tactic:
simp
instance lawfulFunctor : LawfulFunctor Finset where
  id_map s := image_id
  comp_map f g s := image_image.symm
  map_const {α} {β} := by 

Proof state:
α✝ β✝ : Type u
inst✝ : (P : Prop) → Decidable P
α β : Type ?u.386
⊢ Functor.mapConst = Functor.map ∘ const β

Next tactic:
simp only [Functor.mapConst, Functor.map]
/-- `Finset.image₂` in terms of monadic operations. Note that this can't be taken as the definition
because of the lack of universe polymorphism. -/
theorem image₂_def {α β γ : Type u} (f : α → β → γ) (s : Finset α) (t : Finset β) :
    image₂ f s t = f <$> s <*> t := by
  

Proof state:
α✝ β✝ : Type u
inst✝ : (P : Prop) → Decidable P
α β γ : Type u
f : α → β → γ
s : Finset α
t : Finset β
⊢ image₂ f s t = Seq.seq (f <$> s) fun x => t

Next tactic:
ext
/-- `Finset.image₂` in terms of monadic operations. Note that this can't be taken as the definition
because of the lack of universe polymorphism. -/
theorem image₂_def {α β γ : Type u} (f : α → β → γ) (s : Finset α) (t : Finset β) :
    image₂ f s t = f <$> s <*> t := by
  ext
  

Proof state:
case a
α✝ β✝ : Type u
inst✝ : (P : Prop) → Decidable P
α β γ : Type u
f : α → β → γ
s : Finset α
t : Finset β
a✝ : γ
⊢ a✝ ∈ image₂ f s t ↔ a✝ ∈ Seq.seq (f <$> s) fun x => t

Next tactic:
simp [mem_sup]
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      

Proof state:
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
⊢ (SeqLeft.seqLeft s fun x => t) = Seq.seq (const β✝ <$> s) fun x => t

Next tactic:
rw [seq_def, fmap_def, seqLeft_def]
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      

Proof state:
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
⊢ (if t = ∅ then ∅ else s) = sup (image (const β✝) s) fun f => image f t

Next tactic:
obtain rfl | ht := t.eq_empty_or_nonempty
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · 

Proof state:
case inl
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
⊢ (if ∅ = ∅ then ∅ else s) = sup (image (const β✝) s) fun f => image f ∅

Next tactic:
simp_rw [image_empty, if_true]
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        

Proof state:
case inl
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
⊢ ∅ = sup (image (const β✝) s) fun f => ∅

Next tactic:
exact (sup_bot _).symm
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · 

Proof state:
case inr
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
⊢ (if t = ∅ then ∅ else s) = sup (image (const β✝) s) fun f => image f t

Next tactic:
ext a
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        

Proof state:
case inr.a
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a : α✝
⊢ (a ∈ if t = ∅ then ∅ else s) ↔ a ∈ sup (image (const β✝) s) fun f => image f t

Next tactic:
rw [if_neg ht.ne_empty, mem_sup]
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        

Proof state:
case inr.a
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a : α✝
⊢ a ∈ s ↔ ∃ v ∈ image (const β✝) s, a ∈ image v t

Next tactic:
refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
        

Proof state:
case inr.a
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a : α✝
⊢ (∃ v ∈ image (const β✝) s, a ∈ image v t) → a ∈ s

Next tactic:
rintro ⟨f, hf, ha⟩
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
        rintro ⟨f, hf, ha⟩
        

Proof state:
case inr.a.intro.intro
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a : α✝
f : β✝ → α✝
hf : f ∈ image (const β✝) s
ha : a ∈ image f t
⊢ a ∈ s

Next tactic:
rw [mem_image] at hf ha
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
        rintro ⟨f, hf, ha⟩
        rw [mem_image] at hf ha
        

Proof state:
case inr.a.intro.intro
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a : α✝
f : β✝ → α✝
hf : ∃ a ∈ s, const β✝ a = f
ha : ∃ a_1 ∈ t, f a_1 = a
⊢ a ∈ s

Next tactic:
obtain ⟨b, hb, rfl⟩ := hf
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
        rintro ⟨f, hf, ha⟩
        rw [mem_image] at hf ha
        obtain ⟨b, hb, rfl⟩ := hf
        

Proof state:
case inr.a.intro.intro.intro.intro
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
a b : α✝
hb : b ∈ s
ha : ∃ a_1 ∈ t, const β✝ b a_1 = a
⊢ a ∈ s

Next tactic:
obtain ⟨_, _, rfl⟩ := ha
instance lawfulApplicative : LawfulApplicative Finset :=
  { Finset.lawfulFunctor with
    seqLeft_eq := fun s t => by
      rw [seq_def, fmap_def, seqLeft_def]
      obtain rfl | ht := t.eq_empty_or_nonempty
      · simp_rw [image_empty, if_true]
        exact (sup_bot _).symm
      · ext a
        rw [if_neg ht.ne_empty, mem_sup]
        refine' ⟨fun ha => ⟨const _ a, mem_image_of_mem _ ha, mem_image_const_self.2 ht⟩, _⟩
        rintro ⟨f, hf, ha⟩
        rw [mem_image] at hf ha
        obtain ⟨b, hb, rfl⟩ := hf
        obtain ⟨_, _, rfl⟩ := ha
        

Proof state:
case inr.a.intro.intro.intro.intro.intro.intro
α β : Type u
inst✝ : (P : Prop) → Decidable P
src✝ : LawfulFunctor Finset := lawfulFunctor
α✝ β✝ : Type ?u.12335
s : Finset α✝
t : Finset β✝
ht : Finset.Nonempty t
b : α✝
hb : b ∈ s
w✝ : β✝
left✝ : w✝ ∈ t
⊢ const β✝ b w✝ ∈ s

Next tactic:
exact hb