l3lab/ntp-mathlib huggingface dataset:
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s := by
  ext x
  simp_rw [Set.mem_iInter, Set.mem_setOf_eq]
  refine' ⟨fun h r hr => _, fun h => le_of_forall_pos_lt_add fun ε hε => _⟩
  · have hr' := ha.trans_lt hr
    rw [mem_smul_set_iff_inv_smul_mem₀ hr'.ne']
    obtain ⟨δ, δ_pos, hδr, hδ⟩ := exists_lt_of_gauge_lt hs₂ (h.trans_lt hr)
    suffices (r⁻¹ * δ) • δ⁻¹ • x ∈ s by rwa [smul_smul, mul_inv_cancel_right₀ δ_pos.ne'] at this
    rw [mem_smul_set_iff_inv_smul_mem₀ δ_pos.ne'] at hδ
    refine' hs₁.smul_mem_of_zero_mem hs₀ hδ ⟨by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₁ : Convex ℝ s
hs₀ : 0 ∈ s
hs₂ : Absorbent ℝ s
ha : 0 ≤ a
x : E
h : gauge s x ≤ a
r : ℝ
hr : a < r
hr' : 0 < r
δ : ℝ
δ_pos : 0 < δ
hδr : δ < r
hδ : δ⁻¹ • x ∈ s
⊢ 0 ≤ r⁻¹ * δ

Next tactic:
positivity
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s := by
  ext x
  simp_rw [Set.mem_iInter, Set.mem_setOf_eq]
  refine' ⟨fun h r hr => _, fun h => le_of_forall_pos_lt_add fun ε hε => _⟩
  · have hr' := ha.trans_lt hr
    rw [mem_smul_set_iff_inv_smul_mem₀ hr'.ne']
    obtain ⟨δ, δ_pos, hδr, hδ⟩ := exists_lt_of_gauge_lt hs₂ (h.trans_lt hr)
    suffices (r⁻¹ * δ) • δ⁻¹ • x ∈ s by rwa [smul_smul, mul_inv_cancel_right₀ δ_pos.ne'] at this
    rw [mem_smul_set_iff_inv_smul_mem₀ δ_pos.ne'] at hδ
    refine' hs₁.smul_mem_of_zero_mem hs₀ hδ ⟨by positivity, _⟩
    

Proof state:
case h.refine'_1.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₁ : Convex ℝ s
hs₀ : 0 ∈ s
hs₂ : Absorbent ℝ s
ha : 0 ≤ a
x : E
h : gauge s x ≤ a
r : ℝ
hr : a < r
hr' : 0 < r
δ : ℝ
δ_pos : 0 < δ
hδr : δ < r
hδ : δ⁻¹ • x ∈ s
⊢ r⁻¹ * δ ≤ 1

Next tactic:
rw [inv_mul_le_iff hr', mul_one]
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s := by
  ext x
  simp_rw [Set.mem_iInter, Set.mem_setOf_eq]
  refine' ⟨fun h r hr => _, fun h => le_of_forall_pos_lt_add fun ε hε => _⟩
  · have hr' := ha.trans_lt hr
    rw [mem_smul_set_iff_inv_smul_mem₀ hr'.ne']
    obtain ⟨δ, δ_pos, hδr, hδ⟩ := exists_lt_of_gauge_lt hs₂ (h.trans_lt hr)
    suffices (r⁻¹ * δ) • δ⁻¹ • x ∈ s by rwa [smul_smul, mul_inv_cancel_right₀ δ_pos.ne'] at this
    rw [mem_smul_set_iff_inv_smul_mem₀ δ_pos.ne'] at hδ
    refine' hs₁.smul_mem_of_zero_mem hs₀ hδ ⟨by positivity, _⟩
    rw [inv_mul_le_iff hr', mul_one]
    

Proof state:
case h.refine'_1.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₁ : Convex ℝ s
hs₀ : 0 ∈ s
hs₂ : Absorbent ℝ s
ha : 0 ≤ a
x : E
h : gauge s x ≤ a
r : ℝ
hr : a < r
hr' : 0 < r
δ : ℝ
δ_pos : 0 < δ
hδr : δ < r
hδ : δ⁻¹ • x ∈ s
⊢ δ ≤ r

Next tactic:
exact hδr.le
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s := by
  ext x
  simp_rw [Set.mem_iInter, Set.mem_setOf_eq]
  refine' ⟨fun h r hr => _, fun h => le_of_forall_pos_lt_add fun ε hε => _⟩
  · have hr' := ha.trans_lt hr
    rw [mem_smul_set_iff_inv_smul_mem₀ hr'.ne']
    obtain ⟨δ, δ_pos, hδr, hδ⟩ := exists_lt_of_gauge_lt hs₂ (h.trans_lt hr)
    suffices (r⁻¹ * δ) • δ⁻¹ • x ∈ s by rwa [smul_smul, mul_inv_cancel_right₀ δ_pos.ne'] at this
    rw [mem_smul_set_iff_inv_smul_mem₀ δ_pos.ne'] at hδ
    refine' hs₁.smul_mem_of_zero_mem hs₀ hδ ⟨by positivity, _⟩
    rw [inv_mul_le_iff hr', mul_one]
    exact hδr.le
  · 

Proof state:
case h.refine'_2
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₁ : Convex ℝ s
hs₀ : 0 ∈ s
hs₂ : Absorbent ℝ s
ha : 0 ≤ a
x : E
h : ∀ (i : ℝ), a < i → x ∈ i • s
ε : ℝ
hε : 0 < ε
⊢ gauge s x < a + ε

Next tactic:
have hε' := (lt_add_iff_pos_right a).2 (half_pos hε)
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s := by
  ext x
  simp_rw [Set.mem_iInter, Set.mem_setOf_eq]
  refine' ⟨fun h r hr => _, fun h => le_of_forall_pos_lt_add fun ε hε => _⟩
  · have hr' := ha.trans_lt hr
    rw [mem_smul_set_iff_inv_smul_mem₀ hr'.ne']
    obtain ⟨δ, δ_pos, hδr, hδ⟩ := exists_lt_of_gauge_lt hs₂ (h.trans_lt hr)
    suffices (r⁻¹ * δ) • δ⁻¹ • x ∈ s by rwa [smul_smul, mul_inv_cancel_right₀ δ_pos.ne'] at this
    rw [mem_smul_set_iff_inv_smul_mem₀ δ_pos.ne'] at hδ
    refine' hs₁.smul_mem_of_zero_mem hs₀ hδ ⟨by positivity, _⟩
    rw [inv_mul_le_iff hr', mul_one]
    exact hδr.le
  · have hε' := (lt_add_iff_pos_right a).2 (half_pos hε)
    

Proof state:
case h.refine'_2
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₁ : Convex ℝ s
hs₀ : 0 ∈ s
hs₂ : Absorbent ℝ s
ha : 0 ≤ a
x : E
h : ∀ (i : ℝ), a < i → x ∈ i • s
ε : ℝ
hε : 0 < ε
hε' : a < a + ε / 2
⊢ gauge s x < a + ε

Next tactic:
exact
      (gauge_le_of_mem (ha.trans hε'.le) <| h _ hε').trans_lt (add_lt_add_left (half_lt_self hε) _)
theorem gauge_lt_eq' (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ (r : ℝ) (_ : 0 < r) (_ : r < a), r • s := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
⊢ {x | gauge s x < a} = ⋃ r, ⋃ (_ : 0 < r), ⋃ (_ : r < a), r • s

Next tactic:
ext
theorem gauge_lt_eq' (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ (r : ℝ) (_ : 0 < r) (_ : r < a), r • s := by
  ext
  

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
x✝ : E
⊢ x✝ ∈ {x | gauge s x < a} ↔ x✝ ∈ ⋃ r, ⋃ (_ : 0 < r), ⋃ (_ : r < a), r • s

Next tactic:
simp_rw [mem_setOf, mem_iUnion, exists_prop]
theorem gauge_lt_eq' (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ (r : ℝ) (_ : 0 < r) (_ : r < a), r • s := by
  ext
  simp_rw [mem_setOf, mem_iUnion, exists_prop]
  

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
x✝ : E
⊢ gauge s x✝ < a ↔ ∃ i, 0 < i ∧ i < a ∧ x✝ ∈ i • s

Next tactic:
exact
    ⟨exists_lt_of_gauge_lt absorbs, fun ⟨r, hr₀, hr₁, hx⟩ =>
      (gauge_le_of_mem hr₀.le hx).trans_lt hr₁⟩
theorem gauge_lt_eq (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ r ∈ Set.Ioo 0 (a : ℝ), r • s := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
⊢ {x | gauge s x < a} = ⋃ r ∈ Ioo 0 a, r • s

Next tactic:
ext
theorem gauge_lt_eq (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ r ∈ Set.Ioo 0 (a : ℝ), r • s := by
  ext
  

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
x✝ : E
⊢ x✝ ∈ {x | gauge s x < a} ↔ x✝ ∈ ⋃ r ∈ Ioo 0 a, r • s

Next tactic:
simp_rw [mem_setOf, mem_iUnion, exists_prop, mem_Ioo, and_assoc]
theorem gauge_lt_eq (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ r ∈ Set.Ioo 0 (a : ℝ), r • s := by
  ext
  simp_rw [mem_setOf, mem_iUnion, exists_prop, mem_Ioo, and_assoc]
  

Proof state:
case h
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
absorbs : Absorbent ℝ s
a : ℝ
x✝ : E
⊢ gauge s x✝ < a ↔ ∃ i, 0 < i ∧ i < a ∧ x✝ ∈ i • s

Next tactic:
exact
    ⟨exists_lt_of_gauge_lt absorbs, fun ⟨r, hr₀, hr₁, hx⟩ =>
      (gauge_le_of_mem hr₀.le hx).trans_lt hr₁⟩
theorem mem_openSegment_of_gauge_lt_one (absorbs : Absorbent ℝ s) (hgauge : gauge s x < 1) :
    ∃ y ∈ s, x ∈ openSegment ℝ 0 y := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
absorbs : Absorbent ℝ s
hgauge : gauge s x < 1
⊢ ∃ y ∈ s, x ∈ openSegment ℝ 0 y

Next tactic:
rcases exists_lt_of_gauge_lt absorbs hgauge with ⟨r, hr₀, hr₁, y, hy, rfl⟩
theorem mem_openSegment_of_gauge_lt_one (absorbs : Absorbent ℝ s) (hgauge : gauge s x < 1) :
    ∃ y ∈ s, x ∈ openSegment ℝ 0 y := by
  rcases exists_lt_of_gauge_lt absorbs hgauge with ⟨r, hr₀, hr₁, y, hy, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
absorbs : Absorbent ℝ s
r : ℝ
hr₀ : 0 < r
hr₁ : r < 1
y : E
hy : y ∈ s
hgauge : gauge s ((fun x => r • x) y) < 1
⊢ ∃ y_1 ∈ s, (fun x => r • x) y ∈ openSegment ℝ 0 y_1

Next tactic:
refine ⟨y, hy, 1 - r, r, ?_⟩
theorem mem_openSegment_of_gauge_lt_one (absorbs : Absorbent ℝ s) (hgauge : gauge s x < 1) :
    ∃ y ∈ s, x ∈ openSegment ℝ 0 y := by
  rcases exists_lt_of_gauge_lt absorbs hgauge with ⟨r, hr₀, hr₁, y, hy, rfl⟩
  refine ⟨y, hy, 1 - r, r, ?_⟩
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
absorbs : Absorbent ℝ s
r : ℝ
hr₀ : 0 < r
hr₁ : r < 1
y : E
hy : y ∈ s
hgauge : gauge s ((fun x => r • x) y) < 1
⊢ 0 < 1 - r ∧ 0 < r ∧ 1 - r + r = 1 ∧ (1 - r) • 0 + r • y = (fun x => r • x) y

Next tactic:
simp [*]
theorem gauge_le_one_of_mem {x : E} (hx : x ∈ s) : gauge s x ≤ 1 :=
  gauge_le_of_mem zero_le_one <| by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
hx : x ∈ s
⊢ x ∈ 1 • s

Next tactic:
rwa [one_smul]
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
x y : E
⊢ gauge s (x + y) ≤ gauge s x + gauge s y

Next tactic:
refine' le_of_forall_pos_lt_add fun ε hε => _
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
x y : E
ε : ℝ
hε : 0 < ε
⊢ gauge s (x + y) < gauge s x + gauge s y + ε

Next tactic:
obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
y : E
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
⊢ gauge s ((fun x => a • x) x + y) < gauge s ((fun x => a • x) x) + gauge s y + ε

Next tactic:
obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
b : ℝ
hb : 0 < b
y : E
hy : y ∈ s
hb' : b < gauge s ((fun x => b • x) y) + ε / 2
⊢ gauge s ((fun x => a • x) x + (fun x => b • x) y) < gauge s ((fun x => a • x) x) + gauge s ((fun x => b • x) y) + ε

Next tactic:
calc
    gauge s (a • x + b • y) ≤ a + b := gauge_le_of_mem (by positivity) <| by
      rw [hs.add_smul ha.le hb.le]
      exact add_mem_add (smul_mem_smul_set hx) (smul_mem_smul_set hy)
    _ < gauge s (a • x) + gauge s (b • y) + ε := by linarith
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
  calc
    gauge s (a • x + b • y) ≤ a + b := gauge_le_of_mem (by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
b : ℝ
hb : 0 < b
y : E
hy : y ∈ s
hb' : b < gauge s ((fun x => b • x) y) + ε / 2
⊢ 0 ≤ a + b

Next tactic:
positivity
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
  calc
    gauge s (a • x + b • y) ≤ a + b := gauge_le_of_mem (by positivity) <| by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
b : ℝ
hb : 0 < b
y : E
hy : y ∈ s
hb' : b < gauge s ((fun x => b • x) y) + ε / 2
⊢ a • x + b • y ∈ (a + b) • s

Next tactic:
rw [hs.add_smul ha.le hb.le]
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
  calc
    gauge s (a • x + b • y) ≤ a + b := gauge_le_of_mem (by positivity) <| by
      rw [hs.add_smul ha.le hb.le]
      

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
b : ℝ
hb : 0 < b
y : E
hy : y ∈ s
hb' : b < gauge s ((fun x => b • x) y) + ε / 2
⊢ a • x + b • y ∈ a • s + b • s

Next tactic:
exact add_mem_add (smul_mem_smul_set hx) (smul_mem_smul_set hy)
/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y := by
  refine' le_of_forall_pos_lt_add fun ε hε => _
  obtain ⟨a, ha, ha', x, hx, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s x) (half_pos hε))
  obtain ⟨b, hb, hb', y, hy, rfl⟩ :=
    exists_lt_of_gauge_lt absorbs (lt_add_of_pos_right (gauge s y) (half_pos hε))
  calc
    gauge s (a • x + b • y) ≤ a + b := gauge_le_of_mem (by positivity) <| by
      rw [hs.add_smul ha.le hb.le]
      exact add_mem_add (smul_mem_smul_set hx) (smul_mem_smul_set hy)
    _ < gauge s (a • x) + gauge s (b • y) + ε := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
absorbs : Absorbent ℝ s
ε : ℝ
hε : 0 < ε
a : ℝ
ha : 0 < a
x : E
hx : x ∈ s
ha' : a < gauge s ((fun x => a • x) x) + ε / 2
b : ℝ
hb : 0 < b
y : E
hy : y ∈ s
hb' : b < gauge s ((fun x => b • x) y) + ε / 2
⊢ a + b < gauge s (a • x) + gauge s (b • y) + ε

Next tactic:
linarith
theorem Convex.gauge_le (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) (a : ℝ) :
    Convex ℝ { x | gauge s x ≤ a } := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
h₀ : 0 ∈ s
absorbs : Absorbent ℝ s
a : ℝ
⊢ Convex ℝ {x | gauge s x ≤ a}

Next tactic:
by_cases ha : 0 ≤ a
theorem Convex.gauge_le (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) (a : ℝ) :
    Convex ℝ { x | gauge s x ≤ a } := by
  by_cases ha : 0 ≤ a
  · 

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
h₀ : 0 ∈ s
absorbs : Absorbent ℝ s
a : ℝ
ha : 0 ≤ a
⊢ Convex ℝ {x | gauge s x ≤ a}

Next tactic:
rw [gauge_le_eq hs h₀ absorbs ha]
theorem Convex.gauge_le (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) (a : ℝ) :
    Convex ℝ { x | gauge s x ≤ a } := by
  by_cases ha : 0 ≤ a
  · rw [gauge_le_eq hs h₀ absorbs ha]
    

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
h₀ : 0 ∈ s
absorbs : Absorbent ℝ s
a : ℝ
ha : 0 ≤ a
⊢ Convex ℝ (⋂ r, ⋂ (_ : a < r), r • s)

Next tactic:
exact convex_iInter fun i => convex_iInter fun _ => hs.smul _
theorem Convex.gauge_le (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) (a : ℝ) :
    Convex ℝ { x | gauge s x ≤ a } := by
  by_cases ha : 0 ≤ a
  · rw [gauge_le_eq hs h₀ absorbs ha]
    exact convex_iInter fun i => convex_iInter fun _ => hs.smul _
  · -- Porting note: `convert` needed help
    

Proof state:
case neg
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
h₀ : 0 ∈ s
absorbs : Absorbent ℝ s
a : ℝ
ha : ¬0 ≤ a
⊢ Convex ℝ {x | gauge s x ≤ a}

Next tactic:
convert convex_empty (𝕜 := ℝ) (E := E)
theorem Convex.gauge_le (hs : Convex ℝ s) (h₀ : (0 : E) ∈ s) (absorbs : Absorbent ℝ s) (a : ℝ) :
    Convex ℝ { x | gauge s x ≤ a } := by
  by_cases ha : 0 ≤ a
  · rw [gauge_le_eq hs h₀ absorbs ha]
    exact convex_iInter fun i => convex_iInter fun _ => hs.smul _
  · -- Porting note: `convert` needed help
    convert convex_empty (𝕜 := ℝ) (E := E)
    

Proof state:
case h.e'_6
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Convex ℝ s
h₀ : 0 ∈ s
absorbs : Absorbent ℝ s
a : ℝ
ha : ¬0 ≤ a
⊢ {x | gauge s x ≤ a} = ∅

Next tactic:
exact eq_empty_iff_forall_not_mem.2 fun x hx => ha <| (gauge_nonneg _).trans hx
theorem Balanced.starConvex (hs : Balanced ℝ s) : StarConvex ℝ 0 s :=
  starConvex_zero_iff.2 fun x hx a ha₀ ha₁ =>
    hs _ (by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a✝ : ℝ
hs : Balanced ℝ s
x : E
hx : x ∈ s
a : ℝ
ha₀ : 0 ≤ a
ha₁ : a ≤ 1
⊢ ‖a‖ ≤ 1

Next tactic:
rwa [Real.norm_of_nonneg ha₀]
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
hs₀ : StarConvex ℝ 0 s
hs₂ : Absorbs ℝ s {x}
hx : x ∉ a • s
⊢ a ≤ gauge s x

Next tactic:
rw [starConvex_zero_iff] at hs₀
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
hs₂ : Absorbs ℝ s {x}
hx : x ∉ a • s
⊢ a ≤ gauge s x

Next tactic:
obtain ⟨r, hr, h⟩ := hs₂
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  obtain ⟨r, hr, h⟩ := hs₂
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
hx : x ∉ a • s
r : ℝ
hr : 0 < r
h : ∀ (a : ℝ), r ≤ ‖a‖ → {x} ⊆ a • s
⊢ a ≤ gauge s x

Next tactic:
refine' le_csInf ⟨r, hr, singleton_subset_iff.1 <| h _ (Real.norm_of_nonneg hr.le).ge⟩ _
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  obtain ⟨r, hr, h⟩ := hs₂
  refine' le_csInf ⟨r, hr, singleton_subset_iff.1 <| h _ (Real.norm_of_nonneg hr.le).ge⟩ _
  

Proof state:
case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
x : E
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
hx : x ∉ a • s
r : ℝ
hr : 0 < r
h : ∀ (a : ℝ), r ≤ ‖a‖ → {x} ⊆ a • s
⊢ ∀ b ∈ {r | 0 < r ∧ x ∈ r • s}, a ≤ b

Next tactic:
rintro b ⟨hb, x, hx', rfl⟩
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  obtain ⟨r, hr, h⟩ := hs₂
  refine' le_csInf ⟨r, hr, singleton_subset_iff.1 <| h _ (Real.norm_of_nonneg hr.le).ge⟩ _
  rintro b ⟨hb, x, hx', rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
r : ℝ
hr : 0 < r
b : ℝ
hb : 0 < b
x : E
hx' : x ∈ s
hx : (fun x => b • x) x ∉ a • s
h : ∀ (a : ℝ), r ≤ ‖a‖ → {(fun x => b • x) x} ⊆ a • s
⊢ a ≤ b

Next tactic:
refine' not_lt.1 fun hba => hx _
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  obtain ⟨r, hr, h⟩ := hs₂
  refine' le_csInf ⟨r, hr, singleton_subset_iff.1 <| h _ (Real.norm_of_nonneg hr.le).ge⟩ _
  rintro b ⟨hb, x, hx', rfl⟩
  refine' not_lt.1 fun hba => hx _
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
r : ℝ
hr : 0 < r
b : ℝ
hb : 0 < b
x : E
hx' : x ∈ s
hx : (fun x => b • x) x ∉ a • s
h : ∀ (a : ℝ), r ≤ ‖a‖ → {(fun x => b • x) x} ⊆ a • s
hba : b < a
⊢ (fun x => b • x) x ∈ a • s

Next tactic:
have ha := hb.trans hba
theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x := by
  rw [starConvex_zero_iff] at hs₀
  obtain ⟨r, hr, h⟩ := hs₂
  refine' le_csInf ⟨r, hr, singleton_subset_iff.1 <| h _ (Real.norm_of_nonneg hr.le).ge⟩ _
  rintro b ⟨hb, x, hx', rfl⟩
  refine' not_lt.1 fun hba => hx _
  have ha := hb.trans hba
  

Proof state:
case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
a : ℝ
hs₀ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : ℝ⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s
r : ℝ
hr : 0 < r
b : ℝ
hb : 0 < b
x : E
hx' : x ∈ s
hx : (fun x => b • x) x ∉ a • s
h : ∀ (a : ℝ), r ≤ ‖a‖ → {(fun x => b • x) x} ⊆ a • s
hba : b < a
ha : 0 < a
⊢ (fun x => b • x) x ∈ a • s

Next tactic:
refine' ⟨(a⁻¹ * b) • x, hs₀ hx' (by positivity) _, _⟩