l3lab/ntp-mathlib huggingface dataset:
/-- If `x`, `y`, `x'`, and `y'` are functions `Π i : ι, α i`, then
the set difference between the box `[x, y]` and the product of the open intervals `(x' i, y' i)`
is covered by the union of the following boxes: for each `i : ι`, we take
`[x, update y i (x' i)]` and `[update x i (y' i), y]`.

E.g., if `x' = x` and `y' = y`, then this lemma states that the difference between a closed box
`[x, y]` and the corresponding open box `{z | ∀ i, x i < z i < y i}` is covered by the union
of the faces of `[x, y]`. -/
theorem Icc_diff_pi_univ_Ioo_subset (x y x' y' : ∀ i, α i) :
    (Icc x y \ pi univ fun i ↦ Ioo (x' i) (y' i)) ⊆
    (⋃ i : ι, Icc x (update y i (x' i))) ∪ ⋃ i : ι, Icc (update x i (y' i)) y := by
  rintro a ⟨⟨hxa, hay⟩, ha'⟩
  simp at ha'
  simp only [ge_iff_le, le_update_iff, ne_eq, not_and, not_forall, not_le, exists_prop, gt_iff_lt,
    update_le_iff, mem_union, mem_iUnion, mem_Icc, hxa, hay _, implies_true, and_true, true_and,
    hxa _, hay, ← exists_or]
  

Proof state:
case intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y x' y' a : (i : ι) → α i
hxa : x ≤ a
hay : a ≤ y
ha' : ∃ x, x' x < a x → y' x ≤ a x
⊢ ∃ x, a x ≤ x' x ∨ y' x ≤ a x

Next tactic:
rcases ha' with ⟨w, hw⟩
/-- If `x`, `y`, `x'`, and `y'` are functions `Π i : ι, α i`, then
the set difference between the box `[x, y]` and the product of the open intervals `(x' i, y' i)`
is covered by the union of the following boxes: for each `i : ι`, we take
`[x, update y i (x' i)]` and `[update x i (y' i), y]`.

E.g., if `x' = x` and `y' = y`, then this lemma states that the difference between a closed box
`[x, y]` and the corresponding open box `{z | ∀ i, x i < z i < y i}` is covered by the union
of the faces of `[x, y]`. -/
theorem Icc_diff_pi_univ_Ioo_subset (x y x' y' : ∀ i, α i) :
    (Icc x y \ pi univ fun i ↦ Ioo (x' i) (y' i)) ⊆
    (⋃ i : ι, Icc x (update y i (x' i))) ∪ ⋃ i : ι, Icc (update x i (y' i)) y := by
  rintro a ⟨⟨hxa, hay⟩, ha'⟩
  simp at ha'
  simp only [ge_iff_le, le_update_iff, ne_eq, not_and, not_forall, not_le, exists_prop, gt_iff_lt,
    update_le_iff, mem_union, mem_iUnion, mem_Icc, hxa, hay _, implies_true, and_true, true_and,
    hxa _, hay, ← exists_or]
  rcases ha' with ⟨w, hw⟩
  

Proof state:
case intro.intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y x' y' a : (i : ι) → α i
hxa : x ≤ a
hay : a ≤ y
w : ι
hw : x' w < a w → y' w ≤ a w
⊢ ∃ x, a x ≤ x' x ∨ y' x ≤ a x

Next tactic:
apply Exists.intro w
/-- If `x`, `y`, `x'`, and `y'` are functions `Π i : ι, α i`, then
the set difference between the box `[x, y]` and the product of the open intervals `(x' i, y' i)`
is covered by the union of the following boxes: for each `i : ι`, we take
`[x, update y i (x' i)]` and `[update x i (y' i), y]`.

E.g., if `x' = x` and `y' = y`, then this lemma states that the difference between a closed box
`[x, y]` and the corresponding open box `{z | ∀ i, x i < z i < y i}` is covered by the union
of the faces of `[x, y]`. -/
theorem Icc_diff_pi_univ_Ioo_subset (x y x' y' : ∀ i, α i) :
    (Icc x y \ pi univ fun i ↦ Ioo (x' i) (y' i)) ⊆
    (⋃ i : ι, Icc x (update y i (x' i))) ∪ ⋃ i : ι, Icc (update x i (y' i)) y := by
  rintro a ⟨⟨hxa, hay⟩, ha'⟩
  simp at ha'
  simp only [ge_iff_le, le_update_iff, ne_eq, not_and, not_forall, not_le, exists_prop, gt_iff_lt,
    update_le_iff, mem_union, mem_iUnion, mem_Icc, hxa, hay _, implies_true, and_true, true_and,
    hxa _, hay, ← exists_or]
  rcases ha' with ⟨w, hw⟩
  apply Exists.intro w
  

Proof state:
case intro.intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y x' y' a : (i : ι) → α i
hxa : x ≤ a
hay : a ≤ y
w : ι
hw : x' w < a w → y' w ≤ a w
⊢ a w ≤ x' w ∨ y' w ≤ a w

Next tactic:
cases lt_or_le (x' w) (a w)
/-- If `x`, `y`, `x'`, and `y'` are functions `Π i : ι, α i`, then
the set difference between the box `[x, y]` and the product of the open intervals `(x' i, y' i)`
is covered by the union of the following boxes: for each `i : ι`, we take
`[x, update y i (x' i)]` and `[update x i (y' i), y]`.

E.g., if `x' = x` and `y' = y`, then this lemma states that the difference between a closed box
`[x, y]` and the corresponding open box `{z | ∀ i, x i < z i < y i}` is covered by the union
of the faces of `[x, y]`. -/
theorem Icc_diff_pi_univ_Ioo_subset (x y x' y' : ∀ i, α i) :
    (Icc x y \ pi univ fun i ↦ Ioo (x' i) (y' i)) ⊆
    (⋃ i : ι, Icc x (update y i (x' i))) ∪ ⋃ i : ι, Icc (update x i (y' i)) y := by
  rintro a ⟨⟨hxa, hay⟩, ha'⟩
  simp at ha'
  simp only [ge_iff_le, le_update_iff, ne_eq, not_and, not_forall, not_le, exists_prop, gt_iff_lt,
    update_le_iff, mem_union, mem_iUnion, mem_Icc, hxa, hay _, implies_true, and_true, true_and,
    hxa _, hay, ← exists_or]
  rcases ha' with ⟨w, hw⟩
  apply Exists.intro w
  cases lt_or_le (x' w) (a w) <;> 

Proof state:
case intro.intro.intro.inl
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y x' y' a : (i : ι) → α i
hxa : x ≤ a
hay : a ≤ y
w : ι
hw : x' w < a w → y' w ≤ a w
h✝ : x' w < a w
⊢ a w ≤ x' w ∨ y' w ≤ a w

Next tactic:
simp_all
/-- If `x`, `y`, `x'`, and `y'` are functions `Π i : ι, α i`, then
the set difference between the box `[x, y]` and the product of the open intervals `(x' i, y' i)`
is covered by the union of the following boxes: for each `i : ι`, we take
`[x, update y i (x' i)]` and `[update x i (y' i), y]`.

E.g., if `x' = x` and `y' = y`, then this lemma states that the difference between a closed box
`[x, y]` and the corresponding open box `{z | ∀ i, x i < z i < y i}` is covered by the union
of the faces of `[x, y]`. -/
theorem Icc_diff_pi_univ_Ioo_subset (x y x' y' : ∀ i, α i) :
    (Icc x y \ pi univ fun i ↦ Ioo (x' i) (y' i)) ⊆
    (⋃ i : ι, Icc x (update y i (x' i))) ∪ ⋃ i : ι, Icc (update x i (y' i)) y := by
  rintro a ⟨⟨hxa, hay⟩, ha'⟩
  simp at ha'
  simp only [ge_iff_le, le_update_iff, ne_eq, not_and, not_forall, not_le, exists_prop, gt_iff_lt,
    update_le_iff, mem_union, mem_iUnion, mem_Icc, hxa, hay _, implies_true, and_true, true_and,
    hxa _, hay, ← exists_or]
  rcases ha' with ⟨w, hw⟩
  apply Exists.intro w
  cases lt_or_le (x' w) (a w) <;> 

Proof state:
case intro.intro.intro.inr
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y x' y' a : (i : ι) → α i
hxa : x ≤ a
hay : a ≤ y
w : ι
hw : x' w < a w → y' w ≤ a w
h✝ : a w ≤ x' w
⊢ a w ≤ x' w ∨ y' w ≤ a w

Next tactic:
simp_all
/-- If `x`, `y`, `z` are functions `Π i : ι, α i`, then
the set difference between the box `[x, z]` and the product of the intervals `(y i, z i]`
is covered by the union of the boxes `[x, update z i (y i)]`.

E.g., if `x = y`, then this lemma states that the difference between a closed box
`[x, y]` and the product of half-open intervals `{z | ∀ i, x i < z i ≤ y i}` is covered by the union
of the faces of `[x, y]` adjacent to `x`. -/
theorem Icc_diff_pi_univ_Ioc_subset (x y z : ∀ i, α i) :
    (Icc x z \ pi univ fun i ↦ Ioc (y i) (z i)) ⊆ ⋃ i : ι, Icc x (update z i (y i)) := by
  

Proof state:
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y z : (i : ι) → α i
⊢ (Icc x z \ pi univ fun i => Ioc (y i) (z i)) ⊆ ⋃ i, Icc x (update z i (y i))

Next tactic:
rintro a ⟨⟨hax, haz⟩, hay⟩
/-- If `x`, `y`, `z` are functions `Π i : ι, α i`, then
the set difference between the box `[x, z]` and the product of the intervals `(y i, z i]`
is covered by the union of the boxes `[x, update z i (y i)]`.

E.g., if `x = y`, then this lemma states that the difference between a closed box
`[x, y]` and the product of half-open intervals `{z | ∀ i, x i < z i ≤ y i}` is covered by the union
of the faces of `[x, y]` adjacent to `x`. -/
theorem Icc_diff_pi_univ_Ioc_subset (x y z : ∀ i, α i) :
    (Icc x z \ pi univ fun i ↦ Ioc (y i) (z i)) ⊆ ⋃ i : ι, Icc x (update z i (y i)) := by
  rintro a ⟨⟨hax, haz⟩, hay⟩
  

Proof state:
case intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → LinearOrder (α i)
x y z a : (i : ι) → α i
hay : a ∉ pi univ fun i => Ioc (y i) (z i)
hax : x ≤ a
haz : a ≤ z
⊢ a ∈ ⋃ i, Icc x (update z i (y i))

Next tactic:
simpa [not_and_or, hax, le_update_iff, haz _] using hay
@[simp] lemma supClosed_empty : SupClosed (∅ : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ SupClosed ∅

Next tactic:
simp [SupClosed]
@[simp] lemma supClosed_singleton : SupClosed ({a} : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ SupClosed {a}

Next tactic:
simp [SupClosed]
@[simp] lemma supClosed_univ : SupClosed (univ : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ SupClosed univ

Next tactic:
simp [SupClosed]
lemma SupClosed.preimage [SupHomClass F β α] (hs : SupClosed s) (f : F) : SupClosed (f ⁻¹' s) :=
  fun a ha b hb ↦ by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeSup α
inst✝¹ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : SupHomClass F β α
hs : SupClosed s
f : F
a : β
ha : a ∈ ⇑f ⁻¹' s
b : β
hb : b ∈ ⇑f ⁻¹' s
⊢ a ⊔ b ∈ ⇑f ⁻¹' s

Next tactic:
simpa [map_sup] using hs ha hb
lemma SupClosed.image [SupHomClass F α β] (hs : SupClosed s) (f : F) : SupClosed (f '' s) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeSup α
inst✝¹ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a : α
inst✝ : SupHomClass F α β
hs : SupClosed s
f : F
⊢ SupClosed (⇑f '' s)

Next tactic:
rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
lemma SupClosed.image [SupHomClass F α β] (hs : SupClosed s) (f : F) : SupClosed (f '' s) := by
  rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeSup α
inst✝¹ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : SupHomClass F α β
hs : SupClosed s
f : F
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ f a ⊔ f b ∈ ⇑f '' s

Next tactic:
rw [← map_sup]
lemma SupClosed.image [SupHomClass F α β] (hs : SupClosed s) (f : F) : SupClosed (f '' s) := by
  rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
  rw [← map_sup]
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeSup α
inst✝¹ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : SupHomClass F α β
hs : SupClosed s
f : F
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ f (a ⊔ b) ∈ ⇑f '' s

Next tactic:
exact Set.mem_image_of_mem _ $ hs ha hb
lemma supClosed_range [SupHomClass F α β] (f : F) : SupClosed (Set.range f) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeSup α
inst✝¹ : SemilatticeSup β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a : α
inst✝ : SupHomClass F α β
f : F
⊢ SupClosed (range ⇑f)

Next tactic:
simpa using supClosed_univ.image f
@[simp] lemma infClosed_empty : InfClosed (∅ : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeInf α
inst✝ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ InfClosed ∅

Next tactic:
simp [InfClosed]
@[simp] lemma infClosed_singleton : InfClosed ({a} : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeInf α
inst✝ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ InfClosed {a}

Next tactic:
simp [InfClosed]
@[simp] lemma infClosed_univ : InfClosed (univ : Set α) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeInf α
inst✝ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f : ι → Set α
s t : Set α
a : α
⊢ InfClosed univ

Next tactic:
simp [InfClosed]
lemma InfClosed.preimage [InfHomClass F β α] (hs : InfClosed s) (f : F) : InfClosed (f ⁻¹' s) :=
  fun a ha b hb ↦ by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeInf α
inst✝¹ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : InfHomClass F β α
hs : InfClosed s
f : F
a : β
ha : a ∈ ⇑f ⁻¹' s
b : β
hb : b ∈ ⇑f ⁻¹' s
⊢ a ⊓ b ∈ ⇑f ⁻¹' s

Next tactic:
simpa [map_inf] using hs ha hb
lemma InfClosed.image [InfHomClass F α β] (hs : InfClosed s) (f : F) : InfClosed (f '' s) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeInf α
inst✝¹ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a : α
inst✝ : InfHomClass F α β
hs : InfClosed s
f : F
⊢ InfClosed (⇑f '' s)

Next tactic:
rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
lemma InfClosed.image [InfHomClass F α β] (hs : InfClosed s) (f : F) : InfClosed (f '' s) := by
  rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeInf α
inst✝¹ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : InfHomClass F α β
hs : InfClosed s
f : F
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ f a ⊓ f b ∈ ⇑f '' s

Next tactic:
rw [← map_inf]
lemma InfClosed.image [InfHomClass F α β] (hs : InfClosed s) (f : F) : InfClosed (f '' s) := by
  rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩
  rw [← map_inf]
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeInf α
inst✝¹ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a✝ : α
inst✝ : InfHomClass F α β
hs : InfClosed s
f : F
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ f (a ⊓ b) ∈ ⇑f '' s

Next tactic:
exact Set.mem_image_of_mem _ $ hs ha hb
lemma infClosed_range [InfHomClass F α β] (f : F) : InfClosed (Set.range f) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝² : SemilatticeInf α
inst✝¹ : SemilatticeInf β
ι : Sort u_4
S : Set (Set α)
f✝ : ι → Set α
s t : Set α
a : α
inst✝ : InfHomClass F α β
f : F
⊢ InfClosed (range ⇑f)

Next tactic:
simpa using infClosed_univ.image f
@[simp] protected lemma LinearOrder.supClosed (s : Set α) : SupClosed s :=
λ a ha b hb ↦ by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ a ⊔ b ∈ s

Next tactic:
cases le_total a b
@[simp] protected lemma LinearOrder.supClosed (s : Set α) : SupClosed s :=
λ a ha b hb ↦ by cases le_total a b <;> 

Proof state:
case inl
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
h✝ : a ≤ b
⊢ a ⊔ b ∈ s

Next tactic:
simp [*]
@[simp] protected lemma LinearOrder.supClosed (s : Set α) : SupClosed s :=
λ a ha b hb ↦ by cases le_total a b <;> 

Proof state:
case inr
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
h✝ : b ≤ a
⊢ a ⊔ b ∈ s

Next tactic:
simp [*]
@[simp] protected lemma LinearOrder.infClosed (s : Set α) : InfClosed s :=
λ a ha b hb ↦ by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ a ⊓ b ∈ s

Next tactic:
cases le_total a b
@[simp] protected lemma LinearOrder.infClosed (s : Set α) : InfClosed s :=
λ a ha b hb ↦ by cases le_total a b <;> 

Proof state:
case inl
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
h✝ : a ≤ b
⊢ a ⊓ b ∈ s

Next tactic:
simp [*]
@[simp] protected lemma LinearOrder.infClosed (s : Set α) : InfClosed s :=
λ a ha b hb ↦ by cases le_total a b <;> 

Proof state:
case inr
F : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrder α
s : Set α
a : α
ha : a ∈ s
b : α
hb : b ∈ s
h✝ : b ≤ a
⊢ a ⊓ b ∈ s

Next tactic:
simp [*]
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t : Set α
a✝ b : α
s : Set α
a : α
ha : a ∈ s
⊢ ↑{a} ⊆ s ∧ sup' {a} (_ : Finset.Nonempty {a}) id = a

Next tactic:
simpa
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ ∀ (x : Set α), SupClosed ((fun s => {a | ∃ t, ∃ (ht : Finset.Nonempty t), ↑t ⊆ s ∧ sup' t ht id = a}) x)

Next tactic:
classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
    rw [coe_union]
    exact Set.union_subset hts hus
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ ∀ (x : Set α), SupClosed ((fun s => {a | ∃ t, ∃ (ht : Finset.Nonempty t), ↑t ⊆ s ∧ sup' t ht id = a}) x)

Next tactic:
rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t✝ : Set α
a b : α
s : Set α
t : Finset α
ht : Finset.Nonempty t
hts : ↑t ⊆ s
u : Finset α
hu : Finset.Nonempty u
hus : ↑u ⊆ s
⊢ sup' t ht id ⊔ sup' u hu id ∈ (fun s => {a | ∃ t, ∃ (ht : Finset.Nonempty t), ↑t ⊆ s ∧ sup' t ht id = a}) s

Next tactic:
refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
    

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t✝ : Set α
a b : α
s : Set α
t : Finset α
ht : Finset.Nonempty t
hts : ↑t ⊆ s
u : Finset α
hu : Finset.Nonempty u
hus : ↑u ⊆ s
⊢ ↑(t ∪ u) ⊆ s

Next tactic:
rw [coe_union]
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
    rw [coe_union]
    

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t✝ : Set α
a b : α
s : Set α
t : Finset α
ht : Finset.Nonempty t
hts : ↑t ⊆ s
u : Finset α
hu : Finset.Nonempty u
hus : ↑u ⊆ s
⊢ ↑t ∪ ↑u ⊆ s

Next tactic:
exact Set.union_subset hts hus
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
    rw [coe_union]
    exact Set.union_subset hts hus)
  (by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ ∀ ⦃x y : Set α⦄,
    x ≤ y → SupClosed y → (fun s => {a | ∃ t, ∃ (ht : Finset.Nonempty t), ↑t ⊆ s ∧ sup' t ht id = a}) x ≤ y

Next tactic:
rintro s₁ s₂ hs h₂ _ ⟨t, ht, hts, rfl⟩
/-- Every set in a join-semilattice generates a set closed under join. -/
@[simps! isClosed]
def supClosure : ClosureOperator (Set α) := .ofPred
  (λ s ↦ {a | ∃ (t : Finset α) (ht : t.Nonempty), ↑t ⊆ s ∧ t.sup' ht id = a})
  SupClosed
  (λ s a ha ↦ ⟨{a}, singleton_nonempty _, by simpa⟩)
  (by
    classical
    rintro s _ ⟨t, ht, hts, rfl⟩ _ ⟨u, hu, hus, rfl⟩
    refine' ⟨_, ht.mono $ subset_union_left _ _, _, sup'_union ht hu _⟩
    rw [coe_union]
    exact Set.union_subset hts hus)
  (by rintro s₁ s₂ hs h₂ _ ⟨t, ht, hts, rfl⟩; 

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t✝ : Set α
a b : α
s₁ s₂ : Set α
hs : s₁ ≤ s₂
h₂ : SupClosed s₂
t : Finset α
ht : Finset.Nonempty t
hts : ↑t ⊆ s₁
⊢ sup' t ht id ∈ s₂

Next tactic:
exact h₂.finsetSup'_mem ht λ i hi ↦ hs $ hts hi
@[simp] lemma supClosure_empty : supClosure (∅ : Set α) = ∅ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ supClosure ∅ = ∅

Next tactic:
simp
@[simp] lemma supClosure_singleton : supClosure {a} = {a} := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ supClosure {a} = {a}

Next tactic:
simp
@[simp] lemma supClosure_univ : supClosure (Set.univ : Set α) = Set.univ := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ supClosure Set.univ = Set.univ

Next tactic:
simp
@[simp] lemma upperBounds_supClosure (s : Set α) : upperBounds (supClosure s) = upperBounds s :=
(upperBounds_mono_set subset_supClosure).antisymm $ by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t : Set α
a b : α
s : Set α
⊢ upperBounds s ⊆ upperBounds (supClosure s)

Next tactic:
rintro a ha _ ⟨t, ht, hts, rfl⟩
@[simp] lemma upperBounds_supClosure (s : Set α) : upperBounds (supClosure s) = upperBounds s :=
(upperBounds_mono_set subset_supClosure).antisymm $ by
  rintro a ha _ ⟨t, ht, hts, rfl⟩
  

Proof state:
case intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s✝ t✝ : Set α
a✝ b : α
s : Set α
a : α
ha : a ∈ upperBounds s
t : Finset α
ht : Finset.Nonempty t
hts : ↑t ⊆ s
⊢ sup' t ht id ≤ a

Next tactic:
exact sup'_le _ _ λ b hb ↦ ha $ hts hb
@[simp] lemma isLUB_supClosure : IsLUB (supClosure s) a ↔ IsLUB s a := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
⊢ IsLUB (supClosure s) a ↔ IsLUB s a

Next tactic:
simp [IsLUB]
/-- The semilatice generated by a finite set is finite. -/
protected lemma Set.Finite.supClosure (hs : s.Finite) : (supClosure s).Finite := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
s t : Set α
a b : α
hs : Set.Finite s
⊢ Set.Finite (supClosure s)

Next tactic:
lift s to Finset α using hs