@@ -25,7 +25,7 @@ lemma log_exists_unique_pos {y : V} (hy : 0 < y) : ∃! x, x < y ∧ ∃ y' ≤
2525 exact ⟨x + 1 , lt_of_lt_of_le (by simp [hxy]) (succ_le_double_of_pos (pos_of_gt hxy)),
2626 2 * y', by simpa using gey, Exponential.exponential_succ_mul_two.mpr H, by simpa using lty⟩
2727 case odd y IH =>
28- rcases (zero_le y : 0 ≤ y) with (rfl | pos)
28+ rcases (Arithmetic. zero_le y : 0 ≤ y) with (rfl | pos)
2929 · simp
3030 · rcases (IH pos : ∃ x < y, ∃ y' ≤ y, Exponential x y' ∧ y < 2 * y') with ⟨x, hxy, y', gey, H, lty⟩
3131 exact ⟨x + 1 , by simpa using lt_of_lt_of_le hxy (by simp),
@@ -62,7 +62,7 @@ lemma log_lt_self_of_pos {y : V} (pos : 0 < y) : log y < y :=
6262 ((Classical.choose!_spec (log_exists_unique y)).2 pos).1
6363
6464@[simp] lemma log_le_self (a : V) : log a ≤ a := by
65- rcases zero_le a with (rfl | pos)
65+ rcases Arithmetic. zero_le a with (rfl | pos)
6666 · simp
6767 · exact le_of_lt <| log_lt_self_of_pos pos
6868
@@ -121,9 +121,9 @@ lemma log_mul_pow2 {a p : V} (pos : 0 < a) (pp : Pow2 p) : log (a * p) = log a +
121121 simpa using log_mul_pow2_add_of_lt pos pp pp.pos
122122
123123lemma log_monotone {a b : V} (h : a ≤ b) : log a ≤ log b := by
124- rcases zero_le a with (rfl | posa)
124+ rcases Arithmetic. zero_le a with (rfl | posa)
125125 · simp
126- rcases zero_le b with (rfl | posb)
126+ rcases Arithmetic. zero_le b with (rfl | posb)
127127 · have := lt_of_lt_of_le posa h; simp_all
128128 rcases log_pos posa with ⟨a', ha', Ha, _⟩
129129 rcases log_pos posb with ⟨b', _, Hb, hb⟩
@@ -147,12 +147,12 @@ lemma length_eq_binaryLength (a : V) : ‖a‖ = if 0 < a then log a + 1 else 0
147147lemma length_of_pos {a : V} (pos : 0 < a) : ‖a‖ = log a + 1 := by simp [length_eq_binaryLength, pos]
148148
149149@[simp] lemma length_le (a : V) : ‖a‖ ≤ a := by
150- rcases zero_le a with (rfl | pos)
150+ rcases Arithmetic. zero_le a with (rfl | pos)
151151 · simp
152152 · simp [pos, length_of_pos, ←lt_iff_succ_le, log_lt_self_of_pos]
153153
154154lemma length_graph {i a : V} : i = ‖a‖ ↔ (0 < a → ∃ k ≤ a, k = log a ∧ i = k + 1 ) ∧ (a = 0 → i = 0 ) := by
155- rcases zero_le a with (rfl | pos)
155+ rcases Arithmetic. zero_le a with (rfl | pos)
156156 · simp
157157 · simp [length_of_pos, pos, pos_iff_ne_zero.mp pos]
158158
@@ -174,7 +174,7 @@ lemma length_two_mul_of_pos {a : V} (pos : 0 < a) : ‖2 * a‖ = ‖a‖ + 1 :=
174174 simp [pos, length_of_pos, log_two_mul_of_pos]
175175
176176lemma length_two_mul_add_one (a : V) : ‖2 * a + 1 ‖ = ‖a‖ + 1 := by
177- rcases zero_le a with (rfl | pos)
177+ rcases Arithmetic. zero_le a with (rfl | pos)
178178 · simp
179179 · simp [pos, length_of_pos, log_two_mul_add_one_of_pos]
180180
@@ -185,7 +185,7 @@ lemma length_mul_pow2 {a p : V} (pos : 0 < a) (pp : Pow2 p) : ‖a * p‖ = ‖a
185185 simp [length_of_pos, pos, pp.pos, log_mul_pow2 pos pp, add_right_comm (log a) (log p) 1 ]
186186
187187lemma length_monotone {a b : V} (h : a ≤ b) : ‖a‖ ≤ ‖b‖ := by
188- rcases zero_le a with (rfl | posa)
188+ rcases Arithmetic. zero_le a with (rfl | posa)
189189 · simp
190190 · simpa [length_of_pos posa, length_of_pos (lt_of_lt_of_le posa h)]
191191 using log_monotone h
@@ -208,13 +208,13 @@ lemma exponential_log_le_self {a b : V} (pos : 0 < a) (h : Exponential (log a) b
208208 assumption
209209
210210lemma lt_exponential_log_self {a b : V} (h : Exponential (log a) b) : a < 2 * b := by
211- rcases zero_le a with (rfl | pos)
211+ rcases Arithmetic. zero_le a with (rfl | pos)
212212 · simp at h; simp [h]
213213 rcases log_pos pos with ⟨_, _, H, _⟩; rcases H.uniq h
214214 assumption
215215
216216lemma lt_exp_len_self {a b : V} (h : Exponential ‖a‖ b) : a < b := by
217- rcases zero_le a with (rfl | pos)
217+ rcases Arithmetic. zero_le a with (rfl | pos)
218218 · simp at h; simp [h]
219219 have : Exponential (log a + 1 ) b := by simpa [length_of_pos pos] using h
220220 rcases Exponential.exponential_succ.mp this with ⟨b, rfl, H⟩
@@ -225,7 +225,7 @@ lemma le_iff_le_log_of_exp {x y a : V} (H : Exponential x y) (pos : 0 < a) : y
225225 fun h ↦ by rcases log_pos pos with ⟨a', ha', Haa', _⟩; exact le_trans (Exponential.monotone_le H Haa' h) ha'⟩
226226
227227lemma le_iff_lt_length_of_exp {x y a : V} (H : Exponential x y) : y ≤ a ↔ x < ‖a‖ := by
228- rcases zero_le a with (rfl | pos)
228+ rcases Arithmetic. zero_le a with (rfl | pos)
229229 · simpa using pos_iff_ne_zero.mp H.range_pos
230230 simp [le_iff_le_log_of_exp H pos, length_of_pos pos, ←le_iff_lt_succ]
231231
@@ -242,7 +242,7 @@ lemma Exponential.le_log {x y : V} (H : Exponential x y) : x ≤ log y := (le_if
242242lemma Exponential.lt_length {x y : V} (H : Exponential x y) : x < ‖y‖ := (le_iff_lt_length_of_exp H).mp (by rfl)
243243
244244lemma lt_exponential_length {a b : V} (h : Exponential ‖a‖ b) : a < b := by
245- rcases zero_le a with (rfl | pos)
245+ rcases Arithmetic. zero_le a with (rfl | pos)
246246 · simp at h; simp [h]
247247 have : Exponential (log a + 1 ) b := by simpa [length_of_pos pos] using h
248248 rcases Exponential.exponential_succ.mp this with ⟨b, rfl, H⟩
@@ -261,7 +261,7 @@ lemma sq_len_le_three_mul (a : V) : ‖a‖ ^ 2 ≤ 3 * a := by
261261 _ ≤ 3 * a + 2 * a + a := by simp [←pos_iff_one_le, pos]
262262 _ = 3 * (2 * a) := by simp_all only [←two_add_one_eq_three, two_mul, add_mul, add_assoc, one_mul]
263263 case odd a IH =>
264- rcases zero_le a with (rfl | pos)
264+ rcases Arithmetic. zero_le a with (rfl | pos)
265265 · simp [←two_add_one_eq_three]
266266 calc
267267 ‖2 * a + 1 ‖ ^ 2 = (‖a‖ + 1 ) ^ 2 := by rw [length_two_mul_add_one a]
@@ -380,7 +380,7 @@ lemma bexp_two_mul {a a' x : V} (hx : 2 * x < ‖a‖) (hx' : x < ‖a'‖) :
380380 bexp_eq_of_exp hx (exp_bexp_of_lt hx').bit_zero
381381
382382lemma bexp_two_mul_succ {a i : V} : bexp (2 * a) (i + 1 ) = 2 * bexp a i := by
383- rcases zero_le a with (rfl | pos)
383+ rcases Arithmetic. zero_le a with (rfl | pos)
384384 · simp
385385 rcases show i ≥ ‖a‖ ∨ i < ‖a‖ from le_or_gt ‖a‖ i with (h | h)
386386 · simp [bexp_eq_zero_of_le, h, show ‖2 * a‖ ≤ i + 1 from by simp [length_two_mul_of_pos pos, h]]
@@ -421,7 +421,7 @@ instance : Bounded₂ (fbit : V → V → V) := ⟨‘1’, λ _ ↦ by simp⟩
421421 simp [fbit, bexp_two_mul_add_one_succ, Arithmetic.div_mul]
422422
423423@[simp] lemma fbit_two_mul_zero_eq_zero (a : V) : fbit (2 * a) 0 = 0 := by
424- rcases zero_le a with (rfl | pos)
424+ rcases Arithmetic. zero_le a with (rfl | pos)
425425 · simp
426426 · have : bexp (2 * a) 0 = 1 := bexp_eq_of_exp (by simp [pos]) (by simp)
427427 simp [fbit, this ]
0 commit comments