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