File size: 3,520 Bytes
f89a930
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import OAI.NumberTheory.Jacobsthal.Estimates.SmallModelSourceScales

namespace OAI

namespace Erdos970
open scoped _root_.Erdos970

section

namespace ErdosVarianceSmallModel
attribute [local instance] Classical.propDecidable
attribute [local instance] Classical.decEq

noncomputable def modelUnitIntegers (R xi : ℝ) (H : ℕ) (C0 : ℤ) : Finset ℤ :=
  (modelIntegers R xi (H : ℝ) (C0 : ℝ)).filter (fun m => m.natAbs.Coprime H)

noncomputable def modelUniverse (R xi w : ℝ) (H : ℕ) (C0 : ℤ) : Finset (ModelPoint w H) :=
  (modelUnitIntegers R xi H C0).product Finset.univ

noncomputable def atomWeight (R xi w : ℝ) (H : ℕ) (C0 : ℤ) : ℝ :=
  (H : ℝ)/((H.totient : ℝ)*modelLength R xi (H : ℝ) (C0 : ℝ)*
    (divisorModulus w H : ℝ)*((coprimeModulus w H).totient : ℝ))

noncomputable def modelMass (R xi w : ℝ) (H : ℕ) (C0 : ℤ) (E : ModelPoint w H → Prop) : ℝ :=
  ∑ _v ∈ (modelUniverse R xi w H C0).filter E,atomWeight R xi w H C0

theorem mem_modelUniverse (R xi w : ℝ) (H : ℕ) (C0 : ℤ) (v : ModelPoint w H) :
    v ∈ modelUniverse R xi w H C0 ↔
      modelLeft R xi (C0 : ℝ) ≤ (v.1 : ℝ) ∧ (v.1 : ℝ) < modelRight R xi (H : ℝ) (C0 : ℝ) ∧
        v.1.natAbs.Coprime H := by
  simp only [modelUniverse,Finset.product_eq_sprod,Finset.mem_product,Finset.mem_univ,and_true,
    modelUnitIntegers,Finset.mem_filter,mem_modelIntegers,and_assoc]

theorem atomWeight_pos (R xi w : ℝ) (H : ℕ) (C0 : ℤ) (hR : 0 < R) (hxi : 0 ≤ xi) (hH : 0 < H) :
    0 < atomWeight R xi w H C0 := by
  have hHR : (0 : ℝ) < H := by exact_mod_cast hH
  have hphi : (0 : ℝ) < H.totient := by exact_mod_cast Nat.totient_pos.mpr hH
  have hT0 : (0 : ℝ) < divisorModulus w H := by exact_mod_cast divisorModulus_pos w H
  have hT1 : (0 : ℝ) < (coprimeModulus w H).totient := by
    exact_mod_cast Nat.totient_pos.mpr (coprimeModulus_pos w H)
  have hY : 0 < modelLength R xi (H : ℝ) (C0 : ℝ) := by
    dsimp [modelLength,interceptScale]
    positivity
  unfold atomWeight
  positivity

theorem modelMass_card (R xi w : ℝ) (H : ℕ) (C0 : ℤ) (E : ModelPoint w H → Prop) :
    modelMass R xi w H C0 E =
      (((modelUniverse R xi w H C0).filter E).card : ℝ)*atomWeight R xi w H C0 := by
  simp only [modelMass,Finset.sum_const,nsmul_eq_mul]

theorem modelUniverse_card (R xi w : ℝ) (H : ℕ) (C0 : ℤ) :
    (modelUniverse R xi w H C0).card =
      (modelUnitIntegers R xi H C0).card*(divisorModulus w H*(coprimeModulus w H).totient) := by
  simp only [modelUniverse,Finset.product_eq_sprod,Finset.card_product,Finset.card_univ,pattern_card]

theorem model_total_mass (R xi w : ℝ) (H : ℕ) (C0 : ℤ) (hR : 0 < R) (hxi : 0 ≤ xi) (hH : 0 < H) :
    modelMass R xi w H C0 (fun _ => True) =
      ((modelUnitIntegers R xi H C0).card : ℝ)*(H : ℝ)/
        ((H.totient : ℝ)*modelLength R xi (H : ℝ) (C0 : ℝ)) := by
  have hphi : (0 : ℝ) < H.totient := by exact_mod_cast Nat.totient_pos.mpr hH
  have hT0 : (0 : ℝ) < divisorModulus w H := by exact_mod_cast divisorModulus_pos w H
  have hT1 : (0 : ℝ) < (coprimeModulus w H).totient := by
    exact_mod_cast Nat.totient_pos.mpr (coprimeModulus_pos w H)
  have hY : 0 < modelLength R xi (H : ℝ) (C0 : ℝ) := by
    have hHR : (0 : ℝ) < H := by exact_mod_cast hH
    dsimp [modelLength,interceptScale]
    positivity
  rw [modelMass_card,Finset.filter_true,modelUniverse_card]
  simp only [Nat.cast_mul,atomWeight]
  field_simp

end ErdosVarianceSmallModel

end

end Erdos970

end OAI