l3lab/ntp-mathlib huggingface dataset:
instance instAdd : Add (ConvexCone 𝕜 E) :=
  ⟨fun K₁ K₂ =>
    { carrier := { z | ∃ x y : E, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z }
      smul_mem' := by
        rintro c hc _ ⟨x, y, hx, hy, rfl⟩
        rw [smul_add]
        

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
K₁ K₂ : ConvexCone 𝕜 E
c : 𝕜
hc : 0 < c
x y : E
hx : x ∈ K₁
hy : y ∈ K₂
⊢ c • x + c • y ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z}

Next tactic:
use c • x, c • y, K₁.smul_mem hc hx, K₂.smul_mem hc hy
instance instAdd : Add (ConvexCone 𝕜 E) :=
  ⟨fun K₁ K₂ =>
    { carrier := { z | ∃ x y : E, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z }
      smul_mem' := by
        rintro c hc _ ⟨x, y, hx, hy, rfl⟩
        rw [smul_add]
        use c • x, c • y, K₁.smul_mem hc hx, K₂.smul_mem hc hy
      add_mem' := by
        

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
K₁ K₂ : ConvexCone 𝕜 E
⊢ ∀ ⦃x : E⦄,
    x ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z} →
      ∀ ⦃y : E⦄, y ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z} → x + y ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z}

Next tactic:
rintro _ ⟨x₁, x₂, hx₁, hx₂, rfl⟩ y ⟨y₁, y₂, hy₁, hy₂, rfl⟩
instance instAdd : Add (ConvexCone 𝕜 E) :=
  ⟨fun K₁ K₂ =>
    { carrier := { z | ∃ x y : E, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z }
      smul_mem' := by
        rintro c hc _ ⟨x, y, hx, hy, rfl⟩
        rw [smul_add]
        use c • x, c • y, K₁.smul_mem hc hx, K₂.smul_mem hc hy
      add_mem' := by
        rintro _ ⟨x₁, x₂, hx₁, hx₂, rfl⟩ y ⟨y₁, y₂, hy₁, hy₂, rfl⟩
        

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
K₁ K₂ : ConvexCone 𝕜 E
x₁ x₂ : E
hx₁ : x₁ ∈ K₁
hx₂ : x₂ ∈ K₂
y₁ y₂ : E
hy₁ : y₁ ∈ K₁
hy₂ : y₂ ∈ K₂
⊢ x₁ + x₂ + (y₁ + y₂) ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z}

Next tactic:
use x₁ + y₁, x₂ + y₂, K₁.add_mem hx₁ hy₁, K₂.add_mem hx₂ hy₂
instance instAdd : Add (ConvexCone 𝕜 E) :=
  ⟨fun K₁ K₂ =>
    { carrier := { z | ∃ x y : E, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z }
      smul_mem' := by
        rintro c hc _ ⟨x, y, hx, hy, rfl⟩
        rw [smul_add]
        use c • x, c • y, K₁.smul_mem hc hx, K₂.smul_mem hc hy
      add_mem' := by
        rintro _ ⟨x₁, x₂, hx₁, hx₂, rfl⟩ y ⟨y₁, y₂, hy₁, hy₂, rfl⟩
        use x₁ + y₁, x₂ + y₂, K₁.add_mem hx₁ hy₁, K₂.add_mem hx₂ hy₂
        

Proof state:
case right
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
K₁ K₂ : ConvexCone 𝕜 E
x₁ x₂ : E
hx₁ : x₁ ∈ K₁
hx₂ : x₂ ∈ K₂
y₁ y₂ : E
hy₁ : y₁ ∈ K₁
hy₂ : y₂ ∈ K₂
⊢ x₁ + y₁ + (x₂ + y₂) = x₁ + x₂ + (y₁ + y₂)

Next tactic:
abel
instance instAddZeroClass : AddZeroClass (ConvexCone 𝕜 E) where
  zero_add _ := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
x✝ : ConvexCone 𝕜 E
⊢ 0 + x✝ = x✝

Next tactic:
ext
instance instAddZeroClass : AddZeroClass (ConvexCone 𝕜 E) where
  zero_add _ := by ext; 

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
x✝¹ : ConvexCone 𝕜 E
x✝ : E
⊢ x✝ ∈ 0 + x✝¹ ↔ x✝ ∈ x✝¹

Next tactic:
simp
instance instAddZeroClass : AddZeroClass (ConvexCone 𝕜 E) where
  zero_add _ := by ext; simp
  add_zero _ := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
x✝ : ConvexCone 𝕜 E
⊢ x✝ + 0 = x✝

Next tactic:
ext
instance instAddZeroClass : AddZeroClass (ConvexCone 𝕜 E) where
  zero_add _ := by ext; simp
  add_zero _ := by ext; 

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : Module 𝕜 E
x✝¹ : ConvexCone 𝕜 E
x✝ : E
⊢ x✝ ∈ x✝¹ + 0 ↔ x✝ ∈ x✝¹

Next tactic:
simp
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
⊢ ConvexCone 𝕜 E

Next tactic:
apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s)
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> 

Proof state:
case smul_mem'
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
⊢ ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ ⋃ c, ⋃ (_ : 0 < c), c • s → c • x ∈ ⋃ c, ⋃ (_ : 0 < c), c • s

Next tactic:
simp only [mem_iUnion, mem_smul_set]
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> 

Proof state:
case add_mem'
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
⊢ ∀ ⦃x : E⦄,
    x ∈ ⋃ c, ⋃ (_ : 0 < c), c • s → ∀ ⦃y : E⦄, y ∈ ⋃ c, ⋃ (_ : 0 < c), c • s → x + y ∈ ⋃ c, ⋃ (_ : 0 < c), c • s

Next tactic:
simp only [mem_iUnion, mem_smul_set]
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · 

Proof state:
case smul_mem'
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
⊢ ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, (∃ i, ∃ (_ : 0 < i), ∃ y ∈ s, i • y = x) → ∃ i, ∃ (_ : 0 < i), ∃ y ∈ s, i • y = c • x

Next tactic:
rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
    

Proof state:
case smul_mem'.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
c : 𝕜
c_pos : 0 < c
c' : 𝕜
c'_pos : 0 < c'
x : E
hx : x ∈ s
⊢ ∃ i, ∃ (_ : 0 < i), ∃ y ∈ s, i • y = c • c' • x

Next tactic:
exact ⟨c * c', mul_pos c_pos c'_pos, x, hx, (smul_smul _ _ _).symm⟩
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
    exact ⟨c * c', mul_pos c_pos c'_pos, x, hx, (smul_smul _ _ _).symm⟩
  · 

Proof state:
case add_mem'
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
⊢ ∀ ⦃x : E⦄,
    (∃ i, ∃ (_ : 0 < i), ∃ y ∈ s, i • y = x) →
      ∀ ⦃y : E⦄, (∃ i, ∃ (_ : 0 < i), ∃ y_1 ∈ s, i • y_1 = y) → ∃ i, ∃ (_ : 0 < i), ∃ y_1 ∈ s, i • y_1 = x + y

Next tactic:
rintro _ ⟨cx, cx_pos, x, hx, rfl⟩ _ ⟨cy, cy_pos, y, hy, rfl⟩
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
    exact ⟨c * c', mul_pos c_pos c'_pos, x, hx, (smul_smul _ _ _).symm⟩
  · rintro _ ⟨cx, cx_pos, x, hx, rfl⟩ _ ⟨cy, cy_pos, y, hy, rfl⟩
    

Proof state:
case add_mem'.intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
cx : 𝕜
cx_pos : 0 < cx
x : E
hx : x ∈ s
cy : 𝕜
cy_pos : 0 < cy
y : E
hy : y ∈ s
⊢ ∃ i, ∃ (_ : 0 < i), ∃ y_1 ∈ s, i • y_1 = cx • x + cy • y

Next tactic:
have : 0 < cx + cy := add_pos cx_pos cy_pos
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
    exact ⟨c * c', mul_pos c_pos c'_pos, x, hx, (smul_smul _ _ _).symm⟩
  · rintro _ ⟨cx, cx_pos, x, hx, rfl⟩ _ ⟨cy, cy_pos, y, hy, rfl⟩
    have : 0 < cx + cy := add_pos cx_pos cy_pos
    

Proof state:
case add_mem'.intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
cx : 𝕜
cx_pos : 0 < cx
x : E
hx : x ∈ s
cy : 𝕜
cy_pos : 0 < cy
y : E
hy : y ∈ s
this : 0 < cx + cy
⊢ ∃ i, ∃ (_ : 0 < i), ∃ y_1 ∈ s, i • y_1 = cx • x + cy • y

Next tactic:
refine' ⟨_, this, _, convex_iff_div.1 hs hx hy cx_pos.le cy_pos.le this, _⟩
/-- The set of vectors proportional to those in a convex set forms a convex cone. -/
def toCone (s : Set E) (hs : Convex 𝕜 s) : ConvexCone 𝕜 E := by
  apply ConvexCone.mk (⋃ (c : 𝕜) (_ : 0 < c), c • s) <;> simp only [mem_iUnion, mem_smul_set]
  · rintro c c_pos _ ⟨c', c'_pos, x, hx, rfl⟩
    exact ⟨c * c', mul_pos c_pos c'_pos, x, hx, (smul_smul _ _ _).symm⟩
  · rintro _ ⟨cx, cx_pos, x, hx, rfl⟩ _ ⟨cy, cy_pos, y, hy, rfl⟩
    have : 0 < cx + cy := add_pos cx_pos cy_pos
    refine' ⟨_, this, _, convex_iff_div.1 hs hx hy cx_pos.le cy_pos.le this, _⟩
    

Proof state:
case add_mem'.intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
cx : 𝕜
cx_pos : 0 < cx
x : E
hx : x ∈ s
cy : 𝕜
cy_pos : 0 < cy
y : E
hy : y ∈ s
this : 0 < cx + cy
⊢ (cx + cy) • ((cx / (cx + cy)) • x + (cy / (cx + cy)) • y) = cx • x + cy • y

Next tactic:
simp only [smul_add, smul_smul, mul_div_assoc', mul_div_cancel_left _ this.ne']
theorem mem_toCone : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ ∃ y ∈ s, c • y = x := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
⊢ x ∈ toCone s hs ↔ ∃ c, 0 < c ∧ ∃ y ∈ s, c • y = x

Next tactic:
simp only [toCone, ConvexCone.mem_mk, mem_iUnion, mem_smul_set, eq_comm, exists_prop]
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
⊢ x ∈ toCone s hs ↔ ∃ c, 0 < c ∧ c • x ∈ s

Next tactic:
refine' hs.mem_toCone.trans ⟨_, _⟩
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · 

Proof state:
case refine'_1
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
⊢ (∃ c, 0 < c ∧ ∃ y ∈ s, c • y = x) → ∃ c, 0 < c ∧ c • x ∈ s

Next tactic:
rintro ⟨c, hc, y, hy, rfl⟩
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · rintro ⟨c, hc, y, hy, rfl⟩
    

Proof state:
case refine'_1.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
c : 𝕜
hc : 0 < c
y : E
hy : y ∈ s
⊢ ∃ c_1, 0 < c_1 ∧ c_1 • c • y ∈ s

Next tactic:
exact ⟨c⁻¹, inv_pos.2 hc, by rwa [smul_smul, inv_mul_cancel hc.ne', one_smul]⟩
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · rintro ⟨c, hc, y, hy, rfl⟩
    exact ⟨c⁻¹, inv_pos.2 hc, by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
c : 𝕜
hc : 0 < c
y : E
hy : y ∈ s
⊢ c⁻¹ • c • y ∈ s

Next tactic:
rwa [smul_smul, inv_mul_cancel hc.ne', one_smul]
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · rintro ⟨c, hc, y, hy, rfl⟩
    exact ⟨c⁻¹, inv_pos.2 hc, by rwa [smul_smul, inv_mul_cancel hc.ne', one_smul]⟩
  · 

Proof state:
case refine'_2
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
⊢ (∃ c, 0 < c ∧ c • x ∈ s) → ∃ c, 0 < c ∧ ∃ y ∈ s, c • y = x

Next tactic:
rintro ⟨c, hc, hcx⟩
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · rintro ⟨c, hc, y, hy, rfl⟩
    exact ⟨c⁻¹, inv_pos.2 hc, by rwa [smul_smul, inv_mul_cancel hc.ne', one_smul]⟩
  · rintro ⟨c, hc, hcx⟩
    

Proof state:
case refine'_2.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
c : 𝕜
hc : 0 < c
hcx : c • x ∈ s
⊢ ∃ c, 0 < c ∧ ∃ y ∈ s, c • y = x

Next tactic:
exact ⟨c⁻¹, inv_pos.2 hc, _, hcx, by rw [smul_smul, inv_mul_cancel hc.ne', one_smul]⟩
theorem mem_toCone' : x ∈ hs.toCone s ↔ ∃ c : 𝕜, 0 < c ∧ c • x ∈ s := by
  refine' hs.mem_toCone.trans ⟨_, _⟩
  · rintro ⟨c, hc, y, hy, rfl⟩
    exact ⟨c⁻¹, inv_pos.2 hc, by rwa [smul_smul, inv_mul_cancel hc.ne', one_smul]⟩
  · rintro ⟨c, hc, hcx⟩
    exact ⟨c⁻¹, inv_pos.2 hc, _, hcx, by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
c : 𝕜
hc : 0 < c
hcx : c • x ∈ s
⊢ c⁻¹ • c • x = x

Next tactic:
rw [smul_smul, inv_mul_cancel hc.ne', one_smul]
theorem subset_toCone : s ⊆ hs.toCone s := fun x hx =>
  hs.mem_toCone'.2 ⟨1, zero_lt_one, by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x✝ x : E
hx : x ∈ s
⊢ 1 • x ∈ s

Next tactic:
rwa [one_smul]
/-- `hs.toCone s` is the least cone that includes `s`. -/
theorem toCone_isLeast : IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } (hs.toCone s) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
⊢ IsLeast {t | s ⊆ ↑t} (toCone s hs)

Next tactic:
refine' ⟨hs.subset_toCone, fun t ht x hx => _⟩
/-- `hs.toCone s` is the least cone that includes `s`. -/
theorem toCone_isLeast : IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } (hs.toCone s) := by
  refine' ⟨hs.subset_toCone, fun t ht x hx => _⟩
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x✝ : E
t : ConvexCone 𝕜 E
ht : t ∈ {t | s ⊆ ↑t}
x : E
hx : x ∈ toCone s hs
⊢ x ∈ t

Next tactic:
rcases hs.mem_toCone.1 hx with ⟨c, hc, y, hy, rfl⟩
/-- `hs.toCone s` is the least cone that includes `s`. -/
theorem toCone_isLeast : IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } (hs.toCone s) := by
  refine' ⟨hs.subset_toCone, fun t ht x hx => _⟩
  rcases hs.mem_toCone.1 hx with ⟨c, hc, y, hy, rfl⟩
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
hs : Convex 𝕜 s
x : E
t : ConvexCone 𝕜 E
ht : t ∈ {t | s ⊆ ↑t}
c : 𝕜
hc : 0 < c
y : E
hy : y ∈ s
hx : c • y ∈ toCone s hs
⊢ c • y ∈ t

Next tactic:
exact t.smul_mem hc (ht hy)
theorem convexHull_toCone_isLeast (s : Set E) :
    IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } ((convex_convexHull 𝕜 s).toCone _) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
⊢ IsLeast {t | s ⊆ ↑t} (Convex.toCone ((convexHull 𝕜) s) (_ : Convex 𝕜 ((convexHull 𝕜) s)))

Next tactic:
convert (convex_convexHull 𝕜 s).toCone_isLeast using 1
theorem convexHull_toCone_isLeast (s : Set E) :
    IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } ((convex_convexHull 𝕜 s).toCone _) := by
  convert (convex_convexHull 𝕜 s).toCone_isLeast using 1
  

Proof state:
case h.e'_3
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
⊢ {t | s ⊆ ↑t} = {t | (convexHull 𝕜) s ⊆ ↑t}

Next tactic:
ext t
theorem convexHull_toCone_isLeast (s : Set E) :
    IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } ((convex_convexHull 𝕜 s).toCone _) := by
  convert (convex_convexHull 𝕜 s).toCone_isLeast using 1
  ext t
  

Proof state:
case h.e'_3.h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
t : ConvexCone 𝕜 E
⊢ t ∈ {t | s ⊆ ↑t} ↔ t ∈ {t | (convexHull 𝕜) s ⊆ ↑t}

Next tactic:
exact ⟨fun h => convexHull_min h t.convex, (subset_convexHull 𝕜 s).trans⟩
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
⊢ ∀ (s : Set ℤ) (a : ℤ), BddAbove s → a ∈ s → a ≤ sSup s

Next tactic:
intro s n hs hns
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
s : Set ℤ
n : ℤ
hs : BddAbove s
hns : n ∈ s
⊢ n ≤ sSup s

Next tactic:
have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
      -- Porting note: this was `rw [dif_pos this]`
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
s : Set ℤ
n : ℤ
hs : BddAbove s
hns : n ∈ s
this : Set.Nonempty s ∧ BddAbove s
⊢ n ≤ sSup s

Next tactic:
simp only [this, and_self, dite_true, ge_iff_le]
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
      -- Porting note: this was `rw [dif_pos this]`
      simp only [this, and_self, dite_true, ge_iff_le]
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
s : Set ℤ
n : ℤ
hs : BddAbove s
hns : n ∈ s
this : Set.Nonempty s ∧ BddAbove s
⊢ n ≤ ↑(greatestOfBdd (choose (_ : BddAbove s)) (_ : choose (_ : BddAbove s) ∈ upperBounds s) (_ : Set.Nonempty s))

Next tactic:
exact (greatestOfBdd _ _ _).2.2 n hns
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
      -- Porting note: this was `rw [dif_pos this]`
      simp only [this, and_self, dite_true, ge_iff_le]
      exact (greatestOfBdd _ _ _).2.2 n hns
    csSup_le := by
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
⊢ ∀ (s : Set ℤ) (a : ℤ), Set.Nonempty s → a ∈ upperBounds s → sSup s ≤ a

Next tactic:
intro s n hs hns
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
      -- Porting note: this was `rw [dif_pos this]`
      simp only [this, and_self, dite_true, ge_iff_le]
      exact (greatestOfBdd _ _ _).2.2 n hns
    csSup_le := by
      intro s n hs hns
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
s : Set ℤ
n : ℤ
hs : Set.Nonempty s
hns : n ∈ upperBounds s
⊢ sSup s ≤ n

Next tactic:
have : s.Nonempty ∧ BddAbove s := ⟨hs, ⟨n, hns⟩⟩
instance : ConditionallyCompleteLinearOrder ℤ :=
  { Int.linearOrderedCommRing,
    LinearOrder.toLattice with
    sSup := fun s =>
      if h : s.Nonempty ∧ BddAbove s then
        greatestOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    sInf := fun s =>
      if h : s.Nonempty ∧ BddBelow s then
        leastOfBdd (Classical.choose h.2) (Classical.choose_spec h.2) h.1
      else 0
    le_csSup := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨⟨n, hns⟩, hs⟩
      -- Porting note: this was `rw [dif_pos this]`
      simp only [this, and_self, dite_true, ge_iff_le]
      exact (greatestOfBdd _ _ _).2.2 n hns
    csSup_le := by
      intro s n hs hns
      have : s.Nonempty ∧ BddAbove s := ⟨hs, ⟨n, hns⟩⟩
      -- Porting note: this was `rw [dif_pos this]`
      

Proof state:
src✝¹ : LinearOrderedCommRing ℤ := linearOrderedCommRing
src✝ : Lattice ℤ := LinearOrder.toLattice
s : Set ℤ
n : ℤ
hs : Set.Nonempty s
hns : n ∈ upperBounds s
this : Set.Nonempty s ∧ BddAbove s
⊢ sSup s ≤ n

Next tactic:
simp only [this, and_self, dite_true, ge_iff_le]