theoremnat_population_card_le_diameter (S : Finsetℕ) (D : ℕ)
(hdiam : ∀ a ∈S, ∀ b ∈S, Nat.dist a b ≤D) : S.card ≤D + 1:=by
proof · 13
lines
by_cases hS : S.Nonempty
· let a :=S.min' hS
haveha : a ∈S:=Finset.min'_mem S hS
havehsub : S⊆Finset.Icc a (a + D) :=by
intro b hb
havehab : a ≤ b :=Finset.min'_le S b hb
have hd := hdiam a ha b hb
rw [Nat.dist_eq_sub_of_le hab] at hd
exact Finset.mem_Icc.mpr ⟨hab, by omega⟩
have hc :=Finset.card_le_card hsub
simp only [Nat.card_Icc] at hc
omega
· simp [Finset.not_nonempty_iff_eq_empty.mp hS]
theoremkernel_population_card_le (S : Finsetℤ) (root : ℤ→ℕ)
(m D : ℕ) (hm : 0 < m) (h u : ℤ) (hu : u ≠0) (X : ℝ)
(hroot : ∀ x ∈S, u * (root x : ℤ) ^ 2 = (m : ℤ) * x - h)
(hspan : ∀ x ∈S, ∀ y ∈S, |((x - y : ℤ) : ℝ)| ≤X)
(hD : Real.sqrt ((m : ℝ) * X / |(u : ℝ)|) ≤D) : S.card ≤D + 1:=by
proof · 3
lines
rw [← kernelRootPopulation_card S root m hm h u hroot]
exact nat_population_card_le_diameter _ D
(kernelRootPopulation_diameter S root m D h u hu X hroot hspan hD)
There are at most K(D+1) points in the union of the large-kernel fibers,
where K is the number of distinct kernels. A subpower common denominator
can be retained in D, so no stronger root-count theorem is needed here.
theoremlarge_kernel_points_card_le (S : Finsetℤ) (kernel : ℤ→ℤ) (root : ℤ→ℕ)
(m D : ℕ) (hm : 0 < m) (h : ℤ) (XH : ℝ) (hX : 0≤X) (hH : 0 < H)
(hroot : ∀ x ∈S, kernel x * (root x : ℤ) ^ 2 = (m : ℤ) * x - h)
(hspan : ∀ x ∈S, ∀ y ∈S, |((x - y : ℤ) : ℝ)| ≤X)
(hD : Real.sqrt ((m : ℝ) * X / H) ≤D) :
(S.filter (fun x =>H < |(kernel x : ℝ)|)).card ≤ (S.image kernel).card * (D + 1) :=by
proof · 26
lines
letR:=S.filter fun x =>H < |(kernel x : ℝ)|
havehRS : R⊆S:=Finset.filter_subset _ _
have hfiber (u : ℤ) (hu : u ∈R.image kernel) :
(R.filter fun x => kernel x = u).card ≤D + 1:=by
obtain ⟨x, hx, hxu⟩ :=Finset.mem_image.mp hu
havehlarge : H < |(u : ℝ)| :=byhave hx' := (Finset.mem_filter.mp hx).2
rwa [hxu] at hx'
havehu0 : u ≠0:=by
intro hu0
simp only [hu0, Int.cast_zero, abs_zero] at hlarge
linarith
apply kernel_population_card_le _ root m D hm h u hu0 X
· intro y hy
obtain ⟨hyR, heq⟩ :=Finset.mem_filter.mp hy
simpa only [heq] using hroot y (hRS hyR)
· intro y hy z hz
exact hspan y (hRS (Finset.mem_filter.mp hy).1) z (hRS (Finset.mem_filter.mp hz).1)
· apply (Real.sqrt_le_sqrt ?_).trans hD
exact div_le_div_of_nonneg_left (mul_nonneg (Nat.cast_nonneg m) hX) hH hlarge.le
havehcount : R.card ≤ (R.image kernel).card * (D + 1) :=by
rw [Finset.card_eq_sum_card_image kernel R]
simpa usingFinset.sum_le_card_nsmul (R.image kernel)
(fun u => (R.filter fun x => kernel x = u).card) (D + 1) hfiber
exact hcount.trans (Nat.mul_le_mul_right (D + 1)
(Finset.card_le_card (Finset.image_subset_image hRS)))