nus_min_card_ge_near_quadratic_of_rank_hadamard_bound
If every NUS set A ⊆ Z/pZ satisfies log p ≤ K(√|A| + |A|/log p)·log|A| with K ≥ 1, then m(p) ≥ (1/(32K²))(log p/log log p)² for every prime p ≥ 64. Consequently the target follows from the existence of such a K.
Statement
theorem nus_min_card_ge_near_quadratic_of_rank_hadamard_bound (K : ℝ) (hK : 1 ≤ K)
(hbound : ∀ (p : ℕ), p.Prime → ∀ A : Finset (ZMod p), finset_has_no_unique_sums A →
Real.log p ≤ K * (Real.sqrt (A.card : ℝ) + (A.card : ℝ) / Real.log p) * Real.log (A.card : ℝ)) :
∃ C : ℝ, 0 < C ∧ ∃ p₀ : ℕ, ∀ p : ℕ, p₀ ≤ p → p.Prime →
C * (Real.log p / Real.log (Real.log p)) ^ 2 ≤ (nus_min_card p : ℝ)- Source
- step towards nus_min_card_ge_near_quadratic
- Verified
- 25 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 5
- nus_min_cardm(p): the least size of a subset of Z/pZ with no unique sums.
- nus_exists_inclusion_minimal_subsetEvery finite set with no unique sums contains an inclusion-minimal one: there is a subset B of A that has no unique sums and none of whose…
- finset_has_no_unique_sums_univ_zmodFor an odd prime p, the whole of Z/pZ has no unique sums.
- finset_unordered_sum_rep_countr_{A,2}(s): the number of unordered pairs {a, b} (a = b allowed) of elements of A with a + b = s.
- finset_has_no_unique_sumsA has no unique sums (is NUS): |A| ≥ 2 and every sum a + b with a, b ∈ A has at least two representations as an unordered pair from A.
The proof, explained
The theorem is proved by reducing the asymptotic bound to a real-analytic inequality via an auxiliary lemma. Under the contradiction hypothesis that the minimal NUS set size n is strictly smaller than (1/(32K²))(log p / log log p)², one deduces log n < 2 log log p, allowing both the square-root term and the linear term in the rank-Hadamard bound to be bounded so that their sum times K log n is strictly less than (9/16) log p < log p, a contradiction. For any prime p ≥ 64, the full group Z/pZ witnesses that the collection of NUS sets is nonempty, ensuring the infimum m(p) is achieved by a valid set of size at least 2, and the auxiliary lemma applies directly.
Assuming the negation of the bound for contradiction, the quantities log L, K, and n are strictly positive, and n < (1 / (32K²)) (L / log L)².
The proof of the auxiliary lemma proceeds by contradiction (by_contra hcon), turning the negated goal into the strict upper bound n < (1 / (32K²)) (L / log L)² via not_le.mp. Since the hypotheses provide 1 ≤ log L, 1 ≤ K, and 2 ≤ n, linear arithmetic (linarith) confirms that log L, K, and n are strictly positive.
uses
not_le.mpby_contra hcon have hn_lt : n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := not_le.mp hcon have hlogL_pos : 0 < Real.log L := by linarith have hK_pos : 0 < K := by linarith have hn_pos : 0 < n := by linarith
The quantity n satisfies n < L², which implies log n < 2 log L and log n > 0.
Because K ≥ 1, we have 32K² ≥ 1, which implies 1 / (32K²) ≤ 1 using div_le_one. Because log L ≥ 1, we have (log L)² ≥ 1, so (L / log L)² = L² / (log L)² ≤ L² using div_pow and div_le_div_of_nonneg_left. Combining these with the contradiction hypothesis yields n < L². Taking logarithms via Real.log_lt_log and rewriting log(L²) = 2 log L via Real.log_pow gives log n < 2 log L. Finally, since n ≥ 2 > 1, Real.log_pos shows log n > 0.
uses
div_le_one,div_pow,div_le_div_of_nonneg_left,Real.log_lt_log,Real.log_pow,Real.log_poshave h1 : 1 / (32 * K ^ 2) ≤ 1 := by have : (1 : ℝ) ≤ 32 * K ^ 2 := by nlinarith rw [div_le_one (by positivity)] exact this have h2 : (L / Real.log L) ^ 2 ≤ L ^ 2 := by rw [div_pow] have : (1 : ℝ) ≤ (Real.log L) ^ 2 := by nlinarith have : L ^ 2 / (Real.log L) ^ 2 ≤ L ^ 2 / 1 := div_le_div_of_nonneg_left (by positivity) (by positivity) this linarith have hn_lt_Lsq : n < L ^ 2 := by calc n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := hn_lt _ ≤ 1 * L ^ 2 := by nlinarith _ = L ^ 2 := by ring have hlog_lt : Real.log n < 2 * Real.log L := by have hlog_lt' : Real.log n < Real.log (L ^ 2) := Real.log_lt_log hn_pos hn_lt_Lsq have hlog_Lsq : Real.log (L ^ 2) = 2 * Real.log L := by rw [Real.log_pow L 2] ring linarith have hlogn_pos : 0 < Real.log n := by have : (1 : ℝ) < n := by linarith exact Real.log_pos this
The square-root contribution satisfies K log n √n < L / 2.
Squaring the fraction L / (4K log L) yields (1 / (16K²)) (L / log L)². Since 1 / (32K²) < 1 / (16K²) by div_lt_div_of_pos_left and zero_lt_one, the contradiction hypothesis implies n < (L / (4K log L))² via mul_lt_mul_of_pos_right and div_pos. Taking square roots with Real.sqrt_lt_sqrt and simplifying with Real.sqrt_sq (using le_of_lt) gives √n < L / (4K log L). Multiplying by K log n < 2K log L via mul_lt_mul_of_pos_left and simplifying yields K log n √n < 2K log L · (L / (4K log L)) = L / 2.
uses
mul_lt_mul_of_pos_right,div_lt_div_of_pos_left,zero_lt_one,div_pos,Real.sqrt_lt_sqrt,Real.sqrt_sq,le_of_lt,mul_lt_mul_of_pos_lefthave htarget_pos : 0 < L / (4 * K * Real.log L) := by positivity have hsq2 : (L / (4 * K * Real.log L)) ^ 2 = 1 / (16 * K ^ 2) * (L / Real.log L) ^ 2 := by ring have hlt : n < (L / (4 * K * Real.log L)) ^ 2 := by rw [hsq2] calc n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := hn_lt _ < 1 / (16 * K ^ 2) * (L / Real.log L) ^ 2 := by apply mul_lt_mul_of_pos_right · have : 16 * K ^ 2 < 32 * K ^ 2 := by nlinarith have : (0 : ℝ) < 16 * K ^ 2 := by positivity exact div_lt_div_of_pos_left zero_lt_one this (by nlinarith) · have : 0 < L / Real.log L := div_pos hL hlogL_pos positivity have hsqrt : Real.sqrt n < L / (4 * K * Real.log L) := by have hs := Real.sqrt_lt_sqrt (by linarith) hlt rw [Real.sqrt_sq (le_of_lt htarget_pos)] at hs exact hs have hsqrt_term : K * Real.log n * Real.sqrt n < L / 2 := by have hlt1 : K * Real.log n * Real.sqrt n < K * (2 * Real.log L) * Real.sqrt n := by have : 0 < K * Real.sqrt n := by positivity nlinarith have hlt2 : 2 * K * Real.log L * Real.sqrt n < 2 * K * Real.log L * (L / (4 * K * Real.log L)) := by have : 0 < 2 * K * Real.log L := by positivity exact mul_lt_mul_of_pos_left hsqrt this have heq : 2 * K * Real.log L * (L / (4 * K * Real.log L)) = L / 2 := by have hK0 : K ≠ 0 := by linarith have hlog0 : Real.log L ≠ 0 := by linarith field_simp ring linarith
The linear contribution satisfies K log n (n / L) < L / 16.
Using log n ≤ 2 log L, the term is bounded by (2K log L / L) n. Substituting the contradiction hypothesis n < (1 / (32K²)) (L / log L)² via mul_lt_mul_of_pos_left and simplifying rational fractions leads to L / (16K log L). Since K ≥ 1 and log L ≥ 1, we have 16 ≤ 16K log L, so div_le_div_of_nonneg_left bounds this by L / 16.
uses
mul_lt_mul_of_pos_left,div_le_div_of_nonneg_lefthave hlin_term : K * Real.log n * (n / L) < L / 16 := by have hpos : 0 < 2 * K * Real.log L / L := by positivity have hstep1 : 2 * K * Real.log L * (n / L) = (2 * K * Real.log L / L) * n := by ring have hbound : 2 * K * Real.log L * (n / L) < L / 16 := by rw [hstep1] calc (2 * K * Real.log L / L) * n < (2 * K * Real.log L / L) * (1 / (32 * K ^ 2) * (L / Real.log L) ^ 2) := mul_lt_mul_of_pos_left hn_lt hpos _ = L / (16 * (K * Real.log L)) := by have h1 : K ≠ 0 := by linarith have h2 : Real.log L ≠ 0 := by linarith have h3 : L ≠ 0 := by linarith field_simp ring _ ≤ L / 16 := by have hKlog : 1 ≤ K * Real.log L := by nlinarith have hdenom : (16 : ℝ) ≤ 16 * (K * Real.log L) := by linarith exact div_le_div_of_nonneg_left (by linarith) (by positivity) hdenom have hstep2 : K * Real.log n * (n / L) ≤ 2 * K * Real.log L * (n / L) := by have : 0 < K * (n / L) := by positivity nlinarith linarith
Summing the two contributions gives K(√n + n/L)log n < L, contradicting the hypothesis and establishing the auxiliary lemma.
Adding the square-root and linear bounds via add_lt_add gives K(√n + n/L)log n < L / 2 + L / 16 = (9/16)L < L. This directly contradicts the assumption h : L ≤ K(√n + n/L)log n, completing the proof of the auxiliary lemma by contradiction.
uses
add_lt_addhave hcomb : K * (Real.sqrt n + n / L) * Real.log n < L := by calc K * (Real.sqrt n + n / L) * Real.log n = K * Real.log n * Real.sqrt n + K * Real.log n * (n / L) := by ring _ < L / 2 + L / 16 := add_lt_add hsqrt_term hlin_term _ = (9 / 16 : ℝ) * L := by ring _ < L := by linarith linarith
Choose C = 1 / (32K²) and p₀ = 64, and for any prime p ≥ 64, obtain a minimal NUS set A ⊆ Z/pZ of cardinality m(p) with 2 ≤ m(p).
We instantiate the existential quantifiers with C = 1 / (32K²) (positive by positivity) and p₀ = 64 via refine. For any prime p ≥ 64, p ≠ 2 (via omega). Hence the universe Z/pZ has no unique sums by finset_has_no_unique_sums_univ_zmod, showing that the collection of sizes of NUS subsets is nonempty. By Nat.sInf_mem, there is an NUS subset A whose cardinality equals m(p) = nus_min_card(p). Since every NUS set has cardinality at least 2, we have 2 ≤ m(p).
uses
finset_has_no_unique_sums_univ_zmod,Nat.sInf_memrefine ⟨1 / (32 * K ^ 2), by positivity, 64, fun p hp64 hpprime => ?_⟩ have hpne2 : p ≠ 2 := by intro hp2 subst hp2 omega have : Fact p.Prime := ⟨hpprime⟩ have hne : {k | ∃ A : Finset (ZMod p), finset_has_no_unique_sums A ∧ A.card = k}.Nonempty := ⟨(Finset.univ : Finset (ZMod p)).card, Finset.univ, finset_has_no_unique_sums_univ_zmod hpne2, rfl⟩ obtain ⟨A, hA_nus, hA_card⟩ := Nat.sInf_mem hne have hn2 : 2 ≤ (nus_min_card p : ℝ) := by have hcard : 2 ≤ A.card := hA_nus.1 rw [hA_card] at hcard exact_mod_cast hcard
For every prime p ≥ 64, log p > 4 (hence log p > 0) and log log p ≥ 1.
From 64 ≤ p via Nat.cast_le.mpr, monotonicity Real.log_le_log and Real.log_pow give log p ≥ log(2⁶) = 6 log 2. Since log 2 > 0.6931471803 by Real.log_two_gt_d9, linear arithmetic gives log p > 4 > 0. Applying the logarithm again gives log log p ≥ log 4 = 2 log 2 > 1.
uses
Nat.cast_le.mpr,Real.log_le_log,Real.log_pow,Real.log_two_gt_d9have hL_ge4 : 4 < Real.log (p : ℝ) := by have h1 : (64 : ℝ) ≤ (p : ℝ) := Nat.cast_le.mpr hp64 have h2 : Real.log 64 ≤ Real.log (p : ℝ) := Real.log_le_log (by norm_num) h1 have h3 : (64 : ℝ) = (2 : ℝ) ^ 6 := by norm_num rw [h3, Real.log_pow] at h2 have h4 := Real.log_two_gt_d9 have h2' : (6 : ℝ) * Real.log 2 ≤ Real.log (p : ℝ) := h2 linarith have hL_pos : 0 < Real.log (p : ℝ) := by linarith have hlogL : 1 ≤ Real.log (Real.log (p : ℝ)) := by have h4le : (4 : ℝ) ≤ Real.log (p : ℝ) := by linarith have hlog4 : Real.log 4 ≤ Real.log (Real.log (p : ℝ)) := Real.log_le_log (by norm_num) h4le have h4eq : (4 : ℝ) = (2 : ℝ) ^ 2 := by norm_num rw [h4eq, Real.log_pow] at hlog4 have h4 := Real.log_two_gt_d9 have hlog4' : (2 : ℝ) * Real.log 2 ≤ Real.log (Real.log (p : ℝ)) := hlog4 linarith
Applying the auxiliary lemma to L = log p and n = m(p) proves the near-quadratic lower bound for m(p).
Evaluating the assumed rank-Hadamard bound hbound on the minimal NUS set A gives log p ≤ K(√m(p) + m(p) / log p) log m(p). Because all conditions of the auxiliary lemma are satisfied (K ≥ 1, log p > 0, log log p ≥ 1, and m(p) ≥ 2), invoking nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_real concludes that (1/(32K²)) (log p / log log p)² ≤ m(p).
uses
nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_realhave hbound_A := hbound p hpprime A hA_nus rw [hA_card] at hbound_A exact nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_real K (Real.log (p : ℝ)) (nus_min_card p : ℝ) hK hL_pos hlogL hn2 hbound_A
not_le.mp- If a ≤ b is false, then b < a.
div_le_one- For positive b, a / b ≤ 1 if and only if a ≤ b.
div_pow- (a / b)ⁿ = aⁿ / bⁿ for any natural number n.
div_le_div_of_nonneg_left- For a ≥ 0 and 0 < c ≤ b, a / b ≤ a / c.
Real.log_lt_log- For 0 < x < y, log x < log y.
Real.log_pow- log(xⁿ) = n · log x for real x and natural n.
Real.log_pos- For x > 1, log x > 0.
mul_lt_mul_of_pos_right- If b < c and a > 0, then b · a < c · a.
div_lt_div_of_pos_left- If a > 0 and 0 < c < b, then a / b < a / c.
zero_lt_one- Zero is strictly less than one (0 < 1).
div_pos- If a > 0 and b > 0, then a / b > 0.
Real.sqrt_lt_sqrt- For 0 ≤ x < y, √x < √y.
Real.sqrt_sq- For x ≥ 0, √(x²) = x.
le_of_lt- If a < b, then a ≤ b.
mul_lt_mul_of_pos_left- If b < c and a > 0, then a · b < a · c.
add_lt_add- If a < b and c < d, then a + c < b + d.
finset_has_no_unique_sums_univ_zmod- For any prime p ≠ 2, the full group Z/pZ has no unique sums.
Nat.sInf_mem- A nonempty set of natural numbers contains its infimum (minimum).
Nat.cast_le.mpr- If m ≤ n for natural numbers, then m ≤ n when cast to real numbers.
Real.log_le_log- For 0 < x ≤ y, log x ≤ log y.
Real.log_two_gt_d9- The natural logarithm of 2 satisfies log 2 > 0.6931471803.
nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_real- For real numbers K ≥ 1, L > 0, log L ≥ 1, and n ≥ 2, if L ≤ K(√n + n/L)log n, then (1/(32K²))(L / log L)² ≤ n.
- The definition of m(p) as an infimum of cardinalities requires proving nonemptiness of the set of NUS subsets; Lean witnesses this nonemptiness using the full universe Finset.univ (i.e. Z/pZ itself) for p ≠ 2.
- The numerical logarithmic bounds log p > 4 and log log p ≥ 1 for p ≥ 64 are established formally using the Mathlib constant Real.log_two_gt_d9, which bounds log 2 from below by 0.6931471803.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
lemma nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_real (K L n : ℝ) (hK : 1 ≤ K) (hL : 0 < L) (hM : 1 ≤ Real.log L) (hn : 2 ≤ n) (h : L ≤ K * (Real.sqrt n + n / L) * Real.log n) : 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 ≤ n := by by_contra hcon have hn_lt : n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := not_le.mp hcon have hlogL_pos : 0 < Real.log L := by linarith have hK_pos : 0 < K := by linarith have hn_pos : 0 < n := by linarith -- Step 1: log n < 2 * log L have h1 : 1 / (32 * K ^ 2) ≤ 1 := by have : (1 : ℝ) ≤ 32 * K ^ 2 := by nlinarith rw [div_le_one (by positivity)] exact this have h2 : (L / Real.log L) ^ 2 ≤ L ^ 2 := by rw [div_pow] have : (1 : ℝ) ≤ (Real.log L) ^ 2 := by nlinarith have : L ^ 2 / (Real.log L) ^ 2 ≤ L ^ 2 / 1 := div_le_div_of_nonneg_left (by positivity) (by positivity) this linarith have hn_lt_Lsq : n < L ^ 2 := by calc n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := hn_lt _ ≤ 1 * L ^ 2 := by nlinarith _ = L ^ 2 := by ring have hlog_lt : Real.log n < 2 * Real.log L := by have hlog_lt' : Real.log n < Real.log (L ^ 2) := Real.log_lt_log hn_pos hn_lt_Lsq have hlog_Lsq : Real.log (L ^ 2) = 2 * Real.log L := by rw [Real.log_pow L 2] ring linarith have hlogn_pos : 0 < Real.log n := by have : (1 : ℝ) < n := by linarith exact Real.log_pos this -- Step 2: sqrt bound have htarget_pos : 0 < L / (4 * K * Real.log L) := by positivity have hsq2 : (L / (4 * K * Real.log L)) ^ 2 = 1 / (16 * K ^ 2) * (L / Real.log L) ^ 2 := by ring have hlt : n < (L / (4 * K * Real.log L)) ^ 2 := by rw [hsq2] calc n < 1 / (32 * K ^ 2) * (L / Real.log L) ^ 2 := hn_lt _ < 1 / (16 * K ^ 2) * (L / Real.log L) ^ 2 := by apply mul_lt_mul_of_pos_right · have : 16 * K ^ 2 < 32 * K ^ 2 := by nlinarith have : (0 : ℝ) < 16 * K ^ 2 := by positivity exact div_lt_div_of_pos_left zero_lt_one this (by nlinarith) · have : 0 < L / Real.log L := div_pos hL hlogL_pos positivity have hsqrt : Real.sqrt n < L / (4 * K * Real.log L) := by have hs := Real.sqrt_lt_sqrt (by linarith) hlt rw [Real.sqrt_sq (le_of_lt htarget_pos)] at hs exact hs have hsqrt_term : K * Real.log n * Real.sqrt n < L / 2 := by have hlt1 : K * Real.log n * Real.sqrt n < K * (2 * Real.log L) * Real.sqrt n := by have : 0 < K * Real.sqrt n := by positivity nlinarith have hlt2 : 2 * K * Real.log L * Real.sqrt n < 2 * K * Real.log L * (L / (4 * K * Real.log L)) := by have : 0 < 2 * K * Real.log L := by positivity exact mul_lt_mul_of_pos_left hsqrt this have heq : 2 * K * Real.log L * (L / (4 * K * Real.log L)) = L / 2 := by have hK0 : K ≠ 0 := by linarith have hlog0 : Real.log L ≠ 0 := by linarith field_simp ring linarith -- Step 3: n/L bound have hlin_term : K * Real.log n * (n / L) < L / 16 := by have hpos : 0 < 2 * K * Real.log L / L := by positivity have hstep1 : 2 * K * Real.log L * (n / L) = (2 * K * Real.log L / L) * n := by ring have hbound : 2 * K * Real.log L * (n / L) < L / 16 := by rw [hstep1] calc (2 * K * Real.log L / L) * n < (2 * K * Real.log L / L) * (1 / (32 * K ^ 2) * (L / Real.log L) ^ 2) := mul_lt_mul_of_pos_left hn_lt hpos _ = L / (16 * (K * Real.log L)) := by have h1 : K ≠ 0 := by linarith have h2 : Real.log L ≠ 0 := by linarith have h3 : L ≠ 0 := by linarith field_simp ring _ ≤ L / 16 := by have hKlog : 1 ≤ K * Real.log L := by nlinarith have hdenom : (16 : ℝ) ≤ 16 * (K * Real.log L) := by linarith exact div_le_div_of_nonneg_left (by linarith) (by positivity) hdenom have hstep2 : K * Real.log n * (n / L) ≤ 2 * K * Real.log L * (n / L) := by have : 0 < K * (n / L) := by positivity nlinarith linarith -- Step 4: combine have hcomb : K * (Real.sqrt n + n / L) * Real.log n < L := by calc K * (Real.sqrt n + n / L) * Real.log n = K * Real.log n * Real.sqrt n + K * Real.log n * (n / L) := by ring _ < L / 2 + L / 16 := add_lt_add hsqrt_term hlin_term _ = (9 / 16 : ℝ) * L := by ring _ < L := by linarith linarith/-- Assembly step, fully proved modulo the rank-Hadamard estimate: a rank-Hadamard bound with constant K yields m(p) ≥ (1/(32K²))(log p/log log p)² for p ≥ 64. -/theorem nus_min_card_ge_near_quadratic_of_rank_hadamard_bound (K : ℝ) (hK : 1 ≤ K) (hbound : ∀ (p : ℕ), p.Prime → ∀ A : Finset (ZMod p), finset_has_no_unique_sums A → Real.log p ≤ K * (Real.sqrt (A.card : ℝ) + (A.card : ℝ) / Real.log p) * Real.log (A.card : ℝ)) : ∃ C : ℝ, 0 < C ∧ ∃ p₀ : ℕ, ∀ p : ℕ, p₀ ≤ p → p.Prime → C * (Real.log p / Real.log (Real.log p)) ^ 2 ≤ (nus_min_card p : ℝ) := by refine ⟨1 / (32 * K ^ 2), by positivity, 64, fun p hp64 hpprime => ?_⟩ have hpne2 : p ≠ 2 := by intro hp2 subst hp2 omega have : Fact p.Prime := ⟨hpprime⟩ have hne : {k | ∃ A : Finset (ZMod p), finset_has_no_unique_sums A ∧ A.card = k}.Nonempty := ⟨(Finset.univ : Finset (ZMod p)).card, Finset.univ, finset_has_no_unique_sums_univ_zmod hpne2, rfl⟩ obtain ⟨A, hA_nus, hA_card⟩ := Nat.sInf_mem hne have hn2 : 2 ≤ (nus_min_card p : ℝ) := by have hcard : 2 ≤ A.card := hA_nus.1 rw [hA_card] at hcard exact_mod_cast hcard have hL_ge4 : 4 < Real.log (p : ℝ) := by have h1 : (64 : ℝ) ≤ (p : ℝ) := Nat.cast_le.mpr hp64 have h2 : Real.log 64 ≤ Real.log (p : ℝ) := Real.log_le_log (by norm_num) h1 have h3 : (64 : ℝ) = (2 : ℝ) ^ 6 := by norm_num rw [h3, Real.log_pow] at h2 have h4 := Real.log_two_gt_d9 have h2' : (6 : ℝ) * Real.log 2 ≤ Real.log (p : ℝ) := h2 linarith have hL_pos : 0 < Real.log (p : ℝ) := by linarith have hlogL : 1 ≤ Real.log (Real.log (p : ℝ)) := by have h4le : (4 : ℝ) ≤ Real.log (p : ℝ) := by linarith have hlog4 : Real.log 4 ≤ Real.log (Real.log (p : ℝ)) := Real.log_le_log (by norm_num) h4le have h4eq : (4 : ℝ) = (2 : ℝ) ^ 2 := by norm_num rw [h4eq, Real.log_pow] at hlog4 have h4 := Real.log_two_gt_d9 have hlog4' : (2 : ℝ) * Real.log 2 ≤ Real.log (Real.log (p : ℝ)) := hlog4 linarith have hbound_A := hbound p hpprime A hA_nus rw [hA_card] at hbound_A exact nus_min_card_ge_near_quadratic_of_rank_hadamard_bound_aux_real K (Real.log (p : ℝ)) (nus_min_card p : ℝ) hK hL_pos hlogL hn2 hbound_A