annotate constructible-set.agda @ 21:6d9fdd1dfa79

add transfinite
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 16 May 2019 16:47:27 +0900
parents 31626f36cd94
children 3da2c00bd24d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
1 open import Level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
2 module constructible-set (n : Level) where
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
4 open import zf
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
8 open import Relation.Binary.PropositionalEquality
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
10 data OrdinalD : (lv : Nat) → Set n where
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
11 Φ : {lv : Nat} → OrdinalD lv
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
12 OSuc : {lv : Nat} → OrdinalD lv → OrdinalD lv
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
13 ℵ_ : (lv : Nat) → OrdinalD (Suc lv)
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
15 record Ordinal : Set n where
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
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
18 ord : OrdinalD lv
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
19
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
20 data _d<_ : {lx ly : Nat} → OrdinalD lx → OrdinalD ly → Set n where
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
21 Φ< : {lx : Nat} → {x : OrdinalD lx} → Φ {lx} d< OSuc {lx} x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
22 s< : {lx : Nat} → {x y : OrdinalD lx} → x d< y → OSuc {lx} x d< OSuc {lx} y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
23 ℵΦ< : {lx : Nat} → {x : OrdinalD (Suc lx) } → Φ {Suc lx} d< (ℵ lx)
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
24 ℵ< : {lx : Nat} → {x : OrdinalD (Suc lx) } → OSuc {Suc lx} x d< (ℵ lx)
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
25
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
26 open Ordinal
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
27
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
28 _o<_ : ( x y : Ordinal ) → Set n
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
29 _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
30
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
31 open import Data.Nat.Properties
6
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
32 open import Data.Empty
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
33 open import Relation.Nullary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
34
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
35 open import Relation.Binary
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
36 open import Relation.Binary.Core
d9b704508281 isEquiv and isZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
37
21
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
38 o∅ : Ordinal
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
39 o∅ = record { lv = Zero ; ord = Φ }
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
40
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
41 TransFinite : ( ψ : Ordinal → Set n )
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
42 → ( ∀ (lx : Nat ) → ψ ( record { lv = Suc lx ; ord = ℵ lx } ))
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
43 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ } ) )
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
44 → ( ∀ (lx : Nat ) → (x : OrdinalD lx ) → ψ ( record { lv = lx ; ord = x } ) → ψ ( record { lv = lx ; ord = OSuc x } ) )
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
45 → ∀ (x : Ordinal) → ψ x
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
46 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ } = caseΦ lv
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
47 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc ord₁ } = caseOSuc lv ord₁
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
48 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } ))
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
49 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
50
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
51 record SupR (ψ : Ordinal → Ordinal ) : Set n where
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
52 field
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
53 sup : Ordinal
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
54 smax : { x : Ordinal } → ψ x o< sup
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
55
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
56 open SupR
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
57
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
58 Sup : (ψ : Ordinal → Ordinal ) → SupR ψ
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
59 sup (Sup ψ) = {!!}
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
60 smax (Sup ψ) = {!!}
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
61
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
62
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
63 ≡→¬d< : {lv : Nat} → {x : OrdinalD lv } → x d< x → ⊥
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
64 ≡→¬d< {lx} {OSuc y} (s< t) = ≡→¬d< t
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
65
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
66 trio<> : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
67 trio<> {lx} {.(OSuc _)} {.(OSuc _)} (s< s) (s< t) =
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
68 trio<> s t
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
69
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
70 trio<≡ : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → x ≡ y → x d< y → ⊥
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
71 trio<≡ refl = ≡→¬d<
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
72
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
73 trio>≡ : {lx : Nat} {x : OrdinalD lx } { y : OrdinalD lx } → x ≡ y → y d< x → ⊥
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
74 trio>≡ refl = ≡→¬d<
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
75
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
76 triO : {lx ly : Nat} → OrdinalD lx → OrdinalD ly → Tri (lx < ly) ( lx ≡ ly ) ( lx > ly )
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
77 triO {lx} {ly} x y = <-cmp lx ly
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
78
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
79 triOrdd : {lx : Nat} → Trichotomous _≡_ ( _d<_ {lx} {lx} )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
80 triOrdd {lv} Φ Φ = tri≈ ≡→¬d< refl ≡→¬d<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
81 triOrdd {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
82 triOrdd {lv} Φ (OSuc y) = tri< Φ< (λ ()) ( λ lt → trio<> lt Φ< )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
83 triOrdd {.(Suc lv)} Φ (ℵ lv) = tri< (ℵΦ< {lv} {Φ} ) (λ ()) ( λ lt → trio<> lt ((ℵΦ< {lv} {Φ} )) )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
84 triOrdd {Suc lv} (ℵ lv) Φ = tri> ( λ lt → trio<> lt (ℵΦ< {lv} {Φ} ) ) (λ ()) (ℵΦ< {lv} {Φ} )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
85 triOrdd {Suc lv} (ℵ lv) (OSuc y) = tri> ( λ lt → trio<> lt (ℵ< {lv} {y} ) ) (λ ()) (ℵ< {lv} {y} )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
86 triOrdd {lv} (OSuc x) Φ = tri> (λ lt → trio<> lt Φ<) (λ ()) Φ<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
87 triOrdd {.(Suc lv)} (OSuc x) (ℵ lv) = tri< ℵ< (λ ()) (λ lt → trio<> lt ℵ< )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
88 triOrdd {lv} (OSuc x) (OSuc y) with triOrdd x y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
89 triOrdd {lv} (OSuc x) (OSuc y) | tri< a ¬b ¬c = tri< (s< a) (λ tx=ty → trio<≡ tx=ty (s< a) ) ( λ lt → trio<> lt (s< a) )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
90 triOrdd {lv} (OSuc x) (OSuc x) | tri≈ ¬a refl ¬c = tri≈ ≡→¬d< refl ≡→¬d<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
91 triOrdd {lv} (OSuc x) (OSuc 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
92
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
93 d<→lv : {x y : Ordinal } → ord x d< ord y → lv x ≡ lv y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
94 d<→lv Φ< = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
95 d<→lv (s< lt) = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
96 d<→lv ℵΦ< = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
97 d<→lv ℵ< = refl
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
98
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
99 orddtrans : {lx : Nat} {x y z : OrdinalD lx } → x d< y → y d< z → x d< z
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
100 orddtrans {lx} {.Φ} {.(OSuc _)} {.(OSuc _)} Φ< (s< y<z) = Φ<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
101 orddtrans {Suc lx} {Φ {Suc lx}} {OSuc y} {ℵ lx} Φ< ℵ< = ℵΦ< {lx} {y}
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
102 orddtrans {lx} {.(OSuc _)} {.(OSuc _)} {.(OSuc _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
103 orddtrans {.(Suc _)} {.(OSuc _)} {.(OSuc _)} {.(ℵ _)} (s< x<y) ℵ< = ℵ<
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
104 orddtrans {.(Suc _)} {.Φ} {.(ℵ _)} {z} ℵΦ< ()
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
105 orddtrans {.(Suc _)} {.(OSuc _)} {.(ℵ _)} {z} ℵ< ()
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
106
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
107 max : (x y : Nat) → Nat
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
108 max Zero Zero = Zero
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
109 max Zero (Suc x) = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
110 max (Suc x) Zero = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
111 max (Suc x) (Suc y) = Suc ( max x y )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
113 maxαd : { lx : Nat } → OrdinalD lx → OrdinalD lx → OrdinalD lx
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
114 maxαd x y with triOrdd x y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
115 maxαd x y | tri< a ¬b ¬c = y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
116 maxαd x y | tri≈ ¬a b ¬c = x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
117 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
118
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
119 maxα : Ordinal → Ordinal → Ordinal
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
120 maxα x y with <-cmp (lv x) (lv y)
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
121 maxα x y | tri< a ¬b ¬c = x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
122 maxα x y | tri> ¬a ¬b c = y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
123 maxα x y | tri≈ ¬a refl ¬c = record { lv = lv x ; ord = maxαd (ord x) (ord y) }
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
124
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
125 OrdTrans : Transitive (λ ( a b : Ordinal ) → (a ≡ b) ∨ (Ordinal.lv a < Ordinal.lv b) ∨ (Ordinal.ord a d< Ordinal.ord b) )
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
126 OrdTrans (case1 refl) (case1 refl) = case1 refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
127 OrdTrans (case1 refl) (case2 lt2) = case2 lt2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
128 OrdTrans (case2 lt1) (case1 refl) = case2 lt1
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
129 OrdTrans (case2 (case1 x)) (case2 (case1 y)) = case2 (case1 ( <-trans x y ) )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
130 OrdTrans (case2 (case1 x)) (case2 (case2 y)) with d<→lv y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
131 OrdTrans (case2 (case1 x)) (case2 (case2 y)) | refl = case2 (case1 x )
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
132 OrdTrans (case2 (case2 x)) (case2 (case1 y)) with d<→lv x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
133 OrdTrans (case2 (case2 x)) (case2 (case1 y)) | refl = case2 (case1 y)
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
134 OrdTrans (case2 (case2 x)) (case2 (case2 y)) with d<→lv x | d<→lv y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
135 OrdTrans (case2 (case2 x)) (case2 (case2 y)) | refl | refl = case2 (case2 (orddtrans x y ))
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
136
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
137 OrdPreorder : Preorder n n n
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
138 OrdPreorder = record { Carrier = Ordinal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
139 ; _≈_ = _≡_
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
140 ; _∼_ = λ a b → (a ≡ b) ∨ ( a o< b )
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
141 ; isPreorder = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
142 isEquivalence = record { refl = refl ; sym = sym ; trans = trans }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
143 ; reflexive = case1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
144 ; trans = OrdTrans
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
145 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
146 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
147
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
148 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) '
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
149
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
150 record ConstructibleSet : Set (suc (suc n)) where
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
151 field
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
152 α : Ordinal
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
153 constructible : Ordinal → Set (suc n)
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
154
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
155 open ConstructibleSet
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
156
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
157 _∋_ : (ConstructibleSet ) → (ConstructibleSet ) → Set (suc n)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
158 a ∋ x = ((α a ≡ α x) ∨ ( α x o< α a ))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
159 ∧ constructible a ( α x )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
160
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
161
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
162 -- transitiveness : (a b c : ConstructibleSet ) → a ∋ b → b ∋ c → a ∋ c
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
163 -- transitiveness a b c a∋b b∋c with constructible a c∋ constructible b | constructible b c∋ constructible c
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
164 -- ... | t1 | t2 = {!!}
15
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
165
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
166 open import Data.Unit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
167
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
168 ConstructibleSet→ZF : ZF {suc (suc n)} {suc (suc n)}
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
169 ConstructibleSet→ZF = record {
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
170 ZFSet = ConstructibleSet
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
171 ; _∋_ = λ a b → Lift (suc (suc n)) ( a ∋ b )
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
172 ; _≈_ = _≡_
21
6d9fdd1dfa79 add transfinite
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
173 ; ∅ = record {α = o∅ ; constructible = λ x → Lift (suc n) ⊥ }
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
174 ; _,_ = _,_
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
175 ; Union = Union
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
176 ; Power = {!!}
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
177 ; Select = Select
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
178 ; Replace = Replace
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
179 ; infinite = {!!}
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
180 ; isZF = {!!}
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
181 } where
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
182 conv : (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet → Set (suc n)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
183 conv ψ x with ψ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
184 ... | t = Lift ( suc n ) ⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
185 Select : (X : ConstructibleSet) → (ConstructibleSet → Set (suc (suc n))) → ConstructibleSet
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
186 Select X ψ = record { α = α X ; constructible = λ x → (conv ψ) (record { α = x ; constructible = λ x → constructible X x } ) }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
187 Replace : (X : ConstructibleSet) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
188 Replace X ψ = record { α = α X ; constructible = λ x → {!!} }
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
189 _,_ : ConstructibleSet → ConstructibleSet → ConstructibleSet
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
190 a , b = record { α = maxα (α a) (α b) ; constructible = λ x → {!!} }
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
191 Union : ConstructibleSet → ConstructibleSet
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
192 Union a = {!!}