File tree Expand file tree Collapse file tree
src/Data/Rational/Unnormalised Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1970,16 +1970,17 @@ q<⌊q⌋+1 q@record{} = let n = ↥ q; d = ↧ q in *<* ( begin-strict
19701970 (↥ (⌊ q ⌋ / 1 + 1ℚᵘ)) ℤ.* d ∎) where open ℤ.≤-Reasoning
19711971
19721972q≤⌈q⌉ : ∀ q → q ≤ ⌈ q ⌉ / 1
1973- q≤⌈q⌉ q@record{} = subst
1974- (_≤ - (⌊ - q ⌋ / 1 ))
1975- ( neg-involutive-≡ q)
1976- (neg-mono-≤ (⌊q⌋≤q (- q)))
1973+ q≤⌈q⌉ q@record{} = begin
1974+ q ≡⟨ neg-involutive-≡ q ⟨
1975+ - (- q) ≤⟨ neg-mono-≤ (⌊q⌋≤q (- q)) ⟩
1976+ ⌈ q ⌉ / 1 ∎ where open ≤-Reasoning
19771977
19781978⌈q⌉-1<q : ∀ q → ⌈ q ⌉ / 1 - 1ℚᵘ < q
1979- ⌈q⌉-1<q q@record{} = subst₂ _<_
1980- (neg-distrib-+ (⌊ - q ⌋ / 1 ) 1ℚᵘ)
1981- (neg-involutive-≡ q)
1982- (neg-mono-< (q<⌊q⌋+1 (- q)))
1979+ ⌈q⌉-1<q q@record{} = neg-cancel-< (begin-strict
1980+ - q <⟨ q<⌊q⌋+1 (- q) ⟩
1981+ ⌊ - q ⌋ / 1 + 1ℚᵘ ≡⟨ neg-involutive-≡ (⌊ - q ⌋ / 1 + 1ℚᵘ) ⟨
1982+ - (- (⌊ - q ⌋ / 1 + 1ℚᵘ)) ≡⟨ cong -_ (neg-distrib-+ (⌊ - q ⌋ / 1 ) 1ℚᵘ) ⟩
1983+ - (⌈ q ⌉ / 1 - 1ℚᵘ) ∎) where open ≤-Reasoning
19831984
19841985------------------------------------------------------------------------
19851986-- Approximation errors of ⌊_⌋ ⌈_⌉ and round(_)
You can’t perform that action at this time.
0 commit comments