annotate ordinal.agda @ 97:f2b579106770

power set using sup on Def
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 09 Jun 2019 19:41:53 +0900
parents 4659a815b70d
children 1daa1d24348c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34
c9ad0d97ce41 fix oridinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
1 {-# OPTIONS --allow-unsolved-metas #-}
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
2 open import Level
29
fce60b99dc55 posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 28
diff changeset
3 module ordinal where
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
5 open import zf
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
7 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ )
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
8 open import Data.Empty
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
9 open import Relation.Binary.PropositionalEquality
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
11 data OrdinalD {n : Level} : (lv : Nat) → Set n where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
12 Φ : (lv : Nat) → OrdinalD lv
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
13 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
15 record Ordinal {n : Level} : Set n where
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
16 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
17 lv : Nat
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
18 ord : OrdinalD {n} lv
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
19
70
cd9cf8b09610 Union needs +1 space
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
20 --
cd9cf8b09610 Union needs +1 space
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
21 -- Φ (Suc lv) < ℵ lv < OSuc (Suc lv) (ℵ lv) < OSuc ... < OSuc (Suc lv) (Φ (Suc lv)) < OSuc ... < ℵ (Suc lv)
cd9cf8b09610 Union needs +1 space
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 46
diff changeset
22 --
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
23 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
24 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
25 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
26
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
27 open Ordinal
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
28
27
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
29 _o<_ : {n : Level} ( x y : Ordinal ) → Set n
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
30 _o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
32 s<refl : {n : Level } {lx : Nat } { x : OrdinalD {n} lx } → x d< OSuc lx x
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
33 s<refl {n} {lv} {Φ lv} = Φ<
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
34 s<refl {n} {lv} {OSuc lv x} = s< s<refl
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
35
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
36 trio<> : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
37 trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) = trio<> s t
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
38 trio<> {n} {lx} {.(OSuc lx _)} {.(Φ lx)} Φ< ()
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
39
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
40 d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
41 d<→lv Φ< = refl
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
42 d<→lv (s< lt) = refl
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
43
43
0d9b9db14361 equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
44 o<-subst : {n : Level } {Z X z x : Ordinal {n}} → Z o< X → Z ≡ z → X ≡ x → z o< x
0d9b9db14361 equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
45 o<-subst df refl refl = df
0d9b9db14361 equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 41
diff changeset
46
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
47 open import Data.Nat.Properties
30
3b0fdb95618e problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 29
diff changeset
48 open import Data.Unit using ( ⊤ )
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
49 open import Relation.Nullary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
50
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
51 open import Relation.Binary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
52 open import Relation.Binary.Core
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
53
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
54 o∅ : {n : Level} → Ordinal {n}
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
55 o∅ = record { lv = Zero ; ord = Φ Zero }
21
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
56
39
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
57 open import Relation.Binary.HeterogeneousEquality using (_≅_;refl)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
58
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
59 ordinal-cong : {n : Level} {x y : Ordinal {n}} →
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
60 lv x ≡ lv y → ord x ≅ ord y → x ≡ y
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
61 ordinal-cong refl refl = refl
21
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
62
46
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
63 ordinal-lv : {n : Level} {x y : Ordinal {n}} → x ≡ y → lv x ≡ lv y
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
64 ordinal-lv refl = refl
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
65
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
66 ordinal-d : {n : Level} {x y : Ordinal {n}} → x ≡ y → ord x ≅ ord y
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
67 ordinal-d refl = refl
e584686a1307 == and ∅7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 43
diff changeset
68
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
69 ≡→¬d< : {n : Level} → {lv : Nat} → {x : OrdinalD {n} lv } → x d< x → ⊥
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
70 ≡→¬d< {n} {lx} {OSuc lx y} (s< t) = ≡→¬d< t
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
71
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
72 trio<≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
73 trio<≡ refl = ≡→¬d<
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
74
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
75 trio>≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
76 trio>≡ refl = ≡→¬d<
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
77
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
78 triO : {n : Level} → {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
79 triO {n} {lx} {ly} x y = <-cmp lx ly
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
80
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
81 triOrdd : {n : Level} → {lx : Nat} → Trichotomous _≡_ ( _d<_ {n} {lx} {lx} )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
82 triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
83 triOrdd {_} {lv} (Φ lv) (OSuc lv y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
84 triOrdd {_} {lv} (OSuc lv x) (Φ lv) = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
85 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) with triOrdd x y
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
86 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri< a ¬b ¬c = tri< (s< a) (λ tx=ty → trio<≡ tx=ty (s< a) ) ( λ lt → trio<> lt (s< a) )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
87 triOrdd {_} {lv} (OSuc lv x) (OSuc lv x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
88 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) | tri> ¬a ¬b c = tri> ( λ lt → trio<> lt (s< c) ) (λ tx=ty → trio>≡ tx=ty (s< c) ) (s< c)
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
89
74
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
90 osuc : {n : Level} ( x : Ordinal {n} ) → Ordinal {n}
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
91 osuc record { lv = lx ; ord = ox } = record { lv = lx ; ord = OSuc lx ox }
74
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
92
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
93 <-osuc : {n : Level} { x : Ordinal {n} } → x o< osuc x
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
94 <-osuc {n} {record { lv = lx ; ord = Φ .lx }} = case2 Φ<
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
95 <-osuc {n} {record { lv = lx ; ord = OSuc .lx ox }} = case2 ( s< s<refl )
74
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
96
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
97 osuc-lveq : {n : Level} { x : Ordinal {n} } → lv x ≡ lv ( osuc x )
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
98 osuc-lveq {n} = refl
74
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
99
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
100 nat-<> : { x y : Nat } → x < y → y < x → ⊥
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
101 nat-<> (s≤s x<y) (s≤s y<x) = nat-<> x<y y<x
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
102
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
103 nat-<≡ : { x : Nat } → x < x → ⊥
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
104 nat-<≡ (s≤s lt) = nat-<≡ lt
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
105
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
106 nat-≡< : { x y : Nat } → x ≡ y → x < y → ⊥
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
107 nat-≡< refl lt = nat-<≡ lt
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
108
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
109 ¬a≤a : {la : Nat} → Suc la ≤ la → ⊥
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
110 ¬a≤a (s≤s lt) = ¬a≤a lt
74
819da8c08f05 ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 73
diff changeset
111
94
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
112 =→¬< : {x : Nat } → ¬ ( x < x )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
113 =→¬< {Zero} ()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
114 =→¬< {Suc x} (s≤s lt) = =→¬< lt
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
115
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
116 o<¬≡ : {n : Level } ( ox oy : Ordinal {n}) → ox ≡ oy → ox o< oy → ⊥
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
117 o<¬≡ ox ox refl (case1 lt) = =→¬< lt
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
118 o<¬≡ ox ox refl (case2 (s< lt)) = trio<≡ refl lt
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
119
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
120 ¬x<0 : {n : Level} → { x : Ordinal {suc n} } → ¬ ( x o< o∅ {suc n} )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
121 ¬x<0 {n} {x} (case1 ())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
122 ¬x<0 {n} {x} (case2 ())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
123
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
124 o<> : {n : Level} → {x y : Ordinal {n} } → y o< x → x o< y → ⊥
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
125 o<> {n} {x} {y} (case1 x₁) (case1 x₂) = nat-<> x₁ x₂
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
126 o<> {n} {x} {y} (case1 x₁) (case2 x₂) = nat-≡< (sym (d<→lv x₂)) x₁
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
127 o<> {n} {x} {y} (case2 x₁) (case1 x₂) = nat-≡< (sym (d<→lv x₁)) x₂
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
128 o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) (case2 ())
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
129 o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< y<x)) (case2 (s< x<y)) =
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
130 o<> (case2 y<x) (case2 x<y)
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
131
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
132 orddtrans : {n : Level} {lx : Nat} {x y z : OrdinalD {n} lx } → x d< y → y d< z → x d< z
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
133 orddtrans {_} {lx} {.(Φ lx)} {.(OSuc lx _)} {.(OSuc lx _)} Φ< (s< y<z) = Φ<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
134 orddtrans {_} {lx} {.(OSuc lx _)} {.(OSuc lx _)} {.(OSuc lx _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z )
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
135
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
136 osuc-≡< : {n : Level} { a x : Ordinal {n} } → x o< osuc a → (x ≡ a ) ∨ (x o< a)
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
137 osuc-≡< {n} {a} {x} (case1 lt) = case2 (case1 lt)
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
138 osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case1 refl
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
139 osuc-≡< {n} {record { lv = lv₁ ; ord = OSuc .lv₁ ord₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case2 (case2 Φ<)
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
140 osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< ()))
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
141 osuc-≡< {n} {record { lv = la ; ord = OSuc la oa }} {record { lv = la ; ord = (OSuc la ox) }} (case2 (s< lt)) with
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
142 osuc-≡< {n} {record { lv = la ; ord = oa }} {record { lv = la ; ord = ox }} (case2 lt )
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
143 ... | case1 refl = case1 refl
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
144 ... | case2 (case2 x) = case2 (case2( s< x) )
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
145 ... | case2 (case1 x) = ⊥-elim (¬a≤a x) where
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
146
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
147 osuc-< : {n : Level} { x y : Ordinal {n} } → y o< osuc x → x o< y → ⊥
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
148 osuc-< {n} {x} {y} y<ox x<y with osuc-≡< y<ox
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
149 osuc-< {n} {x} {x} y<ox (case1 x₁) | case1 refl = ⊥-elim (¬a≤a x₁)
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
150 osuc-< {n} {x} {x} (case1 x₂) (case2 x₁) | case1 refl = ⊥-elim (¬a≤a x₂)
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
151 osuc-< {n} {x} {x} (case2 x₂) (case2 x₁) | case1 refl = ≡→¬d< x₁
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
152 osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case1 x₁) = nat-<> x₂ x₁
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
153 osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case2 x₁) = nat-≡< (sym (d<→lv x₁)) x₂
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
154 osuc-< {n} {x} {y} y<ox (case2 x<y) | case2 y<x = o<> (case2 x<y) y<x
75
714470702a8b Union done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
155
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
156 max : (x y : Nat) → Nat
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
157 max Zero Zero = Zero
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
158 max Zero (Suc x) = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
159 max (Suc x) Zero = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
160 max (Suc x) (Suc y) = Suc ( max x y )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
162 maxαd : {n : Level} → { lx : Nat } → OrdinalD {n} lx → OrdinalD lx → OrdinalD lx
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
163 maxαd x y with triOrdd x y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
164 maxαd x y | tri< a ¬b ¬c = y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
165 maxαd x y | tri≈ ¬a b ¬c = x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
166 maxαd x y | tri> ¬a ¬b c = x
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
167
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
168 _o≤_ : {n : Level} → Ordinal → Ordinal → Set (suc n)
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
169 a o≤ b = (a ≡ b) ∨ ( a o< b )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
170
27
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
171 ordtrans : {n : Level} {x y z : Ordinal {n} } → x o< y → y o< z → x o< z
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
172 ordtrans {n} {x} {y} {z} (case1 x₁) (case1 x₂) = case1 ( <-trans x₁ x₂ )
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
173 ordtrans {n} {x} {y} {z} (case1 x₁) (case2 x₂) with d<→lv x₂
27
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
174 ... | refl = case1 x₁
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
175 ordtrans {n} {x} {y} {z} (case2 x₁) (case1 x₂) with d<→lv x₁
27
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
176 ... | refl = case1 x₂
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
177 ordtrans {n} {x} {y} {z} (case2 x₁) (case2 x₂) with d<→lv x₁ | d<→lv x₂
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
178 ... | refl | refl = case2 ( orddtrans x₁ x₂ )
bade0a35fdd9 OD, HOD, TC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
179
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
180 trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
181 trio< a b with <-cmp (lv a) (lv b)
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
182 trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) lemma1 where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
183 lemma1 : ¬ (Suc (lv b) ≤ lv a) ∨ (ord b d< ord a)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
184 lemma1 (case1 x) = ¬c x
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
185 lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) a₁ )
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
186 trio< a b | tri> ¬a ¬b c = tri> lemma1 (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
187 lemma1 : ¬ (Suc (lv a) ≤ lv b) ∨ (ord a d< ord b)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
188 lemma1 (case1 x) = ¬a x
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
189 lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) c )
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
190 trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b )
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
191 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri< a ¬b ¬c₁ = tri< (case2 a) (λ refl → ¬b (lemma1 refl )) lemma2 where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
192 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
193 lemma1 refl = refl
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
194 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< x)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
195 lemma2 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
196 lemma2 (case2 x) = trio<> x a
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
197 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri> ¬a₁ ¬b c = tri> lemma2 (λ refl → ¬b (lemma1 refl )) (case2 c) where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
198 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
199 lemma1 refl = refl
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
200 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (x d< ord b)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
201 lemma2 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
202 lemma2 (case2 x) = trio<> x c
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
203 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ lemma1 refl lemma1 where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
204 lemma1 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< ord b)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
205 lemma1 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
206 lemma1 (case2 x) = ≡→¬d< x
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
207
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
208 maxα : {n : Level} → Ordinal {n} → Ordinal → Ordinal
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
209 maxα x y with <-cmp (lv x) (lv y)
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
210 maxα x y | tri< a ¬b ¬c = x
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
211 maxα x y | tri> ¬a ¬b c = y
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
212 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) }
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
213
85
7494ae6b83c6 omax-induction does not work
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
214 --
7494ae6b83c6 omax-induction does not work
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
215 -- max ( osuc x , osuc y )
7494ae6b83c6 omax-induction does not work
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
216 --
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
217
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
218 omax : {n : Level} ( x y : Ordinal {suc n} ) → Ordinal {suc n}
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
219 omax {n} x y with trio< x y
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
220 omax {n} x y | tri< a ¬b ¬c = osuc y
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
221 omax {n} x y | tri> ¬a ¬b c = osuc x
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
222 omax {n} x y | tri≈ ¬a refl ¬c = osuc x
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
223
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
224 omax< : {n : Level} ( x y : Ordinal {suc n} ) → x o< y → osuc y ≡ omax x y
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
225 omax< {n} x y lt with trio< x y
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
226 omax< {n} x y lt | tri< a ¬b ¬c = refl
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
227 omax< {n} x y lt | tri≈ ¬a b ¬c = ⊥-elim (¬a lt )
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
228 omax< {n} x y lt | tri> ¬a ¬b c = ⊥-elim (¬a lt )
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
229
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
230 omax≡ : {n : Level} ( x y : Ordinal {suc n} ) → x ≡ y → osuc y ≡ omax x y
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
231 omax≡ {n} x y eq with trio< x y
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
232 omax≡ {n} x y eq | tri< a ¬b ¬c = ⊥-elim (¬b eq )
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
233 omax≡ {n} x y eq | tri≈ ¬a refl ¬c = refl
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
234 omax≡ {n} x y eq | tri> ¬a ¬b c = ⊥-elim (¬b eq )
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
235
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
236 omax-x : {n : Level} ( x y : Ordinal {suc n} ) → x o< omax x y
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
237 omax-x {n} x y with trio< x y
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
238 omax-x {n} x y | tri< a ¬b ¬c = ordtrans a <-osuc
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
239 omax-x {n} x y | tri> ¬a ¬b c = <-osuc
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
240 omax-x {n} x y | tri≈ ¬a refl ¬c = <-osuc
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
241
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
242 omax-y : {n : Level} ( x y : Ordinal {suc n} ) → y o< omax x y
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
243 omax-y {n} x y with trio< x y
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
244 omax-y {n} x y | tri< a ¬b ¬c = <-osuc
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
245 omax-y {n} x y | tri> ¬a ¬b c = ordtrans c <-osuc
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
246 omax-y {n} x y | tri≈ ¬a refl ¬c = <-osuc
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
247
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
248 omxx : {n : Level} ( x : Ordinal {suc n} ) → omax x x ≡ osuc x
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
249 omxx {n} x with trio< x x
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
250 omxx {n} x | tri< a ¬b ¬c = ⊥-elim (¬b refl )
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
251 omxx {n} x | tri> ¬a ¬b c = ⊥-elim (¬b refl )
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
252 omxx {n} x | tri≈ ¬a refl ¬c = refl
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
253
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
254 omxxx : {n : Level} ( x : Ordinal {suc n} ) → omax x (omax x x ) ≡ osuc (osuc x)
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
255 omxxx {n} x = trans ( cong ( λ k → omax x k ) (omxx x )) (sym ( omax< x (osuc x) <-osuc ))
86
08be6351927e internal error
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 85
diff changeset
256
91
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
257 open _∧_
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
258
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
259 osuc2 : {n : Level} ( x y : Ordinal {suc n} ) → ( osuc x o< osuc (osuc y )) ⇔ (x o< osuc y)
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
260 proj1 (osuc2 {n} x y) (case1 lt) = case1 lt
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
261 proj1 (osuc2 {n} x y) (case2 (s< lt)) = case2 lt
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
262 proj2 (osuc2 {n} x y) (case1 lt) = case1 lt
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
263 proj2 (osuc2 {n} x y) (case2 lt) with d<→lv lt
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
264 ... | refl = case2 (s< lt)
b4742cf4ef97 infinity axiom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
265
88
975e72ae0541 osuc work around done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
266 -- omax≡ (omax x x ) (osuc x) (omxx x)
84
4b2aff372b7c omax ..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
267
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
268 OrdTrans : {n : Level} → Transitive {suc n} _o≤_
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
269 OrdTrans (case1 refl) (case1 refl) = case1 refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
270 OrdTrans (case1 refl) (case2 lt2) = case2 lt2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
271 OrdTrans (case2 lt1) (case1 refl) = case2 lt1
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
272 OrdTrans (case2 x) (case2 y) = case2 (ordtrans x y)
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
273
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
274 OrdPreorder : {n : Level} → Preorder (suc n) (suc n) (suc n)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
275 OrdPreorder {n} = record { Carrier = Ordinal
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
276 ; _≈_ = _≡_
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
277 ; _∼_ = _o≤_
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
278 ; isPreorder = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
279 isEquivalence = record { refl = refl ; sym = sym ; trans = trans }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
280 ; reflexive = case1
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
281 ; trans = OrdTrans
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
282 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
283 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
284
30
3b0fdb95618e problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 29
diff changeset
285 TransFinite : {n : Level} → { ψ : Ordinal {n} → Set n }
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
286 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ lx } ) )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
287 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ψ ( record { lv = lx ; ord = x } ) → ψ ( record { lv = lx ; ord = OSuc lx x } ) )
22
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
288 → ∀ (x : Ordinal) → ψ x
81
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
289 TransFinite caseΦ caseOSuc record { lv = lv ; ord = (Φ (lv)) } = caseΦ lv
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
290 TransFinite caseΦ caseOSuc record { lv = lx ; ord = (OSuc lx ox) } =
96c932d0145d simpler ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
291 caseOSuc lx ox (TransFinite caseΦ caseOSuc record { lv = lx ; ord = ox })
97
f2b579106770 power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
292