@@ -38,39 +38,13 @@ noncomputable def Z2Basis := Basis.restrictScalars ℤ (OrthonormalBasis.toBasis
38
38
noncomputable def Z2 := Submodule.span ℤ (Set.range (R2Basis))
39
39
noncomputable def Z2' := Submodule.span ℤ (Set.range (Z2Basis))
40
40
noncomputable def Z2'' := AddSubgroup.closure (Set.range (R2Basis))
41
- #check Set.range (Z2Basis)
42
- #check Z2
43
- #check Z2
44
- #check Z2.carrier
45
- #check Z2'.carrier
46
-
47
41
48
42
abbrev R2 : Type := (EuclideanSpace ℝ (Fin 2 ))
49
43
variable (w : R2) (h : w ∈ Z2)
50
44
51
- lemma hw : ∀ (i : (Fin 2 )), ((OrthonormalBasis.toBasis R2Basis).repr w) i ∈ Set.range ⇑(algebraMap ℤ ℝ) :=
52
- by exact (Basis.mem_span_iff_repr_mem ℤ (OrthonormalBasis.toBasis R2Basis) w).mp h
53
-
54
- example (s : ℝ) : s ∈ Set.range ⇑(algebraMap ℤ ℝ) → ∃ (n : ℤ), s = n := by
55
- simp
56
- intro n hn
57
- use n
58
- exact hn.symm
59
-
60
-
61
-
62
- #print R2
63
-
64
- variable (v : (EuclideanSpace ℝ (Fin 2 )))
65
- variable (v2 : (EuclideanSpace ℝ (Fin 2 )))
66
- variable (ι : Fin (FiniteDimensional.finrank ℝ (EuclideanSpace ℝ (Fin 2 ))))
67
-
68
- #check (w : (EuclideanSpace ℝ (Fin 2 ))) ι
69
-
70
45
-- -- the ι-th coordinate of the vector v in the basis R2Basis
71
46
-- #check R2Basis.repr v ι
72
47
73
- #check DiscreteTopology Z2
74
48
75
49
-- want to prove that the ι-th coordinate of v is an integer.
76
50
-- the definition of Z2 says that it is a Z module spanned by
@@ -109,11 +83,12 @@ lemma Eq_Int_dist_lt_one (x y : ℝ) (hx : isInteger x) (hy : isInteger y) : |x
109
83
exact congrArg Int.cast this
110
84
111
85
lemma IsIntegerLimitSeqInteger (x : ℕ → ℝ) (p : ℝ) (hxint : ∀ (n : ℕ), isInteger (x n)) (hxconv : Filter.Tendsto x Filter.atTop (nhds p))
112
- : ∃ (m : ℤ), p = m := by
86
+ : isInteger p := by
113
87
rw [Metric.tendsto_nhds] at hxconv
114
88
simp at hxconv
115
89
obtain ⟨N1, hN1⟩ := hxconv (1 /2 ) one_half_pos
116
90
obtain ⟨m, hm⟩ := hxint N1
91
+ unfold isInteger
117
92
use m
118
93
apply eq_of_forall_dist_le
119
94
intro ε hε
@@ -141,22 +116,48 @@ lemma IsIntegerLimitSeqInteger (x : ℕ → ℝ) (p : ℝ) (hxint : ∀ (n : ℕ
141
116
_ ≤ ε := by simp
142
117
exact le_of_lt this
143
118
119
+ lemma IsInteger_iff_setrangeZR (s : ℝ) : s ∈ Set.range ⇑(algebraMap ℤ ℝ) ↔ ∃ (n : ℤ), s = n := by
120
+ constructor
121
+ · simp
122
+ intro n hn
123
+ use n
124
+ exact hn.symm
125
+ · intro hs
126
+ obtain ⟨n, hn⟩ := hs
127
+ use n
128
+ exact hn.symm
144
129
145
- #check (R2Basis).repr v2 ι
146
- #check v2 ι
147
-
148
- example : v2 ι = (R2Basis).repr v2 ι := by
149
- exact rfl
150
130
151
131
152
- lemma IsInteger_componentsZ2 (v : (EuclideanSpace ℝ (Fin 2 ))) : v ∈ Z2 ↔ ∀ (ι : Fin (FiniteDimensional.finrank ℝ (EuclideanSpace ℝ (Fin 2 )))),
153
- isInteger (v ι ) := by
132
+ lemma IsInteger_componentsZ2
133
+ (v : R2) : v ∈ Z2.carrier ↔ ∀ (i : Fin 2 ), isInteger ((OrthonormalBasis.toBasis R2Basis).repr v i ) := by
154
134
constructor
155
- intro hv ι
156
- rw [Basis.mem_submodule_iff (OrthonormalBasis.toBasis R2Basis)] at hv
157
- obtain ⟨c, hc⟩ := hv
135
+ · intro hv i
136
+ have : ((OrthonormalBasis.toBasis R2Basis).repr v) i ∈ Set.range ⇑(algebraMap ℤ ℝ) := by
137
+ exact (Basis.mem_span_iff_repr_mem ℤ (OrthonormalBasis.toBasis R2Basis) v).mp hv i
138
+ simp
139
+ unfold isInteger
140
+ obtain ⟨n, hn⟩ := this
141
+ use n
142
+ simp at hn
143
+ exact hn.symm
144
+ · intro hv
145
+ unfold Z2
146
+ apply (Basis.mem_span_iff_repr_mem ℤ (OrthonormalBasis.toBasis R2Basis) v).mpr
147
+ intro i
148
+ rw [IsInteger_iff_setrangeZR _]
149
+ exact hv i
150
+
151
+ -- lemma IsInteger_componentsZ2 (v : (EuclideanSpace ℝ (Fin 2))) : v ∈ Z2 ↔ ∀ (ι : Fin (FiniteDimensional.finrank ℝ (EuclideanSpace ℝ (Fin 2)))),
152
+ -- isInteger (v ι) := by
153
+ -- constructor
154
+ -- intro hv ι
155
+ -- rw [Basis.mem_submodule_iff (OrthonormalBasis.toBasis R2Basis)] at hv
156
+ -- obtain ⟨c, hc⟩ := hv
157
+
158
+ -- sorry
159
+
158
160
159
- sorry
160
161
-- intro hv ι
161
162
-- have hv2floor: (Zspan.floor (OrthonormalBasis.toBasis R2Basis) v) = v := by
162
163
-- apply Zspan.floor_eq_self_of_mem
@@ -190,10 +191,20 @@ lemma IsFiniteBoundedSetZ2 (M : ℝ) (hM : M > 0) : Set.Finite {x ∈ Z2 | ‖x
190
191
refine IsSeqClosed.isClosed ?hs
191
192
unfold IsSeqClosed
192
193
intro x p hx
193
- rw [Metric.tendsto_nhds]
194
+ -- rw [ Metric.tendsto_nhds ]
194
195
intro hxtop
195
- simp at hxtop
196
-
196
+ -- simp at hxtop
197
+ have hxint : ∀ (n : ℕ), ∀ (i : Fin 2 ), isInteger ((x n) i) := by
198
+ intro n i
199
+ exact (IsInteger_componentsZ2 (x n)).mp (hx n) i
200
+ rw [IsInteger_componentsZ2 p]
201
+ intro i
202
+ have hpint : isInteger (p i) := by
203
+
204
+ -- we need that if x is convergent to p, then
205
+ -- x i is convergent to p i.
206
+ -- it is unclear whether this is in mathlib
207
+ -- nor whether the norm convergence -> weak convergence is in mathlib
197
208
198
209
have BallDef : {x : (EuclideanSpace ℝ (Fin 2 ))| dist x 0 ≤ M} = {x : (EuclideanSpace ℝ (Fin 2 ))| ‖x‖ ≤ M} := by
199
210
simp
0 commit comments