l3lab/ntp-mathlib huggingface dataset:
theorem convexBodySumFun_eq_zero_iff (x : E K) :
    convexBodySumFun x = 0 ↔ x = 0 := by
  refine ⟨fun h => ?_, fun h => ?_⟩
  · rw [add_eq_zero_iff' (Finset.sum_nonneg fun _ _ => norm_nonneg _) (mul_nonneg zero_le_two
      (Finset.sum_nonneg fun _ _ => norm_nonneg _)), Finset.mul_sum,
      Finset.sum_eq_zero_iff_of_nonneg (fun _ _ => mul_nonneg zero_le_two (norm_nonneg _)),
      Finset.sum_eq_zero_iff_of_nonneg (fun _ _ => norm_nonneg _)] at h
    ext : 2
    · exact norm_eq_zero.mp (h.1 _ (Finset.mem_univ _))
    · 

Proof state:
case refine_1.a.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
h : (∀ i ∈ Finset.univ, ‖x.1 i‖ = 0) ∧ ∀ i ∈ Finset.univ, 2 * ‖x.2 i‖ = 0
x✝ : { w // IsComplex w }
⊢ x.2 x✝ = 0.2 x✝

Next tactic:
exact norm_eq_zero.mp ((smul_eq_zero_iff_eq' two_ne_zero (α := ℝ)).mp
        (h.2 _ (Finset.mem_univ _)))
theorem convexBodySumFun_eq_zero_iff (x : E K) :
    convexBodySumFun x = 0 ↔ x = 0 := by
  refine ⟨fun h => ?_, fun h => ?_⟩
  · rw [add_eq_zero_iff' (Finset.sum_nonneg fun _ _ => norm_nonneg _) (mul_nonneg zero_le_two
      (Finset.sum_nonneg fun _ _ => norm_nonneg _)), Finset.mul_sum,
      Finset.sum_eq_zero_iff_of_nonneg (fun _ _ => mul_nonneg zero_le_two (norm_nonneg _)),
      Finset.sum_eq_zero_iff_of_nonneg (fun _ _ => norm_nonneg _)] at h
    ext : 2
    · exact norm_eq_zero.mp (h.1 _ (Finset.mem_univ _))
    · exact norm_eq_zero.mp ((smul_eq_zero_iff_eq' two_ne_zero (α := ℝ)).mp
        (h.2 _ (Finset.mem_univ _)))
  · 

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
h : x = 0
⊢ convexBodySumFun x = 0

Next tactic:
simp only [convexBodySumFun, h, Prod.fst_zero, Pi.zero_apply, norm_zero, Finset.sum_const_zero,
      Prod.snd_zero, mul_zero, add_zero]
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ ‖x‖ ≤ convexBodySumFun x

Next tactic:
refine max_le ?_ ?_
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · 

Proof state:
case refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ ‖x.1‖ ≤ convexBodySumFun x

Next tactic:
refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    

Proof state:
case refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsReal w }
⊢ ‖x.1 w‖ ≤ convexBodySumFun x

Next tactic:
refine le_add_of_le_of_nonneg ?_ ?_
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · 

Proof state:
case refine_1.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsReal w }
⊢ ‖x.1 w‖ ≤ ∑ w : { w // IsReal w }, ‖x.1 w‖

Next tactic:
exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · 

Proof state:
case refine_1.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsReal w }
⊢ 0 ≤ 2 * ∑ w : { w // IsComplex w }, ‖x.2 w‖

Next tactic:
exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · 

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ ‖x.2‖ ≤ convexBodySumFun x

Next tactic:
refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ ‖x.2 w‖ ≤ convexBodySumFun x

Next tactic:
refine le_add_of_nonneg_of_le ?_ ?_
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_nonneg_of_le ?_ ?_
    · 

Proof state:
case refine_2.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ 0 ≤ ∑ w : { w // IsReal w }, ‖x.1 w‖

Next tactic:
exact Finset.sum_nonneg (fun w _ => norm_nonneg (x.1 w))
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_nonneg_of_le ?_ ?_
    · exact Finset.sum_nonneg (fun w _ => norm_nonneg (x.1 w))
    · 

Proof state:
case refine_2.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ ‖x.2 w‖ ≤ 2 * ∑ w : { w // IsComplex w }, ‖x.2 w‖

Next tactic:
rw [Finset.mul_sum]
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_nonneg_of_le ?_ ?_
    · exact Finset.sum_nonneg (fun w _ => norm_nonneg (x.1 w))
    · rw [Finset.mul_sum]
      

Proof state:
case refine_2.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ ‖x.2 w‖ ≤ ∑ x_1 : { w // IsComplex w }, 2 * ‖x.2 x_1‖

Next tactic:
refine le_trans (by linarith [norm_nonneg (x.2 w)] : ‖x.2 w‖ ≤ 2 * ‖x.2 w‖) ?_
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_nonneg_of_le ?_ ?_
    · exact Finset.sum_nonneg (fun w _ => norm_nonneg (x.1 w))
    · rw [Finset.mul_sum]
      refine le_trans (by 

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ ‖x.2 w‖ ≤ 2 * ‖x.2 w‖

Next tactic:
linarith [norm_nonneg (x.2 w)]
theorem norm_le_convexBodySumFun (x : E K) : ‖x‖ ≤ convexBodySumFun x := by
  refine max_le ?_ ?_
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_le_of_nonneg ?_ ?_
    · exact Finset.single_le_sum (fun z _ => norm_nonneg (x.1 z)) (Finset.mem_univ w)
    · exact mul_nonneg zero_le_two <| Finset.sum_nonneg (fun w _ => norm_nonneg (x.2 w))
  · refine (pi_norm_le_iff_of_nonneg (convexBodySumFun_nonneg x)).mpr (fun w => ?_)
    refine le_add_of_nonneg_of_le ?_ ?_
    · exact Finset.sum_nonneg (fun w _ => norm_nonneg (x.1 w))
    · rw [Finset.mul_sum]
      refine le_trans (by linarith [norm_nonneg (x.2 w)] : ‖x.2 w‖ ≤ 2 * ‖x.2 w‖) ?_
      

Proof state:
case refine_2.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
w : { w // IsComplex w }
⊢ 2 * ‖x.2 w‖ ≤ ∑ x_1 : { w // IsComplex w }, 2 * ‖x.2 x_1‖

Next tactic:
exact Finset.single_le_sum (fun z _ => mul_nonneg zero_le_two (norm_nonneg (x.2 z)))
        (Finset.mem_univ w)
theorem convexBodySumFun_continuous :
    Continuous (convexBodySumFun : (E K) → ℝ) := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Continuous convexBodySumFun

Next tactic:
refine Continuous.add ?_ ?_
theorem convexBodySumFun_continuous :
    Continuous (convexBodySumFun : (E K) → ℝ) := by
  refine Continuous.add ?_ ?_
  · 

Proof state:
case refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Continuous fun x => ∑ w : { w // IsReal w }, ‖x.1 w‖

Next tactic:
exact continuous_finset_sum Finset.univ
      (fun i _ => continuous_norm.comp' (continuous_apply i).fst')
theorem convexBodySumFun_continuous :
    Continuous (convexBodySumFun : (E K) → ℝ) := by
  refine Continuous.add ?_ ?_
  · exact continuous_finset_sum Finset.univ
      (fun i _ => continuous_norm.comp' (continuous_apply i).fst')
  · 

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Continuous fun x => 2 * ∑ w : { w // IsComplex w }, ‖x.2 w‖

Next tactic:
refine Continuous.const_smul ?_ (2:ℝ)
theorem convexBodySumFun_continuous :
    Continuous (convexBodySumFun : (E K) → ℝ) := by
  refine Continuous.add ?_ ?_
  · exact continuous_finset_sum Finset.univ
      (fun i _ => continuous_norm.comp' (continuous_apply i).fst')
  · refine Continuous.const_smul ?_ (2:ℝ)
    

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Continuous fun x => ∑ w : { w // IsComplex w }, ‖x.2 w‖

Next tactic:
exact continuous_finset_sum Finset.univ
      (fun i _ => continuous_norm.comp' (continuous_apply i).snd')
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB : B ≤ 0
⊢ ↑↑volume (convexBodySum K B) = 0

Next tactic:
obtain hB | hB := lt_or_eq_of_le hB
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · 

Proof state:
case inl
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
⊢ ↑↑volume (convexBodySum K B) = 0

Next tactic:
suffices convexBodySum K B = ∅ by rw [this, measure_empty]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by 

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
this : convexBodySum K B = ∅
⊢ ↑↑volume (convexBodySum K B) = 0

Next tactic:
rw [this, measure_empty]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    

Proof state:
case inl
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
⊢ convexBodySum K B = ∅

Next tactic:
ext x
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    

Proof state:
case inl.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ x ∈ convexBodySum K B ↔ x ∈ ∅

Next tactic:
refine ⟨fun hx => ?_, fun h => h.elim⟩
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    

Proof state:
case inl.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
⊢ x ∈ ∅

Next tactic:
rw [Set.mem_setOf] at hx
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    

Proof state:
case inl.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B < 0
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : convexBodySumFun x ≤ B
⊢ x ∈ ∅

Next tactic:
linarith [convexBodySumFun_nonneg x]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    linarith [convexBodySumFun_nonneg x]
  · 

Proof state:
case inr
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B = 0
⊢ ↑↑volume (convexBodySum K B) = 0

Next tactic:
suffices convexBodySum K B = { 0 } by rw [this, measure_singleton]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    linarith [convexBodySumFun_nonneg x]
  · suffices convexBodySum K B = { 0 } by 

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B = 0
this : convexBodySum K B = {0}
⊢ ↑↑volume (convexBodySum K B) = 0

Next tactic:
rw [this, measure_singleton]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    linarith [convexBodySumFun_nonneg x]
  · suffices convexBodySum K B = { 0 } by rw [this, measure_singleton]
    

Proof state:
case inr
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B = 0
⊢ convexBodySum K B = {0}

Next tactic:
ext
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    linarith [convexBodySumFun_nonneg x]
  · suffices convexBodySum K B = { 0 } by rw [this, measure_singleton]
    ext
    

Proof state:
case inr.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B = 0
x✝ : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ x✝ ∈ convexBodySum K B ↔ x✝ ∈ {0}

Next tactic:
rw [convexBodySum, Set.mem_setOf_eq, Set.mem_singleton_iff, hB, ← convexBodySumFun_eq_zero_iff]
theorem convexBodySum_volume_eq_zero_of_le_zero {B} (hB : B ≤ 0) :
    volume (convexBodySum K B) = 0 := by
  obtain hB | hB := lt_or_eq_of_le hB
  · suffices convexBodySum K B = ∅ by rw [this, measure_empty]
    ext x
    refine ⟨fun hx => ?_, fun h => h.elim⟩
    rw [Set.mem_setOf] at hx
    linarith [convexBodySumFun_nonneg x]
  · suffices convexBodySum K B = { 0 } by rw [this, measure_singleton]
    ext
    rw [convexBodySum, Set.mem_setOf_eq, Set.mem_singleton_iff, hB, ← convexBodySumFun_eq_zero_iff]
    

Proof state:
case inr.h
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B✝ B : ℝ
hB✝ : B ≤ 0
hB : B = 0
x✝ : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
⊢ convexBodySumFun x✝ ≤ 0 ↔ convexBodySumFun x✝ = 0

Next tactic:
exact (convexBodySumFun_nonneg _).le_iff_eq
theorem convexBodySum_mem {x : K} :
    mixedEmbedding K x ∈ (convexBodySum K B) ↔
      ∑ w : InfinitePlace K, (mult w) * w.val x ≤ B := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : K
⊢ (mixedEmbedding K) x ∈ convexBodySum K B ↔ ∑ w : InfinitePlace K, ↑(mult w) * ↑w x ≤ B

Next tactic:
simp_rw [Set.mem_setOf_eq, mixedEmbedding, RingHom.prod_apply, convexBodySumFun, Pi.ringHom_apply,
    ← Complex.norm_real, embedding_of_isReal_apply, norm_embedding_eq, mult, Nat.cast_ite, ite_mul,
    Finset.sum_ite, Finset.filter_congr (fun _ _ => not_isReal_iff_isComplex), Finset.mul_sum,
    ← Finset.sum_subtype_eq_sum_filter, Finset.subtype_univ, Nat.cast_one, one_mul, Nat.cast_ofNat]
theorem convexBodySum_mem {x : K} :
    mixedEmbedding K x ∈ (convexBodySum K B) ↔
      ∑ w : InfinitePlace K, (mult w) * w.val x ≤ B := by
  simp_rw [Set.mem_setOf_eq, mixedEmbedding, RingHom.prod_apply, convexBodySumFun, Pi.ringHom_apply,
    ← Complex.norm_real, embedding_of_isReal_apply, norm_embedding_eq, mult, Nat.cast_ite, ite_mul,
    Finset.sum_ite, Finset.filter_congr (fun _ _ => not_isReal_iff_isComplex), Finset.mul_sum,
    ← Finset.sum_subtype_eq_sum_filter, Finset.subtype_univ, Nat.cast_one, one_mul, Nat.cast_ofNat]
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : K
⊢ ∑ x_1 : { w // IsReal w }, ↑x_1 x + ∑ x_1 : { w // IsComplex w }, 2 * ↑x_1 x ≤ B ↔
    ∑ x_1 : { x // IsReal x }, ↑↑x_1 x + ∑ x_1 : { x // IsComplex x }, 2 * ↑↑x_1 x ≤ B

Next tactic:
rfl
theorem convexBodySum_symmetric {x : E K} (hx : x ∈ (convexBodySum K B)) :
    -x ∈ (convexBodySum K B) := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
⊢ -x ∈ convexBodySum K B

Next tactic:
rw [Set.mem_setOf, convexBodySumFun_neg]
theorem convexBodySum_symmetric {x : E K} (hx : x ∈ (convexBodySum K B)) :
    -x ∈ (convexBodySum K B) := by
  rw [Set.mem_setOf, convexBodySumFun_neg]
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
⊢ convexBodySumFun x ≤ B

Next tactic:
exact hx
theorem convexBodySum_convex : Convex ℝ (convexBodySum K B) := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Convex ℝ (convexBodySum K B)

Next tactic:
refine Convex_subadditive_le (fun _ _ => convexBodySumFun_add_le _ _) (fun c x h => ?_) B
theorem convexBodySum_convex : Convex ℝ (convexBodySum K B) := by
  refine Convex_subadditive_le (fun _ _ => convexBodySumFun_add_le _ _) (fun c x h => ?_) B
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B c : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
h : 0 ≤ c
⊢ convexBodySumFun (c • x) ≤ c * convexBodySumFun x

Next tactic:
convert le_of_eq (convexBodySumFun_smul c x)
theorem convexBodySum_convex : Convex ℝ (convexBodySum K B) := by
  refine Convex_subadditive_le (fun _ _ => convexBodySumFun_add_le _ _) (fun c x h => ?_) B
  convert le_of_eq (convexBodySumFun_smul c x)
  

Proof state:
case h.e'_4.h.e'_5
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B c : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
h : 0 ≤ c
⊢ c = |c|

Next tactic:
exact (abs_eq_self.mpr h).symm
theorem convexBodySum_isBounded : Bornology.IsBounded (convexBodySum K B) := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ Bornology.IsBounded (convexBodySum K B)

Next tactic:
refine Metric.isBounded_iff.mpr ⟨B + B, fun x hx y hy => ?_⟩
theorem convexBodySum_isBounded : Bornology.IsBounded (convexBodySum K B) := by
  refine Metric.isBounded_iff.mpr ⟨B + B, fun x hx y hy => ?_⟩
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
y : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hy : y ∈ convexBodySum K B
⊢ dist x y ≤ B + B

Next tactic:
refine le_trans (norm_sub_le x y) (add_le_add ?_ ?_)
theorem convexBodySum_isBounded : Bornology.IsBounded (convexBodySum K B) := by
  refine Metric.isBounded_iff.mpr ⟨B + B, fun x hx y hy => ?_⟩
  refine le_trans (norm_sub_le x y) (add_le_add ?_ ?_)
  

Proof state:
case refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
y : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hy : y ∈ convexBodySum K B
⊢ ‖x‖ ≤ B
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
y : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hy : y ∈ convexBodySum K B
⊢ ‖y‖ ≤ B

Next tactic:
exact le_trans (norm_le_convexBodySumFun x) hx
theorem convexBodySum_isBounded : Bornology.IsBounded (convexBodySum K B) := by
  refine Metric.isBounded_iff.mpr ⟨B + B, fun x hx y hy => ?_⟩
  refine le_trans (norm_sub_le x y) (add_le_add ?_ ?_)
  exact le_trans (norm_le_convexBodySumFun x) hx
  

Proof state:
case refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ convexBodySum K B
y : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hy : y ∈ convexBodySum K B
⊢ ‖y‖ ≤ B

Next tactic:
exact le_trans (norm_le_convexBodySumFun y) hy
theorem convexBodySum_compact : IsCompact (convexBodySum K B) := by
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ IsCompact (convexBodySum K B)

Next tactic:
rw [Metric.isCompact_iff_isClosed_bounded]
theorem convexBodySum_compact : IsCompact (convexBodySum K B) := by
  rw [Metric.isCompact_iff_isClosed_bounded]
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ IsClosed (convexBodySum K B) ∧ Bornology.IsBounded (convexBodySum K B)

Next tactic:
refine ⟨?_, convexBodySum_isBounded K B⟩
theorem convexBodySum_compact : IsCompact (convexBodySum K B) := by
  rw [Metric.isCompact_iff_isClosed_bounded]
  refine ⟨?_, convexBodySum_isBounded K B⟩
  

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
B : ℝ
⊢ IsClosed (convexBodySum K B)

Next tactic:
convert IsClosed.preimage (convexBodySumFun_continuous K) (isClosed_Icc : IsClosed (Set.Icc 0 B))