Skip to content

Commit c160f7d

Browse files
committedAug 12, 2022
Updated code to check with Agda 2.6.2.2
1 parent 5cd6d3d commit c160f7d

8 files changed

+120
-18
lines changed
 

‎.agda-lib

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: thesis
2+
depend: standard-library
3+
include: .

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/_build
2+
/*.agda~

‎ExtraProperties.agda

+3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ open import Algebra.Structures
2727
open import Data.Empty
2828
open import Data.Sum
2929
open import Data.Maybe.Base
30+
3031
import NonReflectiveQ as ℚ-Solver
3132
import NonReflectiveZ as ℤ-Solver
33+
3234
open import Data.List
3335

3436
open ℚᵘ
@@ -300,3 +302,4 @@ p≤q+j⁻¹⇒p≤q {p} {q} hyp = p-q≤j⁻¹⇒p≤q (λ {(suc j-1) -> let j
300302
where
301303
open ℚP.≤-Reasoning
302304
open import NonReflectiveQ
305+

‎Inverse.agda

+33-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ abstract
5050
not0-helper x x≄0 n = ℚP.p≄0⇒∣↥p∣≢0 xₛ (ℚ≠-helper xₛ ([ left , right ]′ (ℚP.∣p∣≡p∨∣p∣≡-p xₛ)))
5151
where
5252
open ℚP.≤-Reasoning
53+
54+
N :
5355
N = Nₐ x x≄0
56+
57+
xₛ : ℚᵘ
5458
xₛ = seq x ((n ℕ.+ N) ℕ.* (N ℕ.* N))
5559

5660
0<∣xₛ∣ : 0ℚᵘ ℚ.< ℚ.∣ xₛ ∣
@@ -73,35 +77,59 @@ abstract
7377
ℚ.- ℚ.∣ xₛ ∣ <⟨ ℚP.neg-mono-< 0<∣xₛ∣ ⟩
7478
0ℚᵘ ∎)
7579

80+
81+
--Had to declare separately as abstract in order to typecheck fast enough.
82+
--TODO: see whether it could be hidden from global scope.
83+
abstract
84+
lesser-helper-2 : (x : ℝ) -> (x≄0 : x ≄0) -> (n : ℕ) -> (+ 1 / (Nₐ x x≄0)) ℚ.≤ ℚ.∣ seq x ((n ℕ.+ (Nₐ x x≄0)) ℕ.* ((Nₐ x x≄0) ℕ.* (Nₐ x x≄0))) ∣
85+
lesser-helper-2 x x≄0 n = proj₂ (fast-lemma-2-8-1-if {∣ x ∣} (x≄0⇒pos∣x∣ {x} x≄0)) ((n ℕ.+ N) ℕ.* (N ℕ.* N)) lesser-helper
86+
where
87+
N :
88+
N = Nₐ x x≄0
89+
lesser-helper : (Nₐ x x≄0) ℕ.≤ (n ℕ.+ (Nₐ x x≄0)) ℕ.* ((Nₐ x x≄0) ℕ.* (Nₐ x x≄0))
90+
lesser-helper = ℕP.≤-trans (ℕP.m≤n+m N n) (ℕP.m≤m*n (n ℕ.+ N) {N ℕ.* N} ℕP.0<1+n)
91+
92+
7693
abstract
7794
inverse-helper : (x : ℝ) -> (x≄0 : x ≄0) -> (n : ℕ) ->
7895
ℚ.∣ (ℚ.1/ seq x ((n ℕ.+ (Nₐ x x≄0)) ℕ.* (Nₐ x x≄0 ℕ.* Nₐ x x≄0))) {not0-helper x x≄0 n} ∣ ℚ.≤ + (Nₐ x x≄0) / 1
7996
inverse-helper x x≄0 n = begin
8097
ℚ.∣ xₛ⁻¹ ∣ ≈⟨ ℚP.≃-sym (ℚP.*-identityʳ ℚ.∣ xₛ⁻¹ ∣) ⟩
8198
ℚ.∣ xₛ⁻¹ ∣ ℚ.* 1ℚᵘ ≈⟨ ℚP.*-congˡ {ℚ.∣ xₛ⁻¹ ∣} (ℚP.≃-sym (ℚP.*-inverseˡ (+ N / 1))) ⟩
8299
ℚ.∣ xₛ⁻¹ ∣ ℚ.* (+ 1 / N ℚ.* (+ N / 1)) ≈⟨ ℚP.≃-sym (ℚP.*-assoc ℚ.∣ xₛ⁻¹ ∣ (+ 1 / N) (+ N / 1)) ⟩
83-
ℚ.∣ xₛ⁻¹ ∣ ℚ.* (+ 1 / N) ℚ.* (+ N / 1) ≤⟨ ℚP.*-monoˡ-≤-nonNeg {+ N / 1} _ (ℚP.*-monoʳ-≤-nonNeg {ℚ.∣ xₛ⁻¹ ∣} _ lesser-helper-2) ⟩
100+
ℚ.∣ xₛ⁻¹ ∣ ℚ.* (+ 1 / N) ℚ.* (+ N / 1) ≤⟨ ℚP.*-monoˡ-≤-nonNeg {+ N / 1} _ (ℚP.*-monoʳ-≤-nonNeg {ℚ.∣ xₛ⁻¹ ∣} (ℚ.nonNegative (ℚP.0≤∣p∣ (xₛ⁻¹))) (lesser-helper-2 x x≄0 n)) ⟩
84101
ℚ.∣ xₛ⁻¹ ∣ ℚ.* ℚ.∣ xₛ ∣ ℚ.* (+ N / 1) ≈⟨ ℚP.*-congʳ {+ N / 1} helper ⟩
85102
1ℚᵘ ℚ.* (+ N / 1) ≈⟨ ℚP.*-identityˡ (+ N / 1) ⟩
86103
+ N / 1
87104
where
88105
open ℚP.≤-Reasoning
106+
107+
N :
89108
N = Nₐ x x≄0
109+
110+
xₛ : ℚᵘ
90111
xₛ = seq x ((n ℕ.+ N) ℕ.* (N ℕ.* N))
112+
113+
xₛ≢0 : ℤ.∣ ↥ xₛ ∣ ≢0
91114
xₛ≢0 = not0-helper x x≄0 n
92-
xₛ⁻¹ = (ℚ.1/ seq x ((n ℕ.+ N) ℕ.* (N ℕ.* N))) {xₛ≢0}
115+
116+
117+
xₛ⁻¹ : ℚᵘ
118+
xₛ⁻¹ = (ℚ.1/ xₛ) {xₛ≢0}
119+
93120

94121
helper : ℚ.∣ xₛ⁻¹ ∣ ℚ.* ℚ.∣ xₛ ∣ ℚ.≃ ℚ.1ℚᵘ
95122
helper = begin-equality
96123
ℚ.∣ xₛ⁻¹ ∣ ℚ.* ℚ.∣ xₛ ∣ ≈⟨ ℚP.≃-sym (ℚP.∣p*q∣≃∣p∣*∣q∣ xₛ⁻¹ xₛ) ⟩
97124
ℚ.∣ xₛ⁻¹ ℚ.* xₛ ∣ ≈⟨ ℚP.∣-∣-cong (ℚP.*-inverseˡ xₛ {xₛ≢0}) ⟩
98125
ℚ.1ℚᵘ ∎
99-
126+
{-
100127
lesser-helper : N ℕ.≤ (n ℕ.+ N) ℕ.* (N ℕ.* N)
101128
lesser-helper = ℕP.≤-trans (ℕP.m≤n+m N n) (ℕP.m≤m*n (n ℕ.+ N) {N ℕ.* N} ℕP.0<1+n)
102129
103-
lesser-helper-2 : + 1 / N ℚ.≤ ℚ.∣ xₛ ∣
130+
lesser-helper-2 : (+ 1 / N) ℚ.≤ ℚ.∣ xₛ ∣
104131
lesser-helper-2 = proj₂ (fast-lemma-2-8-1-if {∣ x ∣} (x≄0⇒pos∣x∣ {x} x≄0)) ((n ℕ.+ N) ℕ.* (N ℕ.* N)) lesser-helper
132+
-}
105133

106134
-- Definition of the multiplicative inverse function _⁻¹
107135
_⁻¹ : (x : ℝ) -> (x≄0 : x ≄ 0ℝ) ->
@@ -298,3 +326,4 @@ x<y∧posx,y⇒y⁻¹<x⁻¹ {x} {y} x<y x≄0 y≄0 posx posy = let x⁻¹ = (x
298326
⁻¹-involutive-default : {x} -> (x≄0 : x ≄0) ->
299327
(((x ⁻¹) x≄0) ⁻¹) ([ (λ x<0 -> inj₁ (x<0⇒x⁻¹<0 {x} x≄0 x<0)) , (λ 0<x -> inj₂ (0<x⇒0<x⁻¹ {x} x≄0 0<x))]′ x≄0) ≃ x
300328
⁻¹-involutive-default {x} x≄0 = ⁻¹-involutive {x} x≄0 ([ (λ x<0 -> inj₁ (x<0⇒x⁻¹<0 {x} x≄0 x<0)) , (λ 0<x -> inj₂ (0<x⇒0<x⁻¹ {x} x≄0 0<x))]′ x≄0)
329+

‎NonReflectiveQ.agda

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ isZero? p with 0ℚᵘ ≃? p
1515

1616
open import Tactic.RingSolver.Core.AlmostCommutativeRing using (fromCommutativeRing)
1717
open import Tactic.RingSolver.NonReflective (fromCommutativeRing +-*-commutativeRing isZero?) public
18+
19+
import Tactic.RingSolver.NonReflective
20+
import Data.Nat.Base as ℕ
21+
_⊖_ : {A : Set} {n : ℕ.ℕ} Tactic.RingSolver.NonReflective.Expr A n Tactic.RingSolver.NonReflective.Expr A n Tactic.RingSolver.NonReflective.Expr A n
22+
ex1 ⊖ ex2 = ex1 ⊕ (⊝ ex2)
23+
infixl 6 _⊖_

‎NonReflectiveZ.agda

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-- The nonreflective ring solver instantiated for integers.
2+
-- (could not find on the repository)
3+
4+
{-# OPTIONS --without-K --safe #-}
5+
6+
open import Agda.Builtin.Bool
7+
open import Agda.Builtin.Equality
8+
open import Data.Maybe.Base using (Maybe; just; nothing)
9+
open import Relation.Nullary
10+
open import Data.Integer.Base as ℤ using (ℤ; +_; +0; +[1+_]; -[1+_])
11+
open import Data.Integer.Properties as ℤP
12+
open import Relation.Binary.Definitions
13+
14+
isZero? : (p : ℤ) -> Maybe (ℤ.0ℤ ≡ p)
15+
isZero? p with ℤ.0ℤ ℤP.≟ p
16+
... | .true because ofʸ p₁ = just p₁
17+
... | .false because ofⁿ ¬p = nothing
18+
19+
open import Tactic.RingSolver.Core.AlmostCommutativeRing using (fromCommutativeRing)
20+
open import Tactic.RingSolver.NonReflective (fromCommutativeRing +-*-commutativeRing isZero?) public
21+
22+
import Tactic.RingSolver.NonReflective
23+
import Data.Nat.Base as ℕ
24+
_⊖_ : {A : Set} {n : ℕ.ℕ} Tactic.RingSolver.NonReflective.Expr A n Tactic.RingSolver.NonReflective.Expr A n Tactic.RingSolver.NonReflective.Expr A n
25+
ex1 ⊖ ex2 = ex1 ⊕ (⊝ ex2)
26+
infixl 6 _⊖_
27+

‎RealProperties.agda

+4
Original file line numberDiff line numberDiff line change
@@ -1704,8 +1704,11 @@ module ℝ-Solver where
17041704
}
17051705

17061706
abstract
1707+
⋆-distrib-+₂ : (p r : ℚᵘ) -> (p ℚ.+ r) ⋆ ≃ p ⋆ + r ⋆
17071708
⋆-distrib-+₂ = ⋆-distrib-+
1709+
⋆-distrib-*₂ : p q -> (p ℚ.* q) ⋆ ≃ p ⋆ * q ⋆
17081710
⋆-distrib-*₂ = ⋆-distrib-*
1711+
⋆-distrib-neg₂ : (p : ℚᵘ) -> (ℚ.- p) ⋆ ≃ - (p ⋆)
17091712
⋆-distrib-neg₂ = ⋆-distrib-neg
17101713

17111714
getMorphism : _-Raw-AlmostCommutative⟶_ ℚP.+-*-rawRing (fromCommutativeRing +-*-commutativeRing (λ x -> nothing))
@@ -2572,3 +2575,4 @@ x≤z∧y≤z⇒x⊔y≤z {x} {y} {z} x≤z y≤z = lemma-2-8-2-onlyif lem
25722575
(ℚP.-‿cong (ℚP.≃-sym (ℚP.p≤q⇒p⊔q≃q x₂ₘ≤y₂ₘ))) ⟩
25732576
seq z (2 ℕ.* m) ℚ.- seq (x ⊔ y) (2 ℕ.* m) ∎
25742577

2578+

‎Sequence.agda

+42-14
Original file line numberDiff line numberDiff line change
@@ -562,26 +562,36 @@ nonNegx∧x≄0⇒posx {x} nonx x≄0 = 0<x⇒posx (begin-strict
562562
nonNegx⇒nonNegx⁻¹ : {x} -> NonNegative x -> (x≄0 : x ≄0) -> NonNegative ((x ⁻¹) x≄0)
563563
nonNegx⇒nonNegx⁻¹ {x} nonx x≄0 = pos⇒nonNeg (posx⇒posx⁻¹ {x} x≄0 (nonNegx∧x≄0⇒posx {x} nonx x≄0))
564564

565+
565566
abstract
566567
xₙ≄0∧x₀≄0⇒xₙ⁻¹→x₀⁻¹ : {xs :-> ℝ} -> {x₀ : ℝ} -> xs ConvergesTo x₀ -> (xₙ≄0 : n -> xs n ≄0) -> (x₀≄0 : x₀ ≄0) ->
567568
(λ n -> (xs n ⁻¹) (xₙ≄0 n)) ConvergesTo (x₀ ⁻¹) x₀≄0
568569
xₙ≄0∧x₀≄0⇒xₙ⁻¹→x₀⁻¹ {xs} {x₀} (con* xₙ→x₀) xₙ≄0 x₀≄0 = con* main
570+
569571
where
570572
open ≤-Reasoning
571573
main : k -> {k≢0 : k ≢0} ->λ N-1 -> n -> n ℕ.≥ suc N-1 ->
572574
∣ (xs n ⁻¹) (xₙ≄0 n) - (x₀ ⁻¹) x₀≄0 ∣ ≤ ((+ 1 / k) {k≢0}) ⋆
573575
main (suc k-1) = ℕ.pred N , sub
576+
574577
where
578+
arch : ∃ (λ n-1 (mkℚᵘ (+ 1) n-1 ⋆ < (+ 1 / 2) ⋆ * ∣ x₀ ∣)) --had to add this
575579
arch = fast-archimedean-ℝ₂ {(+ 1 / 2) ⋆ * ∣ x₀ ∣} (posx,y⇒posx*y (posp⇒posp⋆ (+ 1 / 2) _) (x≄0⇒pos∣x∣ x₀≄0))
580+
581+
r k :
576582
r = suc (proj₁ arch)
577583
k = suc k-1
584+
585+
m₀-getter : ∃ (λ N-1 (n : ℕ) n ℕ.≥ suc N-1 ∣ xs n - x₀ ∣ < ((+ 1 / (2 ℕ.* (suc k-1))) ⋆ * (∣ x₀ ∣ * ∣ x₀ ∣))) --had to add this too
578586
m₀-getter = fast-ε-from-convergence (x₀ , con* xₙ→x₀) ((+ 1 / (2 ℕ.* k)) ⋆ * (∣ x₀ ∣ * ∣ x₀ ∣))
579587
(posx,y⇒posx*y (posp⇒posp⋆ (+ 1 / (2 ℕ.* k)) _)
580588
(posx,y⇒posx*y (x≄0⇒pos∣x∣ x₀≄0) (x≄0⇒pos∣x∣ x₀≄0)))
589+
590+
m₀ n₀ N :
581591
m₀ = suc (proj₁ m₀-getter)
582592
n₀ = suc (proj₁ (xₙ→x₀ r))
583593
N = m₀ ℕ.⊔ n₀
584-
594+
585595
{-
586596
[1]
587597
Incredible optimization note!
@@ -593,7 +603,7 @@ abstract
593603
Despite this issue being solved, the addition of all of the implicit arguments below is a notable optimization, and will
594604
thus be kept.
595605
-}
596-
sub : n -> n ℕ.≥ N -> ∣ (xs n ⁻¹) (xₙ≄0 n) - (x₀ ⁻¹) x₀≄0 ∣ ≤ (+ 1 / k) ⋆
606+
sub : n -> n ℕ.≥ N -> ∣ (xs n ⁻¹) (xₙ≄0 n) - (x₀ ⁻¹) x₀≄0 ∣ ≤ (+ 1 / suc k-1) ⋆
597607
sub n n≥N = begin
598608
∣ xₙ⁻¹ - x₀⁻¹ ∣ ≈⟨ ≃-trans {∣ xₙ⁻¹ - x₀⁻¹ ∣} {∣xₙ∣⁻¹ * ∣x₀∣⁻¹ * ∣ x₀ - xₙ ∣} {∣ x₀ - xₙ ∣ * (∣xₙ∣⁻¹ * ∣x₀∣⁻¹)}
599609
part2 (*-comm (∣xₙ∣⁻¹ * ∣x₀∣⁻¹) ∣ x₀ - xₙ ∣) ⟩
@@ -626,16 +636,24 @@ abstract
626636
ℤΚ (+ 1) :* ℤΚ (+ 2) :* k := ℤΚ (+ 1) :* (ℤΚ (+ 2) :* k :* ℤΚ (+ 1)))
627637
refl (+ k))) ⟩
628638
(+ 1 / k) ⋆ ∎
629-
639+
640+
630641
where
642+
--maybe the main problem was here; it hung until the types were added
643+
xₙ xₙ⁻¹ x₀⁻¹ :
631644
xₙ = xs n
632645
xₙ⁻¹ = (xₙ ⁻¹) (xₙ≄0 n)
633646
x₀⁻¹ = (x₀ ⁻¹) x₀≄0
647+
648+
∣xₙ∣≄0 : ∣ xₙ ∣ ≄0
634649
∣xₙ∣≄0 = x≄0⇒∣x∣≄0 (xₙ≄0 n)
650+
∣x₀∣≄0 : ∣ x₀ ∣ ≄0
635651
∣x₀∣≄0 = x≄0⇒∣x∣≄0 x₀≄0
652+
653+
∣xₙ∣⁻¹ ∣x₀∣⁻¹ :
636654
∣xₙ∣⁻¹ = (∣ xₙ ∣ ⁻¹) ∣xₙ∣≄0
637655
∣x₀∣⁻¹ = (∣ x₀ ∣ ⁻¹) ∣x₀∣≄0
638-
656+
639657
2⁻¹∣x₀∣<∣xₙ∣ : (+ 1 / 2) ⋆ * ∣ x₀ ∣ < ∣ xₙ ∣
640658
2⁻¹∣x₀∣<∣xₙ∣ = begin-strict
641659
(+ 1 / 2) ⋆ * ∣ x₀ ∣ ≈⟨ solve 1 (λ ∣x₀∣ ->
@@ -650,7 +668,7 @@ abstract
650668
x₀ ⊖ (x₀ ⊖ xₙ) ⊜ xₙ)
651669
≃-refl xₙ x₀) ⟩
652670
∣ xₙ ∣ ∎
653-
671+
654672
part1 : xₙ⁻¹ - x₀⁻¹ ≃ xₙ⁻¹ * x₀⁻¹ * (x₀ - xₙ)
655673
part1 = ≃-symm (begin-equality
656674
xₙ⁻¹ * x₀⁻¹ * (x₀ - xₙ) ≈⟨ *-distribˡ-+ (xₙ⁻¹ * x₀⁻¹) x₀ (- xₙ) ⟩
@@ -667,7 +685,7 @@ abstract
667685
(+-congʳ xₙ⁻¹ (*-congˡ { - x₀⁻¹} (*-inverseˡ xₙ (xₙ≄0 n)))))
668686
(+-congʳ xₙ⁻¹ (*-identityʳ (- x₀⁻¹))) ⟩
669687
xₙ⁻¹ - x₀⁻¹ ∎)
670-
688+
671689
part2 : ∣ xₙ⁻¹ - x₀⁻¹ ∣ ≃ ∣xₙ∣⁻¹ * ∣x₀∣⁻¹ * ∣ x₀ - xₙ ∣
672690
part2 = begin-equality
673691
∣ xₙ⁻¹ - x₀⁻¹ ∣ ≈⟨ ∣-∣-cong part1 ⟩
@@ -677,7 +695,7 @@ abstract
677695
(∣x∣⁻¹≃∣x⁻¹∣ {xₙ} ∣xₙ∣≄0 (xₙ≄0 n))
678696
(∣x∣⁻¹≃∣x⁻¹∣ {x₀} ∣x₀∣≄0 x₀≄0))) ⟩
679697
∣xₙ∣⁻¹ * ∣x₀∣⁻¹ * ∣ x₀ - xₙ ∣ ∎
680-
698+
681699
part3 : ∣xₙ∣⁻¹ < 2ℚᵘ ⋆ * ∣x₀∣⁻¹
682700
part3 = let 2⁻¹≄0 = ∣↥p∣≢0⇒p⋆≄0 (+ 1 / 2) _
683701
; 2⁻¹∣x₀∣≄0 = x≄0∧y≄0⇒x*y≄0 {(+ 1 / 2) ⋆} {∣ x₀ ∣} 2⁻¹≄0 ∣x₀∣≄0 in begin-strict
@@ -690,7 +708,7 @@ abstract
690708
(((+ 1 / 2) ⋆) ⁻¹) 2⁻¹≄0 * ∣x₀∣⁻¹ ≈⟨ *-congʳ {∣x₀∣⁻¹} (⋆-distrib-⁻¹ (+ 1 / 2) 2⁻¹≄0) ⟩
691709
2ℚᵘ ⋆ * ∣x₀∣⁻¹ ∎
692710

693-
part4 : ∣ x₀ - xₙ ∣ < (+ 1 / (2 ℕ.* k)) ⋆ * (∣ x₀ ∣ * ∣ x₀ ∣)
711+
part4 : ∣ x₀ - xₙ ∣ < (+ 1 / (2 ℕ.* (suc k-1))) ⋆ * (∣ x₀ ∣ * ∣ x₀ ∣)
694712
part4 = begin-strict
695713
∣ x₀ - xₙ ∣ ≈⟨ ∣x-y∣≃∣y-x∣ x₀ xₙ ⟩
696714
∣ xₙ - x₀ ∣ <⟨ proj₂ m₀-getter n (ℕP.≤-trans (ℕP.m≤m⊔n m₀ n₀) n≥N) ⟩
@@ -2345,12 +2363,21 @@ Order Limit Theorem
23452363
-}
23462364
0≤xₙ⇒0≤limxₙ : {xs : ℝ} ((n : ℕ) 0ℝ ≤ xs n) (xₙ→x : xs isConvergent) 0ℝ ≤ lim xₙ→x
23472365
0≤xₙ⇒0≤limxₙ {xs} 0≤xₙ xₙ→x = ≮⇒≥ λ x<0 <-irrefl ≃-refl
2348-
let x = lim xₙ→x; N-get = (fast-ε-from-convergence xₙ→x (- x) (0<x⇒posx (<-respˡ-≃ (≃-symm 0≃-0) (neg-mono-< x<0))))
2349-
; N = suc (proj₁ N-get) in begin-strict
2350-
- x ≤⟨ ≤-respˡ-≃ (+-identityˡ (- x)) (+-monoˡ-≤ (- x) (0≤xₙ N)) ⟩
2351-
xs N - x <⟨ ≤-<-trans x≤∣x∣ (proj₂ N-get N ℕP.≤-refl) ⟩
2352-
- x ∎
2353-
where open ≤-Reasoning
2366+
(begin-strict
2367+
- x ≤⟨ ≤-respˡ-≃ (+-identityˡ (- x)) (+-monoˡ-≤ (- x) (0≤xₙ N)) ⟩
2368+
xs (N {x<0}) - x <⟨ ≤-<-trans x≤∣x∣ (proj₂ N-get N ℕP.≤-refl) ⟩
2369+
- x ∎)
2370+
where
2371+
open ≤-Reasoning
2372+
2373+
x :
2374+
x = lim xₙ→x
2375+
2376+
N-get : {x<0 : x < 0ℝ} ∃ (λ N-1 (n : ℕ) n ℕ.≥ suc N-1 ∣ xs n - x ∣ < - x)
2377+
N-get {x<0} = fast-ε-from-convergence xₙ→x (- x) (0<x⇒posx (<-respˡ-≃ (≃-symm 0≃-0) (neg-mono-< x<0)))
2378+
2379+
N : {x<0 : x < 0ℝ}
2380+
N {x<0} = suc (proj₁ (N-get {x<0}))
23542381

23552382
xₙ≤yₙ⇒limxₙ≤limyₙ : {xs ys : ℝ} ((n : ℕ) xs n ≤ ys n) (xₙ→x : xs isConvergent) (yₙ→y : ys isConvergent) lim xₙ→x ≤ lim yₙ→y
23562383
xₙ≤yₙ⇒limxₙ≤limyₙ {xs} {ys} xₙ≤yₙ xₙ→x yₙ→y = 0≤y-x⇒x≤y (0≤xₙ⇒0≤limxₙ {λ n ys n - xs n} (λ n x≤y⇒0≤y-x (xₙ≤yₙ n))
@@ -2457,3 +2484,4 @@ abstract
24572484
(k : ℕ) {k≢0 : k ≢0} λ Nₖ-1 (n : ℕ) n ℕ.≥ suc Nₖ-1
24582485
∣ xs n - lim xₙ→x ∣ ≤ ((+ 1 / k) {k≢0}) ⋆
24592486
fast-convergence-getter = convergence-getter
2487+

0 commit comments

Comments
 (0)
Please sign in to comment.