Skip to content

Commit 0e2cfab

Browse files
reals multiplciaiton cleaned
1 parent 953942c commit 0e2cfab

26 files changed

+3308
-3233
lines changed

Cubical/Data/List/Properties.agda

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,13 @@ repeat : ℕ → A → List A
327327
repeat zero _ = []
328328
repeat (suc k) x = x ∷ repeat k x
329329

330+
rot : List A List A
331+
rot [] = []
332+
rot (x ∷ xs) = xs ∷ʳ x
333+
334+
rotN : List A List A
335+
rotN n = iter n rot
336+
330337
take[] : n take {A = A} n [] ≡ []
331338
take[] zero = refl
332339
take[] (suc n) = refl
@@ -343,13 +350,6 @@ lookupAlways a (x ∷ xs) (suc k) = lookupAlways a xs k
343350
lookupMb : List A Maybe A
344351
lookupMb = lookupAlways nothing ∘S map just
345352

346-
rot : List A List A
347-
rot [] = []
348-
rot (x ∷ xs) = xs ∷ʳ x
349-
350-
rotN : List A List A
351-
rotN n = iter n rot
352-
353353
offset : A List A List A
354354
offset a n xs = repeat (substLen n xs) a ++ xs
355355
where

Cubical/Data/Maybe/Base.agda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ rec : B → (A → B) → Maybe A → B
2424
rec n j nothing = n
2525
rec n j (just a) = j a
2626

27+
rec' : Maybe A B (A B) B
28+
rec' mb n j = rec n j mb
29+
30+
2731
elim : {A : Type ℓA} (B : Maybe A Type ℓB) B nothing ((x : A) B (just x)) (mx : Maybe A) B mx
2832
elim B n j nothing = n
2933
elim B n j (just a) = j a

Cubical/Data/Rationals/Fast/Order.agda

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ open import Cubical.Foundations.HLevels
77
open import Cubical.Foundations.Univalence
88

99
open import Cubical.Functions.Logic using (_⊔′_; ⇔toPath)
10+
open import Cubical.Foundations.Powerset
1011

1112
open import Cubical.Data.Empty as ⊥
1213
open import Cubical.Data.Int.Fast.Base as ℤ using (ℤ)
@@ -980,20 +981,26 @@ eqElim₂₊ {lhs} {rhs} p {ε , 0<ε} {ε' , 0<ε'} = ElimProp2.go w ε ε' 0<
980981

981982

982983
module EqElims where
983-
Signature : Type
984-
Signature = List Bool
984+
data ℚTypes : Type where
985+
[ℚ] [ℚ₊] : ℚTypes
985986

986-
lrhsDom : Bool Type
987-
lrhsDom = if_then ℚ₊ else ℚ
987+
ℚSignature : Type
988+
ℚSignature = List ℚTypes
988989

989-
lrhsDomFst : Bool Type
990-
lrhsDomFst = if_then ℕ else ℤ
990+
lrhsDom : ℚTypes Type
991+
lrhsDom [ℚ] =
992+
lrhsDom [ℚ₊] = ℚ₊
993+
994+
995+
lrhsDomFst : ℚTypes Type
996+
lrhsDomFst [ℚ] =
997+
lrhsDomFst [ℚ₊] =
991998

992999
lrhsCtr : b lrhsDomFst b (lrhsDom b)
993-
lrhsCtr false k m = [ k , 1+ m ]
994-
lrhsCtr true n m = [ ℤ.pos (suc n) , (1+ m) ] , _
1000+
lrhsCtr [ℚ] k m = [ k , 1+ m ]
1001+
lrhsCtr [ℚ₊] n m = [ ℤ.pos (suc n) , (1+ m) ] , _
9951002

996-
LRhs : Signature Type
1003+
LRhs : ℚSignature Type
9971004
LRhs [] = ℚ × ℚ
9981005
LRhs (x ∷ xs) = lrhsDom x LRhs xs
9991006

@@ -1012,15 +1019,20 @@ module EqElims where
10121019

10131020
EllimEqₛ : s (lrhs : LRhs s) LemType s lrhs EqType s lrhs
10141021
EllimEqₛ [] lrhs e = e
1015-
EllimEqₛ (false ∷ xs) lrhs e = ElimProp.go w
1022+
EllimEqₛ ([ℚ] ∷ xs) lrhs e = ElimProp.go w
10161023
where
10171024
w : ElimProp _
10181025
w .ElimProp.isPropB = isPropEqType xs ∘ lrhs
10191026
w .ElimProp.f (k , 1+ m) = EllimEqₛ xs (lrhs _) (e k m)
10201027

1021-
EllimEqₛ (true ∷ xs) lrhs e = uncurry (ElimProp.go w)
1028+
EllimEqₛ ([ℚ₊] ∷ xs) lrhs e = uncurry (ElimProp.go w)
10221029
where
10231030
w : ElimProp (λ z p EqType xs (lrhs (z , p)))
10241031
w .ElimProp.isPropB q = isPropΠ λ _ isPropEqType xs (lrhs (q , _))
10251032
w .ElimProp.f (ℤ.pos (suc n) , (1+ m)) _ = EllimEqₛ xs (lrhs _) (e n m)
10261033

1034+
1035+
1036+
ℚintervalℙ : ℙ ℚ
1037+
ℚintervalℙ a b x = ((a ≤ x) × (x ≤ b)) ,
1038+
isProp× (isProp≤ _ _) (isProp≤ _ _)

0 commit comments

Comments
 (0)