l3lab/ntp-mathlib huggingface dataset:
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  

Proof state:
case intro.mk.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx : x ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := x, property := hx } ≠ 0
h_mem : ↑{ val := x, property := hx } ∈ convexBodySum K B
⊢ ∃ a, a ≠ 0 ∧ ↑|(Algebra.norm ℚ) ↑a| ≤ (B / ↑(finrank ℚ K)) ^ finrank ℚ K

Next tactic:
rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  

Proof state:
case intro.mk.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
x : ({ w // IsReal w } → ℝ) × ({ w // IsComplex w } → ℂ)
hx✝ : x ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
hx : x ∈ ⇑(mixedEmbedding K) '' ↑(𝓞 K)
h_nzr : { val := x, property := hx✝ } ≠ 0
h_mem : ↑{ val := x, property := hx✝ } ∈ convexBodySum K B
⊢ ∃ a, a ≠ 0 ∧ ↑|(Algebra.norm ℚ) ↑a| ≤ (B / ↑(finrank ℚ K)) ^ finrank ℚ K

Next tactic:
obtain ⟨a, ha, rfl⟩ := hx
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  

Proof state:
case intro.mk.intro.intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ∃ a, a ≠ 0 ∧ ↑|(Algebra.norm ℚ) ↑a| ≤ (B / ↑(finrank ℚ K)) ^ finrank ℚ K

Next tactic:
refine ⟨⟨a, ha⟩, ?_, ?_⟩
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · 

Proof state:
case intro.mk.intro.intro.intro.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ { val := a, property := ha } ≠ 0

Next tactic:
rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    

Proof state:
case intro.mk.intro.intro.intro.refine_1
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : a ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ { val := a, property := ha } ≠ 0

Next tactic:
exact Subtype.ne_of_val_ne h_nzr
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · 

Proof state:
case intro.mk.intro.intro.intro.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }| ≤ (B / ↑(finrank ℚ K)) ^ finrank ℚ K

Next tactic:
rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by 

Proof state:
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ 0 ≤ ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }|

Next tactic:
simp only [Rat.cast_abs, abs_nonneg]
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    

Proof state:
case intro.mk.intro.intro.intro.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ↑(finrank ℚ K) * ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }| ^ (↑(finrank ℚ K))⁻¹ ≤ B

Next tactic:
refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
theorem exists_ne_zero_mem_ringOfIntegers_of_norm_le {B : ℝ}
    (h : (minkowskiBound K) ≤ volume (convexBodySum K B)) :
    ∃ (a : 𝓞 K), a ≠ 0 ∧ |Algebra.norm ℚ (a:K)| ≤ (B / (finrank ℚ K)) ^ (finrank ℚ K) := by
  have hB : 0 ≤ B := by
    contrapose! h
    rw [convexBodySum_volume_eq_zero_of_le_zero K (le_of_lt h)]
    exact minkowskiBound_pos K
  -- Some inequalities that will be useful later on
  have h1 : 0 < (finrank ℚ K : ℝ)⁻¹ := inv_pos.mpr (Nat.cast_pos.mpr finrank_pos)
  have h2 : 0 ≤ B / (finrank ℚ K) := div_nonneg hB (Nat.cast_nonneg _)
  have h_fund := Zspan.isAddFundamentalDomain (latticeBasis K) volume
  have : Countable (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change Countable (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  have : DiscreteTopology (Submodule.span ℤ (Set.range (latticeBasis K))).toAddSubgroup := by
    change DiscreteTopology  (Submodule.span ℤ (Set.range (latticeBasis K)): Set (E K))
    infer_instance
  obtain ⟨⟨x, hx⟩, h_nzr, h_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure
      h_fund (fun _ ↦ convexBodySum_symmetric K B) (convexBodySum_convex K B)
      (convexBodySum_compact K B) h
  rw [Submodule.mem_toAddSubgroup, mem_span_latticeBasis] at hx
  obtain ⟨a, ha, rfl⟩ := hx
  refine ⟨⟨a, ha⟩, ?_, ?_⟩
  · rw [ne_eq, AddSubgroup.mk_eq_zero_iff, map_eq_zero, ← ne_eq] at h_nzr
    exact Subtype.ne_of_val_ne h_nzr
  · rw [← rpow_nat_cast, ← rpow_le_rpow_iff (by simp only [Rat.cast_abs, abs_nonneg])
      (rpow_nonneg_of_nonneg h2 _) h1, ← rpow_mul h2,  mul_inv_cancel (Nat.cast_ne_zero.mpr
      (ne_of_gt finrank_pos)), rpow_one, le_div_iff' (Nat.cast_pos.mpr finrank_pos)]
    refine le_trans ?_ ((convexBodySum_mem K B).mp h_mem)
    

Proof state:
case intro.mk.intro.intro.intro.refine_2
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
f : InfinitePlace K → ℝ≥0
B : ℝ
h : minkowskiBound K ≤ ↑↑volume (convexBodySum K B)
hB : 0 ≤ B
h1 : 0 < (↑(finrank ℚ K))⁻¹
h2 : 0 ≤ B / ↑(finrank ℚ K)
h_fund :
  IsAddFundamentalDomain (↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))))
    (fundamentalDomain (latticeBasis K))
this✝ : Countable ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
this : DiscreteTopology ↥(Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K))))
a : K
ha : a ∈ ↑(𝓞 K)
hx : (mixedEmbedding K) a ∈ Submodule.toAddSubgroup (Submodule.span ℤ (Set.range ⇑(latticeBasis K)))
h_nzr : { val := (mixedEmbedding K) a, property := hx } ≠ 0
h_mem : ↑{ val := (mixedEmbedding K) a, property := hx } ∈ convexBodySum K B
⊢ ↑(finrank ℚ K) * ↑|(Algebra.norm ℚ) ↑{ val := a, property := ha }| ^ (↑(finrank ℚ K))⁻¹ ≤
    Finset.sum Finset.univ fun w => ↑(mult w) * ↑w a

Next tactic:
rw [← le_div_iff' (Nat.cast_pos.mpr finrank_pos), ← sum_mult_eq, Nat.cast_sum]