Skip to content

Commit 3383476

Browse files
committed
feat: generalize Siegel's lemma to A = 0 (#14852)
The Wikipedia statement of Siegel's lemma did not contain the hypothesis `A != 0` in the lean formalization. A slight variant of the statement is still true if `A = 0`. The original statement is recovered under the assumption `A != 0`. Co-authored-by: Michail Karatarakis <40603357+mkaratarakis@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
1 parent cb4fdfb commit 3383476

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

Mathlib/NumberTheory/SiegelsLemma.lean

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variable {α β : Type _} [Fintype α] [Fintype β] [DecidableEq β] [DecidableE
4646
local notation3 "m" => Fintype.card α
4747
local notation3 "n" => Fintype.card β
4848
local notation3 "e" => m / ((n : ℝ) - m) -- exponent
49-
local notation3 "B" => Nat.floor (((n : ℝ) * ‖A‖) ^ e)
49+
local notation3 "B" => Nat.floor (((n : ℝ) * max 1 ‖A‖) ^ e)
5050
-- B' is the vector with all components = B
5151
local notation3 "B'" => fun _ : β => (B : ℤ)
5252
-- T is the box [0 B]^n
@@ -116,10 +116,8 @@ private lemma card_S_eq : (Finset.Icc N P).card = ∏ i : α, (P i - N i + 1) :=
116116
rw [Int.card_Icc_of_le (N i) (P i) (N_le_P_add_one A i)]
117117
exact add_sub_right_comm (P i) 1 (N i)
118118

119-
variable (hA : A ≠ 0)
120-
121119
/-- The sup norm of a non-zero integer matrix is at least one -/
122-
lemma one_le_norm_A_of_ne_zero : 1 ≤ ‖A‖ := by
120+
lemma one_le_norm_A_of_ne_zero (hA : A ≠ 0) : 1 ≤ ‖A‖ := by
123121
by_contra! h
124122
apply hA
125123
ext i j
@@ -140,49 +138,49 @@ private lemma card_S_lt_card_T : (S).card < (T).card := by
140138
rify -- This is necessary because ‖A‖ is a real number
141139
calc
142140
∏ x : α, (∑ x_1 : β, ↑B * ↑(A x x_1)⁺ - ∑ x_1 : β, ↑B * -↑(A x x_1)⁻ + 1)
143-
≤ ∏ x : α, (n * ‖A‖ * B + 1) := by
141+
≤ ∏ x : α, (n * max 1 ‖A‖ * B + 1) := by
144142
refine Finset.prod_le_prod (fun i _ ↦ ?_) (fun i _ ↦ ?_)
145143
· have h := N_le_P_add_one A i
146144
rify at h
147145
linarith only [h]
148146
· simp only [mul_neg, sum_neg_distrib, sub_neg_eq_add, add_le_add_iff_right]
149-
have h1 : n * ‖A‖ * B = ∑ _ : β, ‖A‖ * B := by
147+
have h1 : n * max 1 ‖A‖ * B = ∑ _ : β, max 1 ‖A‖ * B := by
150148
simp only [sum_const, card_univ, nsmul_eq_mul]
151149
ring
152-
simp_rw [h1, ← Finset.sum_add_distrib, ← mul_add, mul_comm ‖A‖, ← Int.cast_add]
150+
simp_rw [h1, ← Finset.sum_add_distrib, ← mul_add, mul_comm (max 1 ‖A‖), ← Int.cast_add]
153151
gcongr with j _
154152
rw [posPart_add_negPart (A i j), Int.cast_abs]
155-
exact norm_entry_le_entrywise_sup_norm A
156-
_ = (n * ‖A‖ * B + 1) ^ m := by simp only [prod_const, card_univ]
157-
_ ≤ (n * ‖A‖) ^ m * (B + 1) ^ m := by
153+
exact le_trans (norm_entry_le_entrywise_sup_norm A) (le_max_right ..)
154+
_ = (n * max 1 ‖A‖ * B + 1) ^ m := by simp only [prod_const, card_univ]
155+
_ ≤ (n * max 1 ‖A‖) ^ m * (B + 1) ^ m := by
158156
rw [← mul_pow, mul_add, mul_one]
159157
gcongr
160158
have H : 1 ≤ (n : ℝ) := mod_cast (hm.trans hn)
161-
exact one_le_mul_of_one_le_of_one_le H <| one_le_norm_A_of_ne_zero A hA
162-
_ = ((n * ‖A‖) ^ (m / ((n : ℝ) - m))) ^ ((n : ℝ) - m) * (B + 1) ^ m := by
159+
exact one_le_mul_of_one_le_of_one_le H <| le_max_left ..
160+
_ = ((n * max 1 ‖A‖) ^ (m / ((n : ℝ) - m))) ^ ((n : ℝ) - m) * (B + 1) ^ m := by
163161
congr 1
164-
rw [← rpow_mul (mul_nonneg (Nat.cast_nonneg' n) (norm_nonneg A)), ← Real.rpow_natCast,
165-
div_mul_cancel₀]
162+
rw [← rpow_mul (mul_nonneg (Nat.cast_nonneg' n) (le_trans zero_le_one (le_max_left ..))),
163+
← Real.rpow_natCast, div_mul_cancel₀]
166164
exact sub_ne_zero_of_ne (mod_cast hn.ne')
167165
_ < (B + 1) ^ ((n : ℝ) - m) * (B + 1) ^ m := by
168166
gcongr
169167
· exact sub_pos.mpr (mod_cast hn)
170-
· exact Nat.lt_floor_add_one ((n * ‖A‖) ^ e)
168+
· exact Nat.lt_floor_add_one ((n * max 1 ‖A‖) ^ e)
171169
_ = (B + 1) ^ n := by
172170
rw [← rpow_natCast, ← rpow_add (Nat.cast_add_one_pos B), ← rpow_natCast, sub_add_cancel]
173171

174172
end preparation
175173

176-
theorem exists_ne_zero_int_vec_norm_le (hA_nezero : A ≠ 0) : ∃ t : β → ℤ, t ≠ 0
177-
A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * ‖A‖) ^ ((m : ℝ) / (n - m)) := by
174+
theorem exists_ne_zero_int_vec_norm_le : ∃ t : β → ℤ, t ≠ 0
175+
A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * max 1 ‖A‖) ^ ((m : ℝ) / (n - m)) := by
178176
-- Pigeonhole
179177
rcases Finset.exists_ne_map_eq_of_card_lt_of_maps_to
180-
(card_S_lt_card_T A hn hm hA_nezero) (image_T_subset_S A)
178+
(card_S_lt_card_T A hn hm) (image_T_subset_S A)
181179
with ⟨x, hxT, y, hyT, hneq, hfeq⟩
182180
-- Proofs that x - y ≠ 0 and x - y is a solution
183181
refine ⟨x - y, sub_ne_zero.mpr hneq, by simp only [mulVec_sub, sub_eq_zero, hfeq], ?_⟩
184182
-- Inequality
185-
have n_mul_norm_A_pow_e_nonneg : 0 ≤ (n * ‖A‖) ^ e := by positivity
183+
have n_mul_norm_A_pow_e_nonneg : 0 ≤ (n * max 1 ‖A‖) ^ e := by positivity
186184
rw [← norm_col (ι := Unit), norm_le_iff n_mul_norm_A_pow_e_nonneg]
187185
intro i j
188186
simp only [col_apply, Pi.sub_apply]
@@ -203,4 +201,11 @@ theorem exists_ne_zero_int_vec_norm_le (hA_nezero : A ≠ 0) : ∃ t : β →
203201
simp only [le_add_iff_nonneg_right]
204202
exact hyT.1 i
205203

204+
205+
theorem exists_ne_zero_int_vec_norm_le' (hA : A ≠ 0) : ∃ t : β → ℤ, t ≠ 0
206+
A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * ‖A‖) ^ ((m : ℝ) / (n - m)) := by
207+
have := exists_ne_zero_int_vec_norm_le A hn hm
208+
rwa [max_eq_right] at this
209+
exact Int.Matrix.one_le_norm_A_of_ne_zero _ hA
210+
206211
end Int.Matrix

0 commit comments

Comments
 (0)