Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate ordinal.agda @ 73:dd430a95610f
fix ordinal
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 01 Jun 2019 18:17:24 +0900 |
parents | f39f1a90d154 |
children | 819da8c08f05 |
rev | line source |
---|---|
34 | 1 {-# OPTIONS --allow-unsolved-metas #-} |
16 | 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 | 4 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
5 open import zf |
3 | 6 |
23 | 7 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
3 | 8 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
9 open import Relation.Binary.PropositionalEquality |
3 | 10 |
24 | 11 data OrdinalD {n : Level} : (lv : Nat) → Set n where |
12 Φ : (lv : Nat) → OrdinalD lv | |
13 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv | |
17 | 14 ℵ_ : (lv : Nat) → OrdinalD (Suc lv) |
3 | 15 |
24 | 16 record Ordinal {n : Level} : Set n where |
16 | 17 field |
18 lv : Nat | |
24 | 19 ord : OrdinalD {n} lv |
16 | 20 |
34 | 21 data ¬ℵ {n : Level} {lx : Nat } : ( x : OrdinalD {n} lx ) → Set where |
22 ¬ℵΦ : ¬ℵ (Φ lx) | |
23 ¬ℵs : {x : OrdinalD {n} lx } → ¬ℵ x → ¬ℵ (OSuc lx x) | |
24 | |
70 | 25 -- |
26 -- Φ (Suc lv) < ℵ lv < OSuc (Suc lv) (ℵ lv) < OSuc ... < OSuc (Suc lv) (Φ (Suc lv)) < OSuc ... < ℵ (Suc lv) | |
27 -- | |
24 | 28 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where |
29 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x | |
30 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y | |
41 | 31 ℵΦ< : {lx : Nat} → Φ (Suc lx) d< (ℵ lx) |
34 | 32 ℵ< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → ¬ℵ x → OSuc (Suc lx) x d< (ℵ lx) |
33 ℵs< : {lx : Nat} → (ℵ lx) d< OSuc (Suc lx) (ℵ lx) | |
35 | 34 ℵss< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → (ℵ lx) d< x → (ℵ lx) d< OSuc (Suc lx) x |
17 | 35 |
36 open Ordinal | |
37 | |
27 | 38 _o<_ : {n : Level} ( x y : Ordinal ) → Set n |
17 | 39 _o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y ) |
3 | 40 |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
41
diff
changeset
|
41 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
|
42 o<-subst df refl refl = df |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
41
diff
changeset
|
43 |
71
d088eb66564e
add osuc ( next larger element of Ordinal )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
70
diff
changeset
|
44 osuc : {n : Level} ( x : Ordinal {n} ) → Ordinal {n} |
73 | 45 osuc record { lv = 0 ; ord = (Φ lv) } = record { lv = 0 ; ord = OSuc 0 (Φ lv) } |
46 osuc record { lv = Suc lx ; ord = (Φ (Suc lv)) } = record { lv = Suc lx ; ord = ℵ lv } | |
72 | 47 osuc record { lv = lx ; ord = (OSuc lx ox ) } = record { lv = lx ; ord = OSuc lx (OSuc lx ox) } |
71
d088eb66564e
add osuc ( next larger element of Ordinal )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
70
diff
changeset
|
48 osuc record { lv = Suc lx ; ord = ℵ lx } = record { lv = Suc lx ; ord = OSuc (Suc lx) (ℵ lx) } |
d088eb66564e
add osuc ( next larger element of Ordinal )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
70
diff
changeset
|
49 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
50 open import Data.Nat.Properties |
6 | 51 open import Data.Empty |
30
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
52 open import Data.Unit using ( ⊤ ) |
6 | 53 open import Relation.Nullary |
54 | |
55 open import Relation.Binary | |
56 open import Relation.Binary.Core | |
57 | |
24 | 58 o∅ : {n : Level} → Ordinal {n} |
59 o∅ = record { lv = Zero ; ord = Φ Zero } | |
21 | 60 |
34 | 61 s<refl : {n : Level } {lx : Nat } { x : OrdinalD {n} lx } → x d< OSuc lx x |
62 s<refl {n} {lv} {Φ lv} = Φ< | |
63 s<refl {n} {lv} {OSuc lv x} = s< s<refl | |
64 s<refl {n} {Suc lv} {ℵ lv} = ℵs< | |
65 | |
72 | 66 <-osuc : {n : Level} { x : Ordinal {n} } → x o< osuc x |
73 | 67 <-osuc {n} { record { lv = 0 ; ord = Φ 0 } } = case2 Φ< |
68 <-osuc {n} { record { lv = (Suc lv) ; ord = Φ (Suc lv) } } = case2 ℵΦ< | |
69 <-osuc {n} {record { lv = Zero ; ord = OSuc .0 ox }} = case2 ( s< s<refl ) | |
70 <-osuc {n} {record { lv = Suc lv₁ ; ord = OSuc .(Suc lv₁) ox }} = case2 ( s< s<refl ) | |
72 | 71 <-osuc {n} { record { lv = .(Suc lv₁) ; ord = (ℵ lv₁) } } = case2 ℵs< |
72 | |
73 | 73 osuc-lveq : {n : Level} { x : Ordinal {n} } → lv x ≡ lv ( osuc x ) |
74 osuc-lveq {n} {record { lv = 0 ; ord = Φ 0 }} = refl | |
75 osuc-lveq {n} {record { lv = Suc lv ; ord = Φ (Suc lv) }} = refl | |
76 osuc-lveq {n} {record { lv = Zero ; ord = OSuc .0 ord₁ }} = refl | |
77 osuc-lveq {n} {record { lv = Suc lv₁ ; ord = OSuc .(Suc lv₁) ord₁ }} = refl | |
78 osuc-lveq {n} {record { lv = .(Suc lv₁) ; ord = ℵ lv₁ }} = refl | |
79 | |
80 nat-<> : { x y : Nat } → x < y → y < x → ⊥ | |
81 nat-<> (s≤s x<y) (s≤s y<x) = nat-<> x<y y<x | |
82 | |
83 osuc-< : {n : Level} { x y : Ordinal {n} } → y o< osuc x → x o< y → ⊥ | |
84 osuc-< {n} {record { lv = .0 ; ord = Φ .0 }} {record { lv = .(Suc _) ; ord = ord }} (case1 ()) (case1 (s≤s z≤n)) | |
85 osuc-< {n} {record { lv = .0 ; ord = OSuc .0 ord₁ }} {record { lv = .(Suc _) ; ord = ord }} (case1 ()) (case1 (s≤s z≤n)) | |
86 osuc-< {n} {record { lv = lx ; ord = xo }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) with osuc-lveq {n} {record { lv = lx ; ord = xo }} | |
87 osuc-< {n} {record { lv = Zero ; ord = Φ .0 }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) | eq = nat-<> lt1 lt2 | |
88 osuc-< {n} {record { lv = Suc lx ; ord = Φ .(Suc lx) }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) | eq = nat-<> lt1 lt2 | |
89 osuc-< {n} {record { lv = Zero ; ord = OSuc .0 xo }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) | eq = nat-<> lt1 lt2 | |
90 osuc-< {n} {record { lv = Suc lx ; ord = OSuc .(Suc lx) xo }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) | eq = nat-<> lt1 lt2 | |
91 osuc-< {n} {record { lv = .(Suc lv₁) ; ord = ℵ lv₁ }} {record { lv = ly ; ord = yo }} (case1 lt1) (case1 lt2) | refl = nat-<> lt1 lt2 | |
92 osuc-< {n} {x} {y} (case1 x₁) (case2 x₂) = {!!} | |
93 osuc-< {n} {x} {y} (case2 x₁) (case1 x₂) = {!!} | |
94 osuc-< {n} {x} {y} (case2 x₁) (case2 x₂) = {!!} | |
95 | |
39 | 96 open import Relation.Binary.HeterogeneousEquality using (_≅_;refl) |
97 | |
98 ordinal-cong : {n : Level} {x y : Ordinal {n}} → | |
99 lv x ≡ lv y → ord x ≅ ord y → x ≡ y | |
100 ordinal-cong refl refl = refl | |
21 | 101 |
46 | 102 ordinal-lv : {n : Level} {x y : Ordinal {n}} → x ≡ y → lv x ≡ lv y |
103 ordinal-lv refl = refl | |
104 | |
105 ordinal-d : {n : Level} {x y : Ordinal {n}} → x ≡ y → ord x ≅ ord y | |
106 ordinal-d refl = refl | |
107 | |
24 | 108 ≡→¬d< : {n : Level} → {lv : Nat} → {x : OrdinalD {n} lv } → x d< x → ⊥ |
109 ≡→¬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
|
110 |
24 | 111 trio<> : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ |
34 | 112 trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) = trio<> s t |
113 trio<> {_} {.(Suc _)} {.(OSuc (Suc _) (ℵ _))} {.(ℵ _)} ℵs< (ℵ< {_} {.(ℵ _)} ()) | |
114 trio<> {_} {.(Suc _)} {.(ℵ _)} {.(OSuc (Suc _) (ℵ _))} (ℵ< ()) ℵs< | |
35 | 115 trio<> {n} {lx} {.(OSuc lx _)} {.(Φ lx)} Φ< () |
116 trio<> {n} {.(Suc _)} {.(ℵ _)} {.(Φ (Suc _))} ℵΦ< () | |
117 trio<> {n} {.(Suc _)} {.(ℵ _)} {.(OSuc (Suc _) (Φ (Suc _)))} (ℵ< ¬ℵΦ) (ℵss< ()) | |
118 trio<> {n} {.(Suc _)} {.(ℵ _)} {.(OSuc (Suc _) (OSuc (Suc _) _))} (ℵ< (¬ℵs x)) (ℵss< x<y) = trio<> (ℵ< x) x<y | |
119 trio<> {n} {.(Suc _)} {.(OSuc (Suc _) (Φ (Suc _)))} {.(ℵ _)} (ℵss< ()) (ℵ< ¬ℵΦ) | |
120 trio<> {n} {.(Suc _)} {.(OSuc (Suc _) (OSuc (Suc _) _))} {.(ℵ _)} (ℵss< y<x) (ℵ< (¬ℵs x)) = trio<> y<x (ℵ< x) | |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
121 |
24 | 122 trio<≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥ |
17 | 123 trio<≡ refl = ≡→¬d< |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
124 |
24 | 125 trio>≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ |
17 | 126 trio>≡ refl = ≡→¬d< |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
127 |
24 | 128 triO : {n : Level} → {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly ) |
129 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
|
130 |
35 | 131 fin : {n : Level} → {lx : Nat} → {y : OrdinalD {n} (Suc lx) } → y d< (ℵ lx) → ¬ℵ y |
132 fin {_} {_} {Φ (Suc _)} ℵΦ< = ¬ℵΦ | |
133 fin {_} {_} {OSuc (Suc _) _} (ℵ< x) = ¬ℵs x | |
134 | |
24 | 135 triOrdd : {n : Level} → {lx : Nat} → Trichotomous _≡_ ( _d<_ {n} {lx} {lx} ) |
136 triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
137 triOrdd {_} {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
138 triOrdd {_} {lv} (Φ lv) (OSuc lv y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) | |
41 | 139 triOrdd {_} {.(Suc lv)} (Φ (Suc lv)) (ℵ lv) = tri< ℵΦ< (λ ()) ( λ lt → trio<> lt ℵΦ<) |
140 triOrdd {_} {Suc lv} (ℵ lv) (Φ (Suc lv)) = tri> ( λ lt → trio<> lt ℵΦ< ) (λ ()) ℵΦ< | |
35 | 141 triOrdd {_} {Suc lv} (ℵ lv) (OSuc (Suc lv) y ) with triOrdd (ℵ lv) y |
142 triOrdd {_} {Suc lv} (ℵ lv) (OSuc .(Suc lv) y) | tri< a ¬b ¬c = tri< (ℵss< a) (λ ()) (trio<> (ℵss< a) ) | |
143 triOrdd {_} {Suc lv} (ℵ lv) (OSuc .(Suc lv) y) | tri≈ ¬a refl ¬c = tri< ℵs< (λ ()) ( λ lt → trio<> lt ℵs< ) | |
144 triOrdd {_} {Suc lv} (ℵ lv) (OSuc .(Suc lv) y) | tri> ¬a ¬b c = tri> ( λ lt → trio<> lt ( ℵ< (fin c)) ) (λ ()) ( ℵ< (fin c) ) | |
24 | 145 triOrdd {_} {lv} (OSuc lv x) (Φ lv) = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< |
35 | 146 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) with triOrdd x (ℵ lv) |
147 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) | tri< a ¬b ¬c = tri< (ℵ< (fin a ) ) (λ ()) ( λ lt → trio<> lt (ℵ< (fin a ))) | |
148 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) | tri≈ ¬a refl ¬c = tri> (λ lt → trio<> lt ℵs< ) (λ ()) ℵs< | |
149 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) | tri> ¬a ¬b c = tri> (λ lt → trio<> lt (ℵss< c )) (λ ()) ( ℵss< c ) | |
24 | 150 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) with triOrdd x y |
151 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) ) | |
152 triOrdd {_} {lv} (OSuc lv x) (OSuc lv x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< | |
153 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
|
154 |
24 | 155 d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y |
17 | 156 d<→lv Φ< = refl |
157 d<→lv (s< lt) = refl | |
158 d<→lv ℵΦ< = refl | |
34 | 159 d<→lv (ℵ< _) = refl |
160 d<→lv ℵs< = refl | |
35 | 161 d<→lv (ℵss< _) = refl |
162 | |
163 xsyℵ : {n : Level} {lx : Nat} {x y : OrdinalD {n} lx } → x d< y → ¬ℵ y → ¬ℵ x | |
164 xsyℵ {_} {_} {Φ lv₁} {y} x<y t = ¬ℵΦ | |
165 xsyℵ {_} {_} {OSuc lv₁ x} {OSuc lv₁ y} (s< x<y) (¬ℵs t) = ¬ℵs ( xsyℵ x<y t) | |
166 xsyℵ {_} {_} {OSuc .(Suc _) x} {.(ℵ _)} (ℵ< x₁) () | |
167 xsyℵ {_} {_} {ℵ lv₁} {.(OSuc (Suc lv₁) (ℵ lv₁))} ℵs< (¬ℵs t) = t | |
168 xsyℵ (ℵss< ()) (¬ℵs ¬ℵΦ) | |
169 xsyℵ (ℵss< x<y) (¬ℵs t) = xsyℵ x<y t | |
16 | 170 |
24 | 171 orddtrans : {n : Level} {lx : Nat} {x y z : OrdinalD {n} lx } → x d< y → y d< z → x d< z |
172 orddtrans {_} {lx} {.(Φ lx)} {.(OSuc lx _)} {.(OSuc lx _)} Φ< (s< y<z) = Φ< | |
41 | 173 orddtrans {_} {Suc lx} {Φ (Suc lx)} {OSuc (Suc lx) y} {ℵ lx} Φ< (ℵ< _) = ℵΦ< |
24 | 174 orddtrans {_} {lx} {.(OSuc lx _)} {.(OSuc lx _)} {.(OSuc lx _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z ) |
34 | 175 orddtrans {_} {Suc lx} {.(OSuc (Suc lx) _)} {.(OSuc (Suc lx) (Φ (Suc lx)))} {.(ℵ lx)} (s< ()) (ℵ< ¬ℵΦ) |
176 orddtrans ℵs< (ℵ< ()) | |
35 | 177 orddtrans {n} {Suc lx} {OSuc (Suc lx) x} {OSuc (Suc ly) y} {ℵ _} (s< x<y) (ℵ< t) = ℵ< ( xsyℵ x<y t ) |
178 orddtrans {n} {.(Suc _)} {.(Φ (Suc _))} {.(ℵ _)} {.(OSuc (Suc _) (ℵ _))} ℵΦ< ℵs< = Φ< | |
41 | 179 orddtrans {n} {.(Suc _)} {OSuc (Suc _) .(Φ (Suc _))} {.(ℵ _)} {OSuc (Suc _) (ℵ k)} (ℵ< ¬ℵΦ) ℵs< = s< ℵΦ< |
35 | 180 orddtrans {n} {.(Suc _)} {OSuc (Suc lv) (OSuc (Suc _) x)} {ℵ lv} {.(OSuc (Suc _) (ℵ _))} (ℵ< (¬ℵs t)) ℵs< = s< ( ℵ< t ) |
181 orddtrans {n} {.(Suc lv)} {ℵ lv} {OSuc .(Suc lv) (ℵ lv)} {OSuc .(Suc lv) .(OSuc (Suc lv) (ℵ lv))} ℵs< (s< ℵs<) = ℵss< ℵs< | |
182 orddtrans ℵΦ< (ℵss< y<z) = Φ< | |
41 | 183 orddtrans (ℵ< {lx} {Φ .(Suc lx)} nxx) (ℵss< {_} {k} y<z) = s< (orddtrans ℵΦ< y<z) |
35 | 184 orddtrans (ℵ< {lx} {OSuc .(Suc lx) xx} (¬ℵs nxx)) (ℵss< y<z) = s< (orddtrans (ℵ< nxx) y<z) |
185 orddtrans (ℵ< {.lv₁} {ℵ lv₁} ()) (ℵss< y<z) | |
186 orddtrans (ℵss< x<y) (s< y<z) = ℵss< ( orddtrans x<y y<z ) | |
187 orddtrans (ℵss< ()) (ℵ< ¬ℵΦ) | |
188 orddtrans (ℵss< ℵs<) (ℵ< (¬ℵs ())) | |
189 orddtrans (ℵss< (ℵss< x<y)) (ℵ< (¬ℵs x)) = orddtrans (ℵss< x<y) ( ℵ< x ) | |
190 orddtrans {n} {Suc lx} {x} {y} {z} ℵs< (s< (ℵss< {lx} {ss} y<z)) = ℵss< ( ℵss< y<z ) | |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
191 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
192 max : (x y : Nat) → Nat |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
193 max Zero Zero = Zero |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
194 max Zero (Suc x) = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
195 max (Suc x) Zero = (Suc x) |
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
196 max (Suc x) (Suc y) = Suc ( max x y ) |
3 | 197 |
24 | 198 maxαd : {n : Level} → { lx : Nat } → OrdinalD {n} lx → OrdinalD lx → OrdinalD lx |
17 | 199 maxαd x y with triOrdd x y |
200 maxαd x y | tri< a ¬b ¬c = y | |
201 maxαd x y | tri≈ ¬a b ¬c = x | |
202 maxαd x y | tri> ¬a ¬b c = x | |
6 | 203 |
24 | 204 maxα : {n : Level} → Ordinal {n} → Ordinal → Ordinal |
17 | 205 maxα x y with <-cmp (lv x) (lv y) |
206 maxα x y | tri< a ¬b ¬c = x | |
207 maxα x y | tri> ¬a ¬b c = y | |
208 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) } | |
7 | 209 |
24 | 210 _o≤_ : {n : Level} → Ordinal → Ordinal → Set (suc n) |
23 | 211 a o≤ b = (a ≡ b) ∨ ( a o< b ) |
212 | |
27 | 213 ordtrans : {n : Level} {x y z : Ordinal {n} } → x o< y → y o< z → x o< z |
214 ordtrans {n} {x} {y} {z} (case1 x₁) (case1 x₂) = case1 ( <-trans x₁ x₂ ) | |
215 ordtrans {n} {x} {y} {z} (case1 x₁) (case2 x₂) with d<→lv x₂ | |
216 ... | refl = case1 x₁ | |
217 ordtrans {n} {x} {y} {z} (case2 x₁) (case1 x₂) with d<→lv x₁ | |
218 ... | refl = case1 x₂ | |
219 ordtrans {n} {x} {y} {z} (case2 x₁) (case2 x₂) with d<→lv x₁ | d<→lv x₂ | |
220 ... | refl | refl = case2 ( orddtrans x₁ x₂ ) | |
221 | |
222 | |
24 | 223 trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_ |
23 | 224 trio< a b with <-cmp (lv a) (lv b) |
24 | 225 trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) lemma1 where |
226 lemma1 : ¬ (Suc (lv b) ≤ lv a) ∨ (ord b d< ord a) | |
227 lemma1 (case1 x) = ¬c x | |
228 lemma1 (case2 x) with d<→lv x | |
229 lemma1 (case2 x) | refl = ¬b refl | |
230 trio< a b | tri> ¬a ¬b c = tri> lemma1 (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) where | |
231 lemma1 : ¬ (Suc (lv a) ≤ lv b) ∨ (ord a d< ord b) | |
232 lemma1 (case1 x) = ¬a x | |
233 lemma1 (case2 x) with d<→lv x | |
234 lemma1 (case2 x) | refl = ¬b refl | |
23 | 235 trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b ) |
24 | 236 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 |
237 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
238 lemma1 refl = refl | |
239 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< x) | |
240 lemma2 (case1 x) = ¬a x | |
241 lemma2 (case2 x) = trio<> x a | |
242 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 | |
243 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
244 lemma1 refl = refl | |
245 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (x d< ord b) | |
246 lemma2 (case1 x) = ¬a x | |
247 lemma2 (case2 x) = trio<> x c | |
248 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ lemma1 refl lemma1 where | |
249 lemma1 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< ord b) | |
250 lemma1 (case1 x) = ¬a x | |
251 lemma1 (case2 x) = ≡→¬d< x | |
23 | 252 |
24 | 253 OrdTrans : {n : Level} → Transitive {suc n} _o≤_ |
16 | 254 OrdTrans (case1 refl) (case1 refl) = case1 refl |
255 OrdTrans (case1 refl) (case2 lt2) = case2 lt2 | |
256 OrdTrans (case2 lt1) (case1 refl) = case2 lt1 | |
17 | 257 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) ) |
258 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y | |
259 OrdTrans (case2 (case1 x)) (case2 (case2 y)) | refl = case2 (case1 x ) | |
260 OrdTrans (case2 (case2 x)) (case2 (case1 y)) with d<→lv x | |
261 OrdTrans (case2 (case2 x)) (case2 (case1 y)) | refl = case2 (case1 y) | |
262 OrdTrans (case2 (case2 x)) (case2 (case2 y)) with d<→lv x | d<→lv y | |
263 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y )) | |
16 | 264 |
24 | 265 OrdPreorder : {n : Level} → Preorder (suc n) (suc n) (suc n) |
266 OrdPreorder {n} = record { Carrier = Ordinal | |
16 | 267 ; _≈_ = _≡_ |
23 | 268 ; _∼_ = _o≤_ |
16 | 269 ; isPreorder = record { |
270 isEquivalence = record { refl = refl ; sym = sym ; trans = trans } | |
271 ; reflexive = case1 | |
24 | 272 ; trans = OrdTrans |
16 | 273 } |
274 } | |
275 | |
30
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
276 TransFinite : {n : Level} → { ψ : Ordinal {n} → Set n } |
22 | 277 → ( ∀ (lx : Nat ) → ψ ( record { lv = Suc lx ; ord = ℵ lx } )) |
24 | 278 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ lx } ) ) |
279 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ψ ( record { lv = lx ; ord = x } ) → ψ ( record { lv = lx ; ord = OSuc lx x } ) ) | |
22 | 280 → ∀ (x : Ordinal) → ψ x |
30
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
281 TransFinite caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ lv } = caseΦ lv |
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
282 TransFinite caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc lv ord₁ } = caseOSuc lv ord₁ |
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
283 ( TransFinite caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } )) |
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
284 TransFinite caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁ |
22 | 285 |