Mercurial > hg > Members > kono > Proof > ZF-in-agda
annotate ordinal.agda @ 324:fbabb20f222e
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 04 Jul 2020 18:18:17 +0900 |
parents | 6f10c47e4e7a |
children | 1a54dbe1ea4c |
rev | line source |
---|---|
16 | 1 open import Level |
29
fce60b99dc55
posturate OD is isomorphic to Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
2 module ordinal where |
3 | 3 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
4 open import zf |
3 | 5 |
23 | 6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) |
75 | 7 open import Data.Empty |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
8 open import Relation.Binary.PropositionalEquality |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
204
diff
changeset
|
9 open import logic |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
204
diff
changeset
|
10 open import nat |
3 | 11 |
24 | 12 data OrdinalD {n : Level} : (lv : Nat) → Set n where |
13 Φ : (lv : Nat) → OrdinalD lv | |
14 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv | |
3 | 15 |
24 | 16 record Ordinal {n : Level} : Set n where |
202
ed88384b5102
ε-induction like loop again
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
184
diff
changeset
|
17 constructor ordinal |
16 | 18 field |
19 lv : Nat | |
24 | 20 ord : OrdinalD {n} lv |
16 | 21 |
24 | 22 data _d<_ {n : Level} : {lx ly : Nat} → OrdinalD {n} lx → OrdinalD {n} ly → Set n where |
23 Φ< : {lx : Nat} → {x : OrdinalD {n} lx} → Φ lx d< OSuc lx x | |
24 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y | |
17 | 25 |
26 open Ordinal | |
27 | |
27 | 28 _o<_ : {n : Level} ( x y : Ordinal ) → Set n |
17 | 29 _o<_ x y = (lv x < lv y ) ∨ ( ord x d< ord y ) |
3 | 30 |
75 | 31 s<refl : {n : Level } {lx : Nat } { x : OrdinalD {n} lx } → x d< OSuc lx x |
32 s<refl {n} {lv} {Φ lv} = Φ< | |
33 s<refl {n} {lv} {OSuc lv x} = s< s<refl | |
34 | |
35 trio<> : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥ | |
36 trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) = trio<> s t | |
37 trio<> {n} {lx} {.(OSuc lx _)} {.(Φ lx)} Φ< () | |
38 | |
39 d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y | |
40 d<→lv Φ< = refl | |
41 d<→lv (s< lt) = refl | |
42 | |
43
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
41
diff
changeset
|
43 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
|
44 o<-subst df refl refl = df |
0d9b9db14361
equalitu and internal parametorisity
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
41
diff
changeset
|
45 |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
46 open import Data.Nat.Properties |
30
3b0fdb95618e
problem on Ordinal ( OSuc ℵ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
29
diff
changeset
|
47 open import Data.Unit using ( ⊤ ) |
6 | 48 open import Relation.Nullary |
49 | |
50 open import Relation.Binary | |
51 open import Relation.Binary.Core | |
52 | |
24 | 53 o∅ : {n : Level} → Ordinal {n} |
54 o∅ = record { lv = Zero ; ord = Φ Zero } | |
21 | 55 |
39 | 56 open import Relation.Binary.HeterogeneousEquality using (_≅_;refl) |
57 | |
58 ordinal-cong : {n : Level} {x y : Ordinal {n}} → | |
59 lv x ≡ lv y → ord x ≅ ord y → x ≡ y | |
60 ordinal-cong refl refl = refl | |
21 | 61 |
24 | 62 ≡→¬d< : {n : Level} → {lv : Nat} → {x : OrdinalD {n} lv } → x d< x → ⊥ |
63 ≡→¬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
|
64 |
24 | 65 trio<≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥ |
17 | 66 trio<≡ refl = ≡→¬d< |
14
e11e95d5ddee
separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
11
diff
changeset
|
67 |
24 | 68 trio>≡ : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥ |
17 | 69 trio>≡ refl = ≡→¬d< |
9
5ed16e2d8eb7
try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
8
diff
changeset
|
70 |
24 | 71 triOrdd : {n : Level} → {lx : Nat} → Trichotomous _≡_ ( _d<_ {n} {lx} {lx} ) |
72 triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d< | |
73 triOrdd {_} {lv} (Φ lv) (OSuc lv y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< ) | |
74 triOrdd {_} {lv} (OSuc lv x) (Φ lv) = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ< | |
75 triOrdd {_} {lv} (OSuc lv x) (OSuc lv y) with triOrdd x y | |
76 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) ) | |
77 triOrdd {_} {lv} (OSuc lv x) (OSuc lv x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d< | |
78 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
|
79 |
74
819da8c08f05
ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
73
diff
changeset
|
80 osuc : {n : Level} ( x : Ordinal {n} ) → Ordinal {n} |
75 | 81 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
|
82 |
819da8c08f05
ordinal atomical successor?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
73
diff
changeset
|
83 <-osuc : {n : Level} { x : Ordinal {n} } → x o< osuc x |
75 | 84 <-osuc {n} {record { lv = lx ; ord = Φ .lx }} = case2 Φ< |
85 <-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
|
86 |
203
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
87 o<¬≡ : {n : Level } { ox oy : Ordinal {suc n}} → ox ≡ oy → ox o< oy → ⊥ |
111 | 88 o<¬≡ {_} {ox} {ox} refl (case1 lt) = =→¬< lt |
89 o<¬≡ {_} {ox} {ox} refl (case2 (s< lt)) = trio<≡ refl lt | |
94 | 90 |
91 ¬x<0 : {n : Level} → { x : Ordinal {suc n} } → ¬ ( x o< o∅ {suc n} ) | |
92 ¬x<0 {n} {x} (case1 ()) | |
93 ¬x<0 {n} {x} (case2 ()) | |
94 | |
81 | 95 o<> : {n : Level} → {x y : Ordinal {n} } → y o< x → x o< y → ⊥ |
96 o<> {n} {x} {y} (case1 x₁) (case1 x₂) = nat-<> x₁ x₂ | |
97 o<> {n} {x} {y} (case1 x₁) (case2 x₂) = nat-≡< (sym (d<→lv x₂)) x₁ | |
98 o<> {n} {x} {y} (case2 x₁) (case1 x₂) = nat-≡< (sym (d<→lv x₁)) x₂ | |
99 o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) (case2 ()) | |
100 o<> {n} {record { lv = lv₁ ; ord = .(OSuc lv₁ _) }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< y<x)) (case2 (s< x<y)) = | |
101 o<> (case2 y<x) (case2 x<y) | |
16 | 102 |
24 | 103 orddtrans : {n : Level} {lx : Nat} {x y z : OrdinalD {n} lx } → x d< y → y d< z → x d< z |
104 orddtrans {_} {lx} {.(Φ lx)} {.(OSuc lx _)} {.(OSuc lx _)} Φ< (s< y<z) = Φ< | |
105 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
|
106 |
75 | 107 osuc-≡< : {n : Level} { a x : Ordinal {n} } → x o< osuc a → (x ≡ a ) ∨ (x o< a) |
108 osuc-≡< {n} {a} {x} (case1 lt) = case2 (case1 lt) | |
109 osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case1 refl | |
110 osuc-≡< {n} {record { lv = lv₁ ; ord = OSuc .lv₁ ord₁ }} {record { lv = .lv₁ ; ord = .(Φ lv₁) }} (case2 Φ<) = case2 (case2 Φ<) | |
111 osuc-≡< {n} {record { lv = lv₁ ; ord = Φ .lv₁ }} {record { lv = .lv₁ ; ord = .(OSuc lv₁ _) }} (case2 (s< ())) | |
112 osuc-≡< {n} {record { lv = la ; ord = OSuc la oa }} {record { lv = la ; ord = (OSuc la ox) }} (case2 (s< lt)) with | |
113 osuc-≡< {n} {record { lv = la ; ord = oa }} {record { lv = la ; ord = ox }} (case2 lt ) | |
114 ... | case1 refl = case1 refl | |
115 ... | case2 (case2 x) = case2 (case2( s< x) ) | |
116 ... | case2 (case1 x) = ⊥-elim (¬a≤a x) where | |
117 | |
118 osuc-< : {n : Level} { x y : Ordinal {n} } → y o< osuc x → x o< y → ⊥ | |
119 osuc-< {n} {x} {y} y<ox x<y with osuc-≡< y<ox | |
120 osuc-< {n} {x} {x} y<ox (case1 x₁) | case1 refl = ⊥-elim (¬a≤a x₁) | |
121 osuc-< {n} {x} {x} (case1 x₂) (case2 x₁) | case1 refl = ⊥-elim (¬a≤a x₂) | |
122 osuc-< {n} {x} {x} (case2 x₂) (case2 x₁) | case1 refl = ≡→¬d< x₁ | |
81 | 123 osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case1 x₁) = nat-<> x₂ x₁ |
124 osuc-< {n} {x} {y} y<ox (case1 x₂) | case2 (case2 x₁) = nat-≡< (sym (d<→lv x₁)) x₂ | |
125 osuc-< {n} {x} {y} y<ox (case2 x<y) | case2 y<x = o<> (case2 x<y) y<x | |
75 | 126 |
23 | 127 |
27 | 128 ordtrans : {n : Level} {x y z : Ordinal {n} } → x o< y → y o< z → x o< z |
129 ordtrans {n} {x} {y} {z} (case1 x₁) (case1 x₂) = case1 ( <-trans x₁ x₂ ) | |
81 | 130 ordtrans {n} {x} {y} {z} (case1 x₁) (case2 x₂) with d<→lv x₂ |
27 | 131 ... | refl = case1 x₁ |
81 | 132 ordtrans {n} {x} {y} {z} (case2 x₁) (case1 x₂) with d<→lv x₁ |
27 | 133 ... | refl = case1 x₂ |
134 ordtrans {n} {x} {y} {z} (case2 x₁) (case2 x₂) with d<→lv x₁ | d<→lv x₂ | |
135 ... | refl | refl = case2 ( orddtrans x₁ x₂ ) | |
136 | |
24 | 137 trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_ |
23 | 138 trio< a b with <-cmp (lv a) (lv b) |
24 | 139 trio< a b | tri< a₁ ¬b ¬c = tri< (case1 a₁) (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) lemma1 where |
140 lemma1 : ¬ (Suc (lv b) ≤ lv a) ∨ (ord b d< ord a) | |
141 lemma1 (case1 x) = ¬c x | |
81 | 142 lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) a₁ ) |
24 | 143 trio< a b | tri> ¬a ¬b c = tri> lemma1 (λ refl → ¬b (cong ( λ x → lv x ) refl ) ) (case1 c) where |
144 lemma1 : ¬ (Suc (lv a) ≤ lv b) ∨ (ord a d< ord b) | |
145 lemma1 (case1 x) = ¬a x | |
81 | 146 lemma1 (case2 x) = ⊥-elim (nat-≡< (sym ( d<→lv x )) c ) |
23 | 147 trio< a b | tri≈ ¬a refl ¬c with triOrdd ( ord a ) ( ord b ) |
24 | 148 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 |
149 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
150 lemma1 refl = refl | |
151 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< x) | |
152 lemma2 (case1 x) = ¬a x | |
153 lemma2 (case2 x) = trio<> x a | |
154 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 | |
155 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b | |
156 lemma1 refl = refl | |
157 lemma2 : ¬ (Suc (lv b) ≤ lv b) ∨ (x d< ord b) | |
158 lemma2 (case1 x) = ¬a x | |
159 lemma2 (case2 x) = trio<> x c | |
160 trio< record { lv = .(lv b) ; ord = x } b | tri≈ ¬a refl ¬c | tri≈ ¬a₁ refl ¬c₁ = tri≈ lemma1 refl lemma1 where | |
161 lemma1 : ¬ (Suc (lv b) ≤ lv b) ∨ (ord b d< ord b) | |
162 lemma1 (case1 x) = ¬a x | |
163 lemma1 (case2 x) = ≡→¬d< x | |
23 | 164 |
86 | 165 |
91 | 166 open _∧_ |
167 | |
203
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
168 TransFinite : {n m : Level} → { ψ : Ordinal {suc n} → Set m } |
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
169 → ( ∀ (lx : Nat ) → ( (x : Ordinal {suc n} ) → x o< ordinal lx (Φ lx) → ψ x ) → ψ ( record { lv = lx ; ord = Φ lx } ) ) |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
170 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ( (y : Ordinal {suc n} ) → y o< ordinal lx (OSuc lx x) → ψ y ) → ψ ( record { lv = lx ; ord = OSuc lx x } ) ) |
22 | 171 → ∀ (x : Ordinal) → ψ x |
204
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
172 TransFinite {n} {m} {ψ} caseΦ caseOSuc x = proj1 (TransFinite1 (lv x) (ord x) ) where |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
173 TransFinite1 : (lx : Nat) (ox : OrdinalD lx ) → ψ (ordinal lx ox) ∧ ( ( (x : Ordinal {suc n} ) → x o< ordinal lx ox → ψ x ) ) |
204
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
174 TransFinite1 Zero (Φ 0) = record { proj1 = caseΦ Zero lemma ; proj2 = lemma1 } where |
203
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
175 lemma : (x : Ordinal) → x o< ordinal Zero (Φ Zero) → ψ x |
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
176 lemma x (case1 ()) |
8edd2a13a7f3
fixing transfinte induction...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
202
diff
changeset
|
177 lemma x (case2 ()) |
204
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
178 lemma1 : (x : Ordinal) → x o< ordinal Zero (Φ Zero) → ψ x |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
179 lemma1 x (case1 ()) |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
180 lemma1 x (case2 ()) |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
181 TransFinite1 (Suc lx) (Φ (Suc lx)) = record { proj1 = caseΦ (Suc lx) (λ x → lemma (lv x) (ord x)) ; proj2 = (λ x → lemma (lv x) (ord x)) } where |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
182 lemma0 : (ly : Nat) (oy : OrdinalD ly ) → ordinal ly oy o< ordinal lx (Φ lx) → ψ (ordinal ly oy) |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
183 lemma0 ly oy lt = proj2 ( TransFinite1 lx (Φ lx) ) (ordinal ly oy) lt |
d4802eb159ff
Transfinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
203
diff
changeset
|
184 lemma : (ly : Nat) (oy : OrdinalD ly ) → ordinal ly oy o< ordinal (Suc lx) (Φ (Suc lx)) → ψ (ordinal ly oy) |
213
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
204
diff
changeset
|
185 lemma lx1 ox1 (case1 lt) with <-∨ lt |
22d435172d1a
separate logic and nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
204
diff
changeset
|
186 lemma lx (Φ lx) (case1 lt) | case1 refl = proj1 ( TransFinite1 lx (Φ lx) ) |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
187 lemma lx (Φ lx) (case1 lt) | case2 lt1 = lemma0 lx (Φ lx) (case1 lt1) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
188 lemma lx (OSuc lx ox1) (case1 lt) | case1 refl = caseOSuc lx ox1 lemma2 where |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
189 lemma2 : (y : Ordinal) → (Suc (lv y) ≤ lx) ∨ (ord y d< OSuc lx ox1) → ψ y |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
190 lemma2 y lt1 with osuc-≡< lt1 |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
191 lemma2 y lt1 | case1 refl = lemma lx ox1 (case1 a<sa) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
192 lemma2 y lt1 | case2 t = proj2 (TransFinite1 lx ox1) y t |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
193 lemma lx1 (OSuc lx1 ox1) (case1 lt) | case2 lt1 = caseOSuc lx1 ox1 lemma2 where |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
194 lemma2 : (y : Ordinal) → (Suc (lv y) ≤ lx1) ∨ (ord y d< OSuc lx1 ox1) → ψ y |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
195 lemma2 y lt2 with osuc-≡< lt2 |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
196 lemma2 y lt2 | case1 refl = lemma lx1 ox1 (ordtrans lt2 (case1 lt)) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
197 lemma2 y lt2 | case2 (case1 lt3) = proj2 (TransFinite1 lx (Φ lx)) y (case1 (<-trans lt3 lt1 )) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
198 lemma2 y lt2 | case2 (case2 lt3) with d<→lv lt3 |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
199 ... | refl = proj2 (TransFinite1 lx (Φ lx)) y (case1 lt1) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
200 TransFinite1 lx (OSuc lx ox) = record { proj1 = caseOSuc lx ox lemma ; proj2 = lemma } where |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
201 lemma : (y : Ordinal) → y o< ordinal lx (OSuc lx ox) → ψ y |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
202 lemma y lt with osuc-≡< lt |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
203 lemma y lt | case1 refl = proj1 ( TransFinite1 lx ox ) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
204 lemma y lt | case2 lt1 = proj2 ( TransFinite1 lx ox ) y lt1 |
97
f2b579106770
power set using sup on Def
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
94
diff
changeset
|
205 |
224 | 206 open import Ordinals |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
207 |
224 | 208 C-Ordinal : {n : Level} → Ordinals {suc n} |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
209 C-Ordinal {n} = record { |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
210 ord = Ordinal {suc n} |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
211 ; o∅ = o∅ |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
212 ; osuc = osuc |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
213 ; _o<_ = _o<_ |
324 | 214 ; next = ? |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
215 ; isOrdinal = record { |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
216 Otrans = ordtrans |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
217 ; OTri = trio< |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
218 ; ¬x<0 = ¬x<0 |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
219 ; <-osuc = <-osuc |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
220 ; osuc-≡< = osuc-≡< |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
221 ; TransFinite = TransFinite1 |
324 | 222 ; is-limit = ? |
223 ; next-limit = ? | |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
224 } |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
225 } where |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
226 ord1 : Set (suc n) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
227 ord1 = Ordinal {suc n} |
324 | 228 TransFinite1 : { ψ : ord1 → Set (suc n) } |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
229 → ( (x : ord1) → ( (y : ord1 ) → y o< x → ψ y ) → ψ x ) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
230 → ∀ (x : ord1) → ψ x |
324 | 231 TransFinite1 {ψ} lt x = TransFinite {n} {suc n} {ψ} caseΦ caseOSuc x where |
222
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
232 caseΦ : (lx : Nat) → ((x₁ : Ordinal) → x₁ o< ordinal lx (Φ lx) → ψ x₁) → |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
233 ψ (record { lv = lx ; ord = Φ lx }) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
234 caseΦ lx prev = lt (ordinal lx (Φ lx) ) prev |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
235 caseOSuc : (lx : Nat) (x₁ : OrdinalD lx) → ((y : Ordinal) → y o< ordinal lx (OSuc lx x₁) → ψ y) → |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
236 ψ (record { lv = lx ; ord = OSuc lx x₁ }) |
59771eb07df0
TransFinite induction fixed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
220
diff
changeset
|
237 caseOSuc lx ox prev = lt (ordinal lx (OSuc lx ox)) prev |
224 | 238 |