l3lab/ntp-mathlib huggingface dataset:
/-- Evidence that the proposed colimit is the colimit. -/
def colimitIsColimit : IsColimit (colimitCocone F) where
  desc s := descMorphism F s
  uniq s m w := RingHom.ext fun x => by
    change (colimitCocone F).pt →+* s.pt at m
    refine Quot.inductionOn x ?_
    intro x
    induction x with
    | zero => erw [quot_zero, map_zero (f := m), (descMorphism F s).map_zero]
    | one => erw [quot_one, map_one (f := m), (descMorphism F s).map_one]
    -- extra rfl with leanprover/lean4#2644
    | neg x ih => erw [quot_neg, map_neg (f := m), (descMorphism F s).map_neg, ih]; rfl
    | of j x =>
      exact congr_fun (congr_arg (fun f : F.obj j ⟶ s.pt => (f : F.obj j → s.pt)) (w j)) x
    | add x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        erw [quot_add, map_add (f := m), (descMorphism F s).map_add, ih_x, ih_y]; rfl
    

Proof state:
case mul
J : Type v
inst✝ : SmallCategory J
F : J ⥤ CommRingCat
s : Cocone F
x✝ : ↑(colimitCocone F).pt
m : ↑(colimitCocone F).pt →+* ↑s.pt
w : ∀ (j : J), (colimitCocone F).ι.app j ≫ m = s.ι.app j
x y : Prequotient F
ih_x : m (Quot.mk Setoid.r x) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r x)
ih_y : m (Quot.mk Setoid.r y) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r y)
⊢ m (Quot.mk Setoid.r (mul x y)) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r (mul x y))

Next tactic:
| mul x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        erw [quot_mul, map_mul (f := m), (descMorphism F s).map_mul, ih_x, ih_y]; rfl
/-- Evidence that the proposed colimit is the colimit. -/
def colimitIsColimit : IsColimit (colimitCocone F) where
  desc s := descMorphism F s
  uniq s m w := RingHom.ext fun x => by
    change (colimitCocone F).pt →+* s.pt at m
    refine Quot.inductionOn x ?_
    intro x
    induction x with
    | zero => erw [quot_zero, map_zero (f := m), (descMorphism F s).map_zero]
    | one => erw [quot_one, map_one (f := m), (descMorphism F s).map_one]
    -- extra rfl with leanprover/lean4#2644
    | neg x ih => erw [quot_neg, map_neg (f := m), (descMorphism F s).map_neg, ih]; rfl
    | of j x =>
      exact congr_fun (congr_arg (fun f : F.obj j ⟶ s.pt => (f : F.obj j → s.pt)) (w j)) x
    | add x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        erw [quot_add, map_add (f := m), (descMorphism F s).map_add, ih_x, ih_y]; rfl
    | mul x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        

Proof state:
case mul
J : Type v
inst✝ : SmallCategory J
F : J ⥤ CommRingCat
s : Cocone F
x✝ : ↑(colimitCocone F).pt
m : ↑(colimitCocone F).pt →+* ↑s.pt
w : ∀ (j : J), (colimitCocone F).ι.app j ≫ m = s.ι.app j
x y : Prequotient F
ih_x : m (Quot.mk Setoid.r x) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r x)
ih_y : m (Quot.mk Setoid.r y) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r y)
⊢ m (Quot.mk Setoid.r (mul x y)) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r (mul x y))

Next tactic:
erw [quot_mul, map_mul (f := m), (descMorphism F s).map_mul, ih_x, ih_y]
/-- Evidence that the proposed colimit is the colimit. -/
def colimitIsColimit : IsColimit (colimitCocone F) where
  desc s := descMorphism F s
  uniq s m w := RingHom.ext fun x => by
    change (colimitCocone F).pt →+* s.pt at m
    refine Quot.inductionOn x ?_
    intro x
    induction x with
    | zero => erw [quot_zero, map_zero (f := m), (descMorphism F s).map_zero]
    | one => erw [quot_one, map_one (f := m), (descMorphism F s).map_one]
    -- extra rfl with leanprover/lean4#2644
    | neg x ih => erw [quot_neg, map_neg (f := m), (descMorphism F s).map_neg, ih]; rfl
    | of j x =>
      exact congr_fun (congr_arg (fun f : F.obj j ⟶ s.pt => (f : F.obj j → s.pt)) (w j)) x
    | add x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        erw [quot_add, map_add (f := m), (descMorphism F s).map_add, ih_x, ih_y]; rfl
    | mul x y ih_x ih_y =>
    -- extra rfl with leanprover/lean4#2644
        erw [quot_mul, map_mul (f := m), (descMorphism F s).map_mul, ih_x, ih_y]; 

Proof state:
case mul
J : Type v
inst✝ : SmallCategory J
F : J ⥤ CommRingCat
s : Cocone F
x✝ : ↑(colimitCocone F).pt
m : ↑(colimitCocone F).pt →+* ↑s.pt
w : ∀ (j : J), (colimitCocone F).ι.app j ≫ m = s.ι.app j
x y : Prequotient F
ih_x : m (Quot.mk Setoid.r x) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r x)
ih_y : m (Quot.mk Setoid.r y) = ((fun s => descMorphism F s) s) (Quot.mk Setoid.r y)
⊢ ((fun s => descMorphism F s) s) (Quot.mk Setoid.r x) * ((fun s => descMorphism F s) s) (Quot.mk Setoid.r y) =
    (descMorphism F s) (Quot.mk Setoid.r x) * (descMorphism F s) (Quot.mk Setoid.r y)

Next tactic:
rfl
instance : SetLike (ConvexCone 𝕜 E) E where
  coe := carrier
  coe_injective' S T h := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S✝ T✝ S T : ConvexCone 𝕜 E
h : S.carrier = T.carrier
⊢ S = T

Next tactic:
cases S
instance : SetLike (ConvexCone 𝕜 E) E where
  coe := carrier
  coe_injective' S T h := by cases S; 

Proof state:
case mk
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S T✝ T : ConvexCone 𝕜 E
carrier✝ : Set E
smul_mem'✝ : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ carrier✝ → c • x ∈ carrier✝
add_mem'✝ : ∀ ⦃x : E⦄, x ∈ carrier✝ → ∀ ⦃y : E⦄, y ∈ carrier✝ → x + y ∈ carrier✝
h : { carrier := carrier✝, smul_mem' := smul_mem'✝, add_mem' := add_mem'✝ }.carrier = T.carrier
⊢ { carrier := carrier✝, smul_mem' := smul_mem'✝, add_mem' := add_mem'✝ } = T

Next tactic:
cases T
instance : SetLike (ConvexCone 𝕜 E) E where
  coe := carrier
  coe_injective' S T h := by cases S; cases T; 

Proof state:
case mk.mk
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S T : ConvexCone 𝕜 E
carrier✝¹ : Set E
smul_mem'✝¹ : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ carrier✝¹ → c • x ∈ carrier✝¹
add_mem'✝¹ : ∀ ⦃x : E⦄, x ∈ carrier✝¹ → ∀ ⦃y : E⦄, y ∈ carrier✝¹ → x + y ∈ carrier✝¹
carrier✝ : Set E
smul_mem'✝ : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ carrier✝ → c • x ∈ carrier✝
add_mem'✝ : ∀ ⦃x : E⦄, x ∈ carrier✝ → ∀ ⦃y : E⦄, y ∈ carrier✝ → x + y ∈ carrier✝
h :
  { carrier := carrier✝¹, smul_mem' := smul_mem'✝¹, add_mem' := add_mem'✝¹ }.carrier =
    { carrier := carrier✝, smul_mem' := smul_mem'✝, add_mem' := add_mem'✝ }.carrier
⊢ { carrier := carrier✝¹, smul_mem' := smul_mem'✝¹, add_mem' := add_mem'✝¹ } =
    { carrier := carrier✝, smul_mem' := smul_mem'✝, add_mem' := add_mem'✝ }

Next tactic:
congr
@[simp]
theorem coe_iInf {ι : Sort*} (f : ι → ConvexCone 𝕜 E) : ↑(iInf f) = ⋂ i, (f i : Set E) := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S T : ConvexCone 𝕜 E
ι : Sort u_5
f : ι → ConvexCone 𝕜 E
⊢ ↑(iInf f) = ⋂ i, ↑(f i)

Next tactic:
simp [iInf]
theorem mem_iInf {ι : Sort*} {x : E} {f : ι → ConvexCone 𝕜 E} : x ∈ iInf f ↔ ∀ i, x ∈ f i :=
  mem_iInter₂.trans <| by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S T : ConvexCone 𝕜 E
ι : Sort u_5
x : E
f : ι → ConvexCone 𝕜 E
⊢ (∀ i ∈ Set.range f, x ∈ ↑i) ↔ ∀ (i : ι), x ∈ f i

Next tactic:
simp
/-- The preimage of a convex cone under a `𝕜`-linear map is a convex cone. -/
def comap (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 F) : ConvexCone 𝕜 E where
  carrier := f ⁻¹' S
  smul_mem' c hc x hx := by
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁷ : OrderedSemiring 𝕜
inst✝⁶ inst✝⁵ : AddCommMonoid E
inst✝⁴ : AddCommMonoid F
inst✝³ : AddCommMonoid G
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 F
inst✝ : Module 𝕜 G
f : E →ₗ[𝕜] F
S : ConvexCone 𝕜 F
c : 𝕜
hc : 0 < c
x : E
hx : x ∈ ⇑f ⁻¹' ↑S
⊢ c • x ∈ ⇑f ⁻¹' ↑S

Next tactic:
rw [mem_preimage, f.map_smul c]
/-- The preimage of a convex cone under a `𝕜`-linear map is a convex cone. -/
def comap (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 F) : ConvexCone 𝕜 E where
  carrier := f ⁻¹' S
  smul_mem' c hc x hx := by
    rw [mem_preimage, f.map_smul c]
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁷ : OrderedSemiring 𝕜
inst✝⁶ inst✝⁵ : AddCommMonoid E
inst✝⁴ : AddCommMonoid F
inst✝³ : AddCommMonoid G
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 F
inst✝ : Module 𝕜 G
f : E →ₗ[𝕜] F
S : ConvexCone 𝕜 F
c : 𝕜
hc : 0 < c
x : E
hx : x ∈ ⇑f ⁻¹' ↑S
⊢ c • f x ∈ ↑S

Next tactic:
exact S.smul_mem hc hx
/-- The preimage of a convex cone under a `𝕜`-linear map is a convex cone. -/
def comap (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 F) : ConvexCone 𝕜 E where
  carrier := f ⁻¹' S
  smul_mem' c hc x hx := by
    rw [mem_preimage, f.map_smul c]
    exact S.smul_mem hc hx
  add_mem' x hx y hy := by
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁷ : OrderedSemiring 𝕜
inst✝⁶ inst✝⁵ : AddCommMonoid E
inst✝⁴ : AddCommMonoid F
inst✝³ : AddCommMonoid G
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 F
inst✝ : Module 𝕜 G
f : E →ₗ[𝕜] F
S : ConvexCone 𝕜 F
x : E
hx : x ∈ ⇑f ⁻¹' ↑S
y : E
hy : y ∈ ⇑f ⁻¹' ↑S
⊢ x + y ∈ ⇑f ⁻¹' ↑S

Next tactic:
rw [mem_preimage, f.map_add]
/-- The preimage of a convex cone under a `𝕜`-linear map is a convex cone. -/
def comap (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 F) : ConvexCone 𝕜 E where
  carrier := f ⁻¹' S
  smul_mem' c hc x hx := by
    rw [mem_preimage, f.map_smul c]
    exact S.smul_mem hc hx
  add_mem' x hx y hy := by
    rw [mem_preimage, f.map_add]
    

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝⁷ : OrderedSemiring 𝕜
inst✝⁶ inst✝⁵ : AddCommMonoid E
inst✝⁴ : AddCommMonoid F
inst✝³ : AddCommMonoid G
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 F
inst✝ : Module 𝕜 G
f : E →ₗ[𝕜] F
S : ConvexCone 𝕜 F
x : E
hx : x ∈ ⇑f ⁻¹' ↑S
y : E
hy : y ∈ ⇑f ⁻¹' ↑S
⊢ f x + f y ∈ ↑S

Next tactic:
exact S.add_mem hx hy
/-- Constructs an ordered module given an `OrderedAddCommGroup`, a cone, and a proof that
the order relation is the one defined by the cone.
-/
theorem to_orderedSMul (S : ConvexCone 𝕜 E) (h : ∀ x y : E, x ≤ y ↔ y - x ∈ S) : OrderedSMul 𝕜 E :=
  OrderedSMul.mk'
    (by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : OrderedAddCommGroup E
inst✝ : Module 𝕜 E
S : ConvexCone 𝕜 E
h : ∀ (x y : E), x ≤ y ↔ y - x ∈ S
⊢ ∀ ⦃a b : E⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b

Next tactic:
intro x y z xy hz
/-- Constructs an ordered module given an `OrderedAddCommGroup`, a cone, and a proof that
the order relation is the one defined by the cone.
-/
theorem to_orderedSMul (S : ConvexCone 𝕜 E) (h : ∀ x y : E, x ≤ y ↔ y - x ∈ S) : OrderedSMul 𝕜 E :=
  OrderedSMul.mk'
    (by
      intro x y z xy hz
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : OrderedAddCommGroup E
inst✝ : Module 𝕜 E
S : ConvexCone 𝕜 E
h : ∀ (x y : E), x ≤ y ↔ y - x ∈ S
x y : E
z : 𝕜
xy : x < y
hz : 0 < z
⊢ z • x ≤ z • y

Next tactic:
rw [h (z • x) (z • y), ← smul_sub z y x]
/-- Constructs an ordered module given an `OrderedAddCommGroup`, a cone, and a proof that
the order relation is the one defined by the cone.
-/
theorem to_orderedSMul (S : ConvexCone 𝕜 E) (h : ∀ x y : E, x ≤ y ↔ y - x ∈ S) : OrderedSMul 𝕜 E :=
  OrderedSMul.mk'
    (by
      intro x y z xy hz
      rw [h (z • x) (z • y), ← smul_sub z y x]
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : LinearOrderedField 𝕜
inst✝¹ : OrderedAddCommGroup E
inst✝ : Module 𝕜 E
S : ConvexCone 𝕜 E
h : ∀ (x y : E), x ≤ y ↔ y - x ∈ S
x y : E
z : 𝕜
xy : x < y
hz : 0 < z
⊢ z • (y - x) ∈ S

Next tactic:
exact smul_mem S hz ((h x y).mp xy.le)
theorem blunt_iff_not_pointed (S : ConvexCone 𝕜 E) : S.Blunt ↔ ¬S.Pointed := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommMonoid E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
⊢ Blunt S ↔ ¬Pointed S

Next tactic:
rw [pointed_iff_not_blunt, Classical.not_not]
theorem salient_iff_not_flat (S : ConvexCone 𝕜 E) : S.Salient ↔ ¬S.Flat := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
⊢ Salient S ↔ ¬Flat S

Next tactic:
simp [Salient, Flat]
/-- A flat cone is always pointed (contains `0`). -/
theorem Flat.pointed {S : ConvexCone 𝕜 E} (hS : S.Flat) : S.Pointed := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
hS : Flat S
⊢ Pointed S

Next tactic:
obtain ⟨x, hx, _, hxneg⟩ := hS
/-- A flat cone is always pointed (contains `0`). -/
theorem Flat.pointed {S : ConvexCone 𝕜 E} (hS : S.Flat) : S.Pointed := by
  obtain ⟨x, hx, _, hxneg⟩ := hS
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
x : E
hx : x ∈ S
left✝ : x ≠ 0
hxneg : -x ∈ S
⊢ Pointed S

Next tactic:
rw [Pointed, ← add_neg_self x]
/-- A flat cone is always pointed (contains `0`). -/
theorem Flat.pointed {S : ConvexCone 𝕜 E} (hS : S.Flat) : S.Pointed := by
  obtain ⟨x, hx, _, hxneg⟩ := hS
  rw [Pointed, ← add_neg_self x]
  

Proof state:
case intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
x : E
hx : x ∈ S
left✝ : x ≠ 0
hxneg : -x ∈ S
⊢ x + -x ∈ S

Next tactic:
exact add_mem S hx hxneg
/-- A blunt cone (one not containing `0`) is always salient. -/
theorem Blunt.salient {S : ConvexCone 𝕜 E} : S.Blunt → S.Salient := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
⊢ Blunt S → Salient S

Next tactic:
rw [salient_iff_not_flat, blunt_iff_not_pointed]
/-- A blunt cone (one not containing `0`) is always salient. -/
theorem Blunt.salient {S : ConvexCone 𝕜 E} : S.Blunt → S.Salient := by
  rw [salient_iff_not_flat, blunt_iff_not_pointed]
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S✝ S : ConvexCone 𝕜 E
⊢ ¬Pointed S → ¬Flat S

Next tactic:
exact mt Flat.pointed
/-- A pointed convex cone defines a preorder. -/
def toPreorder (h₁ : S.Pointed) : Preorder E where
  le x y := y - x ∈ S
  le_refl x := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
x : E
⊢ x ≤ x

Next tactic:
change x - x ∈ S
/-- A pointed convex cone defines a preorder. -/
def toPreorder (h₁ : S.Pointed) : Preorder E where
  le x y := y - x ∈ S
  le_refl x := by change x - x ∈ S; 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
x : E
⊢ x - x ∈ S

Next tactic:
rw [sub_self x]
/-- A pointed convex cone defines a preorder. -/
def toPreorder (h₁ : S.Pointed) : Preorder E where
  le x y := y - x ∈ S
  le_refl x := by change x - x ∈ S; rw [sub_self x]; 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
x : E
⊢ 0 ∈ S

Next tactic:
exact h₁
/-- A pointed convex cone defines a preorder. -/
def toPreorder (h₁ : S.Pointed) : Preorder E where
  le x y := y - x ∈ S
  le_refl x := by change x - x ∈ S; rw [sub_self x]; exact h₁
  le_trans x y z xy zy := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
x y z : E
xy : x ≤ y
zy : y ≤ z
⊢ x ≤ z

Next tactic:
simpa using add_mem S zy xy
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
⊢ ∀ (a b : E), a ≤ b → b ≤ a → a = b

Next tactic:
intro a b ab ba
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      intro a b ab ba
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
a b : E
ab : a ≤ b
ba : b ≤ a
⊢ a = b

Next tactic:
by_contra h
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      intro a b ab ba
      by_contra h
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
a b : E
ab : a ≤ b
ba : b ≤ a
h : ¬a = b
⊢ False

Next tactic:
have h' : b - a ≠ 0 := fun h'' => h (eq_of_sub_eq_zero h'').symm
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      intro a b ab ba
      by_contra h
      have h' : b - a ≠ 0 := fun h'' => h (eq_of_sub_eq_zero h'').symm
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
a b : E
ab : a ≤ b
ba : b ≤ a
h : ¬a = b
h' : b - a ≠ 0
⊢ False

Next tactic:
have H := h₂ (b - a) ab h'
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      intro a b ab ba
      by_contra h
      have h' : b - a ≠ 0 := fun h'' => h (eq_of_sub_eq_zero h'').symm
      have H := h₂ (b - a) ab h'
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
a b : E
ab : a ≤ b
ba : b ≤ a
h : ¬a = b
h' : b - a ≠ 0
H : -(b - a) ∉ S
⊢ False

Next tactic:
rw [neg_sub b a] at H
/-- A pointed and salient cone defines a partial order. -/
def toPartialOrder (h₁ : S.Pointed) (h₂ : S.Salient) : PartialOrder E :=
  { toPreorder S h₁ with
    le_antisymm := by
      intro a b ab ba
      by_contra h
      have h' : b - a ≠ 0 := fun h'' => h (eq_of_sub_eq_zero h'').symm
      have H := h₂ (b - a) ab h'
      rw [neg_sub b a] at H
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : Preorder E := toPreorder S h₁
a b : E
ab : a ≤ b
ba : b ≤ a
h : ¬a = b
h' : b - a ≠ 0
H : a - b ∉ S
⊢ False

Next tactic:
exact H ba
/-- A pointed and salient cone defines an `OrderedAddCommGroup`. -/
def toOrderedAddCommGroup (h₁ : S.Pointed) (h₂ : S.Salient) : OrderedAddCommGroup E :=
  { toPartialOrder S h₁ h₂, show AddCommGroup E by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝ : PartialOrder E := toPartialOrder S h₁ h₂
⊢ AddCommGroup E

Next tactic:
infer_instance
/-- A pointed and salient cone defines an `OrderedAddCommGroup`. -/
def toOrderedAddCommGroup (h₁ : S.Pointed) (h₂ : S.Salient) : OrderedAddCommGroup E :=
  { toPartialOrder S h₁ h₂, show AddCommGroup E by infer_instance with
    add_le_add_left := by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝¹ : PartialOrder E := toPartialOrder S h₁ h₂
src✝ : AddCommGroup E :=
  let_fun this := inferInstance;
  this
⊢ ∀ (a b : E), a ≤ b → ∀ (c : E), c + a ≤ c + b

Next tactic:
intro a b hab c
/-- A pointed and salient cone defines an `OrderedAddCommGroup`. -/
def toOrderedAddCommGroup (h₁ : S.Pointed) (h₂ : S.Salient) : OrderedAddCommGroup E :=
  { toPartialOrder S h₁ h₂, show AddCommGroup E by infer_instance with
    add_le_add_left := by
      intro a b hab c
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝¹ : PartialOrder E := toPartialOrder S h₁ h₂
src✝ : AddCommGroup E :=
  let_fun this := inferInstance;
  this
a b : E
hab : a ≤ b
c : E
⊢ c + a ≤ c + b

Next tactic:
change c + b - (c + a) ∈ S
/-- A pointed and salient cone defines an `OrderedAddCommGroup`. -/
def toOrderedAddCommGroup (h₁ : S.Pointed) (h₂ : S.Salient) : OrderedAddCommGroup E :=
  { toPartialOrder S h₁ h₂, show AddCommGroup E by infer_instance with
    add_le_add_left := by
      intro a b hab c
      change c + b - (c + a) ∈ S
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝¹ : PartialOrder E := toPartialOrder S h₁ h₂
src✝ : AddCommGroup E :=
  let_fun this := inferInstance;
  this
a b : E
hab : a ≤ b
c : E
⊢ c + b - (c + a) ∈ S

Next tactic:
rw [add_sub_add_left_eq_sub]
/-- A pointed and salient cone defines an `OrderedAddCommGroup`. -/
def toOrderedAddCommGroup (h₁ : S.Pointed) (h₂ : S.Salient) : OrderedAddCommGroup E :=
  { toPartialOrder S h₁ h₂, show AddCommGroup E by infer_instance with
    add_le_add_left := by
      intro a b hab c
      change c + b - (c + a) ∈ S
      rw [add_sub_add_left_eq_sub]
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
inst✝² : OrderedSemiring 𝕜
inst✝¹ : AddCommGroup E
inst✝ : SMul 𝕜 E
S : ConvexCone 𝕜 E
h₁ : Pointed S
h₂ : Salient S
src✝¹ : PartialOrder E := toPartialOrder S h₁ h₂
src✝ : AddCommGroup E :=
  let_fun this := inferInstance;
  this
a b : E
hab : a ≤ b
c : E
⊢ b - a ∈ S

Next tactic:
exact hab
instance : Zero (ConvexCone 𝕜 E) :=
  ⟨⟨0, fun _ _ => 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✝¹ : 𝕜
x✝ : 0 < x✝¹
⊢ ∀ ⦃x : E⦄, x ∈ 0 → x✝¹ • x ∈ 0

Next tactic:
simp
instance : Zero (ConvexCone 𝕜 E) :=
  ⟨⟨0, fun _ _ => by simp, fun _ => 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✝ : E
⊢ x✝ ∈ 0 → ∀ ⦃y : E⦄, y ∈ 0 → x✝ + y ∈ 0

Next tactic:
simp
theorem pointed_zero : (0 : ConvexCone 𝕜 E).Pointed := 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
⊢ Pointed 0

Next tactic:
rw [Pointed, mem_zero]
instance instAdd : Add (ConvexCone 𝕜 E) :=
  ⟨fun K₁ K₂ =>
    { carrier := { z | ∃ x y : E, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z }
      smul_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
⊢ ∀ ⦃c : 𝕜⦄,
    0 < c → ∀ ⦃x : E⦄, x ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z} → c • x ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z}

Next tactic:
rintro c hc _ ⟨x, y, hx, 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⟩
        

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 + y) ∈ {z | ∃ x y, x ∈ K₁ ∧ y ∈ K₂ ∧ x + y = z}

Next tactic:
rw [smul_add]