|
| 1 | +/- |
| 2 | +Copyright (c) 2022 Oliver Nash. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Oliver Nash |
| 5 | +
|
| 6 | +! This file was ported from Lean 3 source module number_theory.well_approximable |
| 7 | +! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9 |
| 8 | +! Please do not edit these lines, except to modify the commit id |
| 9 | +! if you have ported upstream changes. |
| 10 | +-/ |
| 11 | +import Mathlib.Dynamics.Ergodic.AddCircle |
| 12 | +import Mathlib.MeasureTheory.Covering.LiminfLimsup |
| 13 | + |
| 14 | +/-! |
| 15 | +# Well-approximable numbers and Gallagher's ergodic theorem |
| 16 | +
|
| 17 | +Gallagher's ergodic theorem is a result in metric number theory. It thus belongs to that branch of |
| 18 | +mathematics concerning arithmetic properties of real numbers which hold almost eveywhere with |
| 19 | +respect to the Lebesgue measure. |
| 20 | +
|
| 21 | +Gallagher's theorem concerns the approximation of real numbers by rational numbers. The input is a |
| 22 | +sequence of distances `δ₁, δ₂, ...`, and the theorem concerns the set of real numbers `x` for which |
| 23 | +there is an infinity of solutions to: |
| 24 | +$$ |
| 25 | + |x - m/n| < δₙ, |
| 26 | +$$ |
| 27 | +where the rational number `m/n` is in lowest terms. The result is that for any `δ`, this set is |
| 28 | +either almost all `x` or almost no `x`. |
| 29 | +
|
| 30 | +This result was proved by Gallagher in 1959 |
| 31 | +[P. Gallagher, *Approximation by reduced fractions*](Gallagher1961). It is formalised here as |
| 32 | +`AddCircle.addWellApproximable_ae_empty_or_univ` except with `x` belonging to the circle `ℝ ⧸ ℤ` |
| 33 | +since this turns out to be more natural. |
| 34 | +
|
| 35 | +Given a particular `δ`, the Duffin-Schaeffer conjecture (now a theorem) gives a criterion for |
| 36 | +deciding which of the two cases in the conclusion of Gallagher's theorem actually occurs. It was |
| 37 | +proved by Koukoulopoulos and Maynard in 2019 |
| 38 | +[D. Koukoulopoulos, J. Maynard, *On the Duffin-Schaeffer conjecture*](KoukoulopoulosMaynard2020). |
| 39 | +We do *not* include a formalisation of the Koukoulopoulos-Maynard result here. |
| 40 | +
|
| 41 | +## Main definitions and results: |
| 42 | +
|
| 43 | + * `approxOrderOf`: in a seminormed group `A`, given `n : ℕ` and `δ : ℝ`, `approxOrderOf A n δ` |
| 44 | + is the set of elements within a distance `δ` of a point of order `n`. |
| 45 | + * `wellApproximable`: in a seminormed group `A`, given a sequence of distances `δ₁, δ₂, ...`, |
| 46 | + `wellApproximable A δ` is the limsup as `n → ∞` of the sets `approxOrderOf A n δₙ`. Thus, it |
| 47 | + is the set of points that lie in infinitely many of the sets `approxOrderOf A n δₙ`. |
| 48 | + * `AddCircle.addWellApproximable_ae_empty_or_univ`: *Gallagher's ergodic theorem* says that for |
| 49 | + for the (additive) circle `𝕊`, for any sequence of distances `δ`, the set |
| 50 | + `addWellApproximable 𝕊 δ` is almost empty or almost full. |
| 51 | +
|
| 52 | +## TODO: |
| 53 | +
|
| 54 | +The hypothesis `hδ` in `AddCircle.addWellApproximable_ae_empty_or_univ` can be dropped. |
| 55 | +An elementary (non-measure-theoretic) argument shows that if `¬ hδ` holds then |
| 56 | +`addWellApproximable 𝕊 δ = univ` (provided `δ` is non-negative). |
| 57 | +-/ |
| 58 | + |
| 59 | + |
| 60 | +open Set Filter Function Metric MeasureTheory |
| 61 | + |
| 62 | +open scoped MeasureTheory Topology Pointwise |
| 63 | + |
| 64 | +/-- In a seminormed group `A`, given `n : ℕ` and `δ : ℝ`, `approxOrderOf A n δ` is the set of |
| 65 | +elements within a distance `δ` of a point of order `n`. -/ |
| 66 | +@[to_additive "In a seminormed additive group `A`, given `n : ℕ` and `δ : ℝ`, |
| 67 | +`approxAddOrderOf A n δ` is the set of elements within a distance `δ` of a point of order `n`."] |
| 68 | +def approxOrderOf (A : Type _) [SeminormedGroup A] (n : ℕ) (δ : ℝ) : Set A := |
| 69 | + thickening δ {y | orderOf y = n} |
| 70 | +#align approx_order_of approxOrderOf |
| 71 | +#align approx_add_order_of approxAddOrderOf |
| 72 | + |
| 73 | +@[to_additive mem_approx_add_orderOf_iff] |
| 74 | +theorem mem_approxOrderOf_iff {A : Type _} [SeminormedGroup A] {n : ℕ} {δ : ℝ} {a : A} : |
| 75 | + a ∈ approxOrderOf A n δ ↔ ∃ b : A, orderOf b = n ∧ a ∈ ball b δ := by |
| 76 | + simp only [approxOrderOf, thickening_eq_biUnion_ball, mem_iUnion₂, mem_setOf_eq, exists_prop] |
| 77 | +#align mem_approx_order_of_iff mem_approxOrderOf_iff |
| 78 | +#align mem_approx_add_order_of_iff mem_approx_add_orderOf_iff |
| 79 | + |
| 80 | +/-- In a seminormed group `A`, given a sequence of distances `δ₁, δ₂, ...`, `wellApproximable A δ` |
| 81 | +is the limsup as `n → ∞` of the sets `approxOrderOf A n δₙ`. Thus, it is the set of points that |
| 82 | +lie in infinitely many of the sets `approxOrderOf A n δₙ`. -/ |
| 83 | +@[to_additive addWellApproximable "In a seminormed additive group `A`, given a sequence of |
| 84 | +distances `δ₁, δ₂, ...`, `addWellApproximable A δ` is the limsup as `n → ∞` of the sets |
| 85 | +`approxAddOrderOf A n δₙ`. Thus, it is the set of points that lie in infinitely many of the sets |
| 86 | +`approxAddOrderOf A n δₙ`."] |
| 87 | +def wellApproximable (A : Type _) [SeminormedGroup A] (δ : ℕ → ℝ) : Set A := |
| 88 | + blimsup (fun n => approxOrderOf A n (δ n)) atTop fun n => 0 < n |
| 89 | +#align well_approximable wellApproximable |
| 90 | +#align add_well_approximable addWellApproximable |
| 91 | + |
| 92 | +@[to_additive mem_add_wellApproximable_iff] |
| 93 | +theorem mem_wellApproximable_iff {A : Type _} [SeminormedGroup A] {δ : ℕ → ℝ} {a : A} : |
| 94 | + a ∈ wellApproximable A δ ↔ |
| 95 | + a ∈ blimsup (fun n => approxOrderOf A n (δ n)) atTop fun n => 0 < n := |
| 96 | + Iff.rfl |
| 97 | +#align mem_well_approximable_iff mem_wellApproximable_iff |
| 98 | +#align mem_add_well_approximable_iff mem_add_wellApproximable_iff |
| 99 | + |
| 100 | +namespace approxOrderOf |
| 101 | + |
| 102 | +variable {A : Type _} [SeminormedCommGroup A] {a : A} {m n : ℕ} (δ : ℝ) |
| 103 | + |
| 104 | +@[to_additive] |
| 105 | +theorem image_pow_subset_of_coprime (hm : 0 < m) (hmn : n.coprime m) : |
| 106 | + (fun (y : A) => y ^ m) '' approxOrderOf A n δ ⊆ approxOrderOf A n (m * δ) := by |
| 107 | + rintro - ⟨a, ha, rfl⟩ |
| 108 | + obtain ⟨b, hb, hab⟩ := mem_approxOrderOf_iff.mp ha |
| 109 | + replace hb : b ^ m ∈ {u : A | orderOf u = n} := by |
| 110 | + rw [← hb] at hmn ⊢; exact orderOf_pow_coprime hmn |
| 111 | + apply ball_subset_thickening hb ((m : ℝ) • δ) |
| 112 | + convert pow_mem_ball hm hab using 1 |
| 113 | + simp only [nsmul_eq_mul, Algebra.id.smul_eq_mul] |
| 114 | +#align approx_order_of.image_pow_subset_of_coprime approxOrderOf.image_pow_subset_of_coprime |
| 115 | +#align approx_add_order_of.image_nsmul_subset_of_coprime approxAddOrderOf.image_nsmul_subset_of_coprime |
| 116 | + |
| 117 | +@[to_additive] |
| 118 | +theorem image_pow_subset (n : ℕ) (hm : 0 < m) : |
| 119 | + (fun (y : A) => y ^ m) '' approxOrderOf A (n * m) δ ⊆ approxOrderOf A n (m * δ) := by |
| 120 | + rintro - ⟨a, ha, rfl⟩ |
| 121 | + obtain ⟨b, hb : orderOf b = n * m, hab : a ∈ ball b δ⟩ := mem_approxOrderOf_iff.mp ha |
| 122 | + replace hb : b ^ m ∈ {y : A | orderOf y = n} |
| 123 | + · rw [mem_setOf_eq, orderOf_pow' b hm.ne', hb, Nat.gcd_mul_left_left, n.mul_div_cancel hm] |
| 124 | + apply ball_subset_thickening hb (m * δ) |
| 125 | + convert pow_mem_ball hm hab using 1 |
| 126 | + simp only [nsmul_eq_mul] |
| 127 | +#align approx_order_of.image_pow_subset approxOrderOf.image_pow_subset |
| 128 | +#align approx_add_order_of.image_nsmul_subset approxAddOrderOf.image_nsmul_subset |
| 129 | + |
| 130 | +@[to_additive] |
| 131 | +theorem smul_subset_of_coprime (han : (orderOf a).coprime n) : |
| 132 | + a • approxOrderOf A n δ ⊆ approxOrderOf A (orderOf a * n) δ := by |
| 133 | + simp_rw [approxOrderOf, thickening_eq_biUnion_ball, ← image_smul, image_iUnion₂, image_smul, |
| 134 | + smul_ball'', smul_eq_mul, mem_setOf_eq] |
| 135 | + refine' iUnion₂_subset_iff.mpr fun b hb c hc => _ |
| 136 | + simp only [mem_iUnion, exists_prop] |
| 137 | + refine' ⟨a * b, _, hc⟩ |
| 138 | + rw [← hb] at han ⊢ |
| 139 | + exact (Commute.all a b).orderOf_mul_eq_mul_orderOf_of_coprime han |
| 140 | +#align approx_order_of.smul_subset_of_coprime approxOrderOf.smul_subset_of_coprime |
| 141 | +#align approx_add_order_of.vadd_subset_of_coprime approxAddOrderOf.vadd_subset_of_coprime |
| 142 | + |
| 143 | +@[to_additive vadd_eq_of_mul_dvd] |
| 144 | +theorem smul_eq_of_mul_dvd (hn : 0 < n) (han : orderOf a ^ 2 ∣ n) : |
| 145 | + a • approxOrderOf A n δ = approxOrderOf A n δ := by |
| 146 | + simp_rw [approxOrderOf, thickening_eq_biUnion_ball, ← image_smul, image_iUnion₂, image_smul, |
| 147 | + smul_ball'', smul_eq_mul, mem_setOf_eq] |
| 148 | + replace han : ∀ {b : A}, orderOf b = n → orderOf (a * b) = n |
| 149 | + · intro b hb |
| 150 | + rw [← hb] at han hn |
| 151 | + rw [sq] at han |
| 152 | + rwa [(Commute.all a b).orderOf_mul_eq_right_of_forall_prime_mul_dvd (orderOf_pos_iff.mp hn) |
| 153 | + fun p _ hp' => dvd_trans (mul_dvd_mul_right hp' <| orderOf a) han] |
| 154 | + let f : {b : A | orderOf b = n} → {b : A | orderOf b = n} := fun b => ⟨a * b, han b.property⟩ |
| 155 | + have hf : Surjective f := by |
| 156 | + rintro ⟨b, hb⟩ |
| 157 | + refine' ⟨⟨a⁻¹ * b, _⟩, _⟩ |
| 158 | + · rw [mem_setOf_eq, ← orderOf_inv, mul_inv_rev, inv_inv, mul_comm] |
| 159 | + apply han |
| 160 | + simpa |
| 161 | + · simp only [Subtype.mk_eq_mk, Subtype.coe_mk, mul_inv_cancel_left] |
| 162 | + simpa only [mem_setOf_eq, Subtype.coe_mk, iUnion_coe_set] using |
| 163 | + hf.iUnion_comp fun b => ball (b : A) δ |
| 164 | +#align approx_order_of.smul_eq_of_mul_dvd approxOrderOf.smul_eq_of_mul_dvd |
| 165 | +#align approx_add_order_of.vadd_eq_of_mul_dvd approxAddOrderOf.vadd_eq_of_mul_dvd |
| 166 | + |
| 167 | +end approxOrderOf |
| 168 | + |
| 169 | +namespace UnitAddCircle |
| 170 | + |
| 171 | +theorem mem_approxAddOrderOf_iff {δ : ℝ} {x : UnitAddCircle} {n : ℕ} (hn : 0 < n) : |
| 172 | + x ∈ approxAddOrderOf UnitAddCircle n δ ↔ ∃ m < n, gcd m n = 1 ∧ ‖x - ↑((m : ℝ) / n)‖ < δ := by |
| 173 | + haveI := Real.fact_zero_lt_one |
| 174 | + simp only [mem_approx_add_orderOf_iff, mem_setOf_eq, ball, exists_prop, dist_eq_norm, |
| 175 | + AddCircle.addOrderOf_eq_pos_iff hn, mul_one] |
| 176 | + constructor |
| 177 | + · rintro ⟨y, ⟨m, hm₁, hm₂, rfl⟩, hx⟩; exact ⟨m, hm₁, hm₂, hx⟩ |
| 178 | + · rintro ⟨m, hm₁, hm₂, hx⟩; exact ⟨↑((m : ℝ) / n), ⟨m, hm₁, hm₂, rfl⟩, hx⟩ |
| 179 | +#align unit_add_circle.mem_approx_add_order_of_iff UnitAddCircle.mem_approxAddOrderOf_iff |
| 180 | + |
| 181 | +theorem mem_addWellApproximable_iff (δ : ℕ → ℝ) (x : UnitAddCircle) : |
| 182 | + x ∈ addWellApproximable UnitAddCircle δ ↔ |
| 183 | + {n : ℕ | ∃ m < n, gcd m n = 1 ∧ ‖x - ↑((m : ℝ) / n)‖ < δ n}.Infinite := by |
| 184 | + simp only [mem_add_wellApproximable_iff, ← Nat.cofinite_eq_atTop, cofinite.blimsup_set_eq, |
| 185 | + mem_setOf_eq] |
| 186 | + refine' iff_of_eq (congr_arg Set.Infinite <| ext fun n => ⟨fun hn => _, fun hn => _⟩) |
| 187 | + · exact (mem_approxAddOrderOf_iff hn.1).mp hn.2 |
| 188 | + · have h : 0 < n := by obtain ⟨m, hm₁, _, _⟩ := hn; exact pos_of_gt hm₁ |
| 189 | + exact ⟨h, (mem_approxAddOrderOf_iff h).mpr hn⟩ |
| 190 | +#align unit_add_circle.mem_add_well_approximable_iff UnitAddCircle.mem_addWellApproximable_iff |
| 191 | + |
| 192 | +end UnitAddCircle |
| 193 | + |
| 194 | +namespace AddCircle |
| 195 | + |
| 196 | +variable {T : ℝ} [hT : Fact (0 < T)] |
| 197 | + |
| 198 | +local notation a "∤" b => ¬a ∣ b |
| 199 | + |
| 200 | +local notation a "∣∣" b => a ∣ b ∧ (a * a)∤b |
| 201 | + |
| 202 | +local notation "𝕊" => AddCircle T |
| 203 | + |
| 204 | +/-- **Gallagher's ergodic theorem** on Diophantine approximation. -/ |
| 205 | +theorem addWellApproximable_ae_empty_or_univ (δ : ℕ → ℝ) (hδ : Tendsto δ atTop (𝓝 0)) : |
| 206 | + (∀ᵐ x, ¬addWellApproximable 𝕊 δ x) ∨ ∀ᵐ x, addWellApproximable 𝕊 δ x := by |
| 207 | + /- Sketch of proof: |
| 208 | +
|
| 209 | + Let `E := addWellApproximable 𝕊 δ`. For each prime `p : ℕ`, we can partition `E` into three |
| 210 | + pieces `E = (A p) ∪ (B p) ∪ (C p)` where: |
| 211 | + `A p = blimsup (approxAddOrderOf 𝕊 n (δ n)) atTop (fun n => 0 < n ∧ (p ∤ n))` |
| 212 | + `B p = blimsup (approxAddOrderOf 𝕊 n (δ n)) atTop (fun n => 0 < n ∧ (p ∣∣ n))` |
| 213 | + `C p = blimsup (approxAddOrderOf 𝕊 n (δ n)) atTop (fun n => 0 < n ∧ (p*p ∣ n))`. |
| 214 | + In other words, `A p` is the set of points `x` for which there exist infinitely-many `n` such |
| 215 | + that `x` is within a distance `δ n` of a point of order `n` and `p ∤ n`. Similarly for `B`, `C`. |
| 216 | +
|
| 217 | + These sets have the following key properties: |
| 218 | + 1. `A p` is almost invariant under the ergodic map `y ↦ p • y` |
| 219 | + 2. `B p` is almost invariant under the ergodic map `y ↦ p • y + 1/p` |
| 220 | + 3. `C p` is invariant under the map `y ↦ y + 1/p` |
| 221 | + To prove 1 and 2 we need the key result `blimsup_thickening_mul_ae_eq` but 3 is elementary. |
| 222 | +
|
| 223 | + It follows from `AddCircle.ergodic_nsmul_add` and `Ergodic.ae_empty_or_univ_of_image_ae_le` that |
| 224 | + if either `A p` or `B p` is not almost empty for any `p`, then it is almost full and thus so is |
| 225 | + `E`. We may therefore assume that `A p` and `B p` are almost empty for all `p`. We thus have |
| 226 | + `E` is almost equal to `C p` for every prime. Combining this with 3 we find that `E` is almost |
| 227 | + invariant under the map `y ↦ y + 1/p` for every prime `p`. The required result then follows from |
| 228 | + `AddCircle.ae_empty_or_univ_of_forall_vadd_ae_eq_self`. -/ |
| 229 | + letI : SemilatticeSup Nat.Primes := Nat.Subtype.semilatticeSup _ |
| 230 | + set μ : Measure 𝕊 := volume |
| 231 | + set u : Nat.Primes → 𝕊 := fun p => ↑((↑(1 : ℕ) : ℝ) / p * T) |
| 232 | + have hu₀ : ∀ p : Nat.Primes, addOrderOf (u p) = (p : ℕ) := by |
| 233 | + rintro ⟨p, hp⟩; exact addOrderOf_div_of_gcd_eq_one hp.pos (gcd_one_left p) |
| 234 | + have hu : Tendsto (addOrderOf ∘ u) atTop atTop := by |
| 235 | + rw [(funext hu₀ : addOrderOf ∘ u = (↑))] |
| 236 | + have h_mono : Monotone ((↑) : Nat.Primes → ℕ) := fun p q hpq => hpq |
| 237 | + refine' h_mono.tendsto_atTop_atTop fun n => _ |
| 238 | + obtain ⟨p, hp, hp'⟩ := n.exists_infinite_primes |
| 239 | + exact ⟨⟨p, hp'⟩, hp⟩ |
| 240 | + set E := addWellApproximable 𝕊 δ |
| 241 | + set X : ℕ → Set 𝕊 := fun n => approxAddOrderOf 𝕊 n (δ n) |
| 242 | + set A : ℕ → Set 𝕊 := fun p => blimsup X atTop fun n => 0 < n ∧ p∤n |
| 243 | + set B : ℕ → Set 𝕊 := fun p => blimsup X atTop fun n => 0 < n ∧ p∣∣n |
| 244 | + set C : ℕ → Set 𝕊 := fun p => blimsup X atTop fun n => 0 < n ∧ p ^ 2 ∣ n |
| 245 | + have hA₀ : ∀ p, MeasurableSet (A p) := fun p => |
| 246 | + MeasurableSet.measurableSet_blimsup fun n _ => isOpen_thickening.measurableSet |
| 247 | + have hB₀ : ∀ p, MeasurableSet (B p) := fun p => |
| 248 | + MeasurableSet.measurableSet_blimsup fun n _ => isOpen_thickening.measurableSet |
| 249 | + have hE₀ : NullMeasurableSet E μ := by |
| 250 | + refine' (MeasurableSet.measurableSet_blimsup fun n hn => |
| 251 | + IsOpen.measurableSet _).nullMeasurableSet |
| 252 | + exact isOpen_thickening |
| 253 | + have hE₁ : ∀ p, E = A p ∪ B p ∪ C p := by |
| 254 | + intro p |
| 255 | + simp only [addWellApproximable, ← blimsup_or_eq_sup, ← and_or_left, ← sup_eq_union, sq] |
| 256 | + congr |
| 257 | + refine' funext fun n => propext <| iff_self_and.mpr fun _ => _ |
| 258 | + -- `tauto` can finish from here but unfortunately it's very slow. |
| 259 | + simp only [(em (p ∣ n)).symm, (em (p * p ∣ n)).symm, or_and_left, or_true_iff, true_and_iff, |
| 260 | + or_assoc] |
| 261 | + have hE₂ : ∀ p : Nat.Primes, A p =ᵐ[μ] (∅ : Set 𝕊) ∧ B p =ᵐ[μ] (∅ : Set 𝕊) → E =ᵐ[μ] C p := by |
| 262 | + rintro p ⟨hA, hB⟩ |
| 263 | + rw [hE₁ p] |
| 264 | + exact union_ae_eq_right_of_ae_eq_empty ((union_ae_eq_right_of_ae_eq_empty hA).trans hB) |
| 265 | + have hA : ∀ p : Nat.Primes, A p =ᵐ[μ] (∅ : Set 𝕊) ∨ A p =ᵐ[μ] univ := by |
| 266 | + rintro ⟨p, hp⟩ |
| 267 | + let f : 𝕊 → 𝕊 := fun y => (p : ℕ) • y |
| 268 | + suffices |
| 269 | + f '' A p ⊆ blimsup (fun n => approxAddOrderOf 𝕊 n (p * δ n)) atTop fun n => 0 < n ∧ p∤n by |
| 270 | + apply (ergodic_nsmul hp.one_lt).ae_empty_or_univ_of_image_ae_le (hA₀ p) |
| 271 | + apply (HasSubset.Subset.eventuallyLE this).congr EventuallyEq.rfl |
| 272 | + exact blimsup_thickening_mul_ae_eq μ (fun n => 0 < n ∧ p∤n) (fun n => {y | addOrderOf y = n}) |
| 273 | + (Nat.cast_pos.mpr hp.pos) _ hδ |
| 274 | + refine' (SupHom.apply_blimsup_le (sSupHom.setImage f)).trans (mono_blimsup fun n hn => _) |
| 275 | + replace hn := Nat.coprime_comm.mp (hp.coprime_iff_not_dvd.2 hn.2) |
| 276 | + exact approxAddOrderOf.image_nsmul_subset_of_coprime (δ n) hp.pos hn |
| 277 | + have hB : ∀ p : Nat.Primes, B p =ᵐ[μ] (∅ : Set 𝕊) ∨ B p =ᵐ[μ] univ := by |
| 278 | + rintro ⟨p, hp⟩ |
| 279 | + let x := u ⟨p, hp⟩ |
| 280 | + let f : 𝕊 → 𝕊 := fun y => p • y + x |
| 281 | + suffices |
| 282 | + f '' B p ⊆ blimsup (fun n => approxAddOrderOf 𝕊 n (p * δ n)) atTop fun n => 0 < n ∧ p∣∣n by |
| 283 | + apply (ergodic_nsmul_add x hp.one_lt).ae_empty_or_univ_of_image_ae_le (hB₀ p) |
| 284 | + apply (HasSubset.Subset.eventuallyLE this).congr EventuallyEq.rfl |
| 285 | + exact blimsup_thickening_mul_ae_eq μ (fun n => 0 < n ∧ p∣∣n) (fun n => {y | addOrderOf y = n}) |
| 286 | + (Nat.cast_pos.mpr hp.pos) _ hδ |
| 287 | + refine' (SupHom.apply_blimsup_le (sSupHom.setImage f)).trans (mono_blimsup _) |
| 288 | + rintro n ⟨hn, h_div, h_ndiv⟩ |
| 289 | + have h_cop : (addOrderOf x).coprime (n / p) := by |
| 290 | + obtain ⟨q, rfl⟩ := h_div |
| 291 | + rw [hu₀, Subtype.coe_mk, hp.coprime_iff_not_dvd, q.mul_div_cancel_left hp.pos] |
| 292 | + exact fun contra => h_ndiv (mul_dvd_mul_left p contra) |
| 293 | + replace h_div : n / p * p = n := Nat.div_mul_cancel h_div |
| 294 | + have hf : f = (fun y => x + y) ∘ fun y => p • y := by ext; simp [add_comm x]; ac_rfl |
| 295 | + simp only at hf |
| 296 | + simp_rw [Function.comp_apply, le_eq_subset] |
| 297 | + rw [sSupHom.setImage_toFun, hf, image_comp] |
| 298 | + have := @monotone_image 𝕊 𝕊 fun y => x + y |
| 299 | + specialize this (approxAddOrderOf.image_nsmul_subset (δ n) (n / p) hp.pos) |
| 300 | + simp only [h_div] at this ⊢ |
| 301 | + refine' this.trans _ |
| 302 | + convert approxAddOrderOf.vadd_subset_of_coprime (p * δ n) h_cop |
| 303 | + rw [hu₀, Subtype.coe_mk, mul_comm p, h_div] |
| 304 | + change (∀ᵐ x, x ∉ E) ∨ E ∈ volume.ae |
| 305 | + rw [← eventuallyEq_empty, ← eventuallyEq_univ] |
| 306 | + have hC : ∀ p : Nat.Primes, u p +ᵥ C p = C p := by |
| 307 | + intro p |
| 308 | + let e := (AddAction.toPerm (u p) : Equiv.Perm 𝕊).toOrderIsoSet |
| 309 | + change e (C p) = C p |
| 310 | + rw [OrderIso.apply_blimsup e, ← hu₀ p] |
| 311 | + exact blimsup_congr (eventually_of_forall fun n hn => |
| 312 | + approxAddOrderOf.vadd_eq_of_mul_dvd (δ n) hn.1 hn.2) |
| 313 | + by_cases h : ∀ p : Nat.Primes, A p =ᵐ[μ] (∅ : Set 𝕊) ∧ B p =ᵐ[μ] (∅ : Set 𝕊) |
| 314 | + · replace h : ∀ p : Nat.Primes, (u p +ᵥ E : Set _) =ᵐ[μ] E |
| 315 | + · intro p |
| 316 | + replace hE₂ : E =ᵐ[μ] C p := hE₂ p (h p) |
| 317 | + have h_qmp : MeasureTheory.Measure.QuasiMeasurePreserving ((· +ᵥ ·) (-u p)) μ μ := |
| 318 | + (measurePreserving_vadd _ μ).quasiMeasurePreserving |
| 319 | + refine' (h_qmp.vadd_ae_eq_of_ae_eq (u p) hE₂).trans (ae_eq_trans _ hE₂.symm) |
| 320 | + rw [hC] |
| 321 | + exact ae_empty_or_univ_of_forall_vadd_ae_eq_self hE₀ h hu |
| 322 | + · right |
| 323 | + simp only [not_forall, not_and_or] at h |
| 324 | + obtain ⟨p, hp⟩ := h |
| 325 | + rw [hE₁ p] |
| 326 | + cases hp |
| 327 | + · cases' hA p with _ h; · contradiction |
| 328 | + -- Porting note: was `simp only [h, union_ae_eq_univ_of_ae_eq_univ_left]` |
| 329 | + have := union_ae_eq_univ_of_ae_eq_univ_left (t := B ↑p) h |
| 330 | + exact union_ae_eq_univ_of_ae_eq_univ_left (t := C ↑p) this |
| 331 | + · cases' hB p with _ h; · contradiction |
| 332 | + -- Porting note: was |
| 333 | + -- `simp only [h, union_ae_eq_univ_of_ae_eq_univ_left, union_ae_eq_univ_of_ae_eq_univ_right]` |
| 334 | + have := union_ae_eq_univ_of_ae_eq_univ_right (s := A ↑p) h |
| 335 | + exact union_ae_eq_univ_of_ae_eq_univ_left (t := C ↑p) this |
| 336 | +#align add_circle.add_well_approximable_ae_empty_or_univ AddCircle.addWellApproximable_ae_empty_or_univ |
| 337 | + |
| 338 | +end AddCircle |
0 commit comments