From 36c7aad6ee8b2a24c2223bb59bcaf9ad7a6b444a Mon Sep 17 00:00:00 2001 From: Jeremy Avigad Date: Fri, 31 Jul 2015 22:42:11 +0300 Subject: [PATCH] fix(library/data/rat/basic): define pow before migrate --- library/data/rat/basic.lean | 10 +++++++--- library/data/real/complete.lean | 5 ----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/library/data/rat/basic.lean b/library/data/rat/basic.lean index 14a2684b9..a8240ab14 100644 --- a/library/data/rat/basic.lean +++ b/library/data/rat/basic.lean @@ -512,12 +512,17 @@ section migrate_algebra has_decidable_eq := has_decidable_eq⦄ local attribute rat.discrete_field [instance] + definition divide (a b : rat) := algebra.divide a b - infix `/` := divide + infix [priority rat.prio] `/` := divide + definition dvd (a b : rat) := algebra.dvd a b + definition pow (a : ℚ) (n : ℕ) : ℚ := algebra.pow a n + infix [priority rat.prio] ^ := pow + migrate from algebra with rat - replacing sub → rat.sub, divide → divide, dvd → dvd + replacing sub → rat.sub, divide → divide, dvd → dvd, pow → pow end migrate_algebra @@ -537,5 +542,4 @@ decidable.by_cases by rewrite [Hc, !int.mul_div_cancel_left bnz, mul.comm]), iff.mpr (eq_div_iff_mul_eq bnz') H') - end rat diff --git a/library/data/real/complete.lean b/library/data/real/complete.lean index 7fb67ab8c..b0ba7671e 100644 --- a/library/data/real/complete.lean +++ b/library/data/real/complete.lean @@ -20,13 +20,11 @@ open -[coercions] nat open eq.ops open pnat - local notation 2 := subtype.tag (nat.of_num 2) dec_trivial local notation 3 := subtype.tag (nat.of_num 3) dec_trivial namespace s - theorem rat_approx_l1 {s : seq} (H : regular s) : ∀ n : ℕ+, ∃ q : ℚ, ∃ N : ℕ+, ∀ m : ℕ+, m ≥ N → abs (s m - q) ≤ n⁻¹ := begin @@ -749,9 +747,6 @@ theorem over_succ (n : ℕ) : over_seq (succ n) = apply H end --- ??? -theorem rat.pow_add (a : ℚ) (m : ℕ) : ∀ n, rat.pow a (m + n) = rat.pow a m * rat.pow a n := rat.pow_add a m - theorem width (n : ℕ) : over_seq n - under_seq n = (over - under) / (rat.pow 2 n) := nat.induction_on n (by xrewrite [over_0, under_0, rat.pow_zero, rat.div_one])