annotate constructible-set.agda @ 26:a53ba59c5bda

dom-ψ
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 18 May 2019 22:40:06 +0900
parents 0f3d98e97593
children bade0a35fdd9
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
2 module constructible-set 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
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
6 open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ )
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
10 data OrdinalD {n : Level} : (lv : Nat) → Set n where
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
11 Φ : (lv : Nat) → OrdinalD lv
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
12 OSuc : (lv : Nat) → OrdinalD {n} lv → OrdinalD lv
17
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
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
20 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
21 Φ< : {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
22 s< : {lx : Nat} → {x y : OrdinalD {n} lx} → x d< y → OSuc lx x d< OSuc lx y
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
23 ℵΦ< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → Φ (Suc lx) d< (ℵ lx)
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
24 ℵ< : {lx : Nat} → {x : OrdinalD {n} (Suc lx) } → OSuc (Suc lx) x d< (ℵ lx)
17
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
28 _o<_ : {n : Level} ( x y : Ordinal ) → Set (suc n)
17
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
38 o∅ : {n : Level} → Ordinal {n}
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
39 o∅ = record { lv = Zero ; ord = Φ Zero }
21
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
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
42 ≡→¬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
43 ≡→¬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
44
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
45 trio<> : {n : Level} → {lx : Nat} {x : OrdinalD {n} lx } { y : OrdinalD lx } → y d< x → x d< y → ⊥
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
46 trio<> {n} {lx} {.(OSuc lx _)} {.(OSuc lx _)} (s< s) (s< t) =
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
47 trio<> s t
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
48
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
49 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
50 trio<≡ refl = ≡→¬d<
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
51
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
52 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
53 trio>≡ refl = ≡→¬d<
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
54
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
55 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
56 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
57
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
58 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
59 triOrdd {_} {lv} (Φ lv) (Φ lv) = tri≈ ≡→¬d< refl ≡→¬d<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
60 triOrdd {_} {Suc lv} (ℵ lv) (ℵ lv) = tri≈ ≡→¬d< refl ≡→¬d<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
61 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
62 triOrdd {_} {.(Suc lv)} (Φ (Suc lv)) (ℵ lv) = tri< (ℵΦ< {_} {lv} {Φ (Suc lv)} ) (λ ()) ( λ lt → trio<> lt ((ℵΦ< {_} {lv} {Φ (Suc lv)} )) )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
63 triOrdd {_} {Suc lv} (ℵ lv) (Φ (Suc lv)) = tri> ( λ lt → trio<> lt (ℵΦ< {_} {lv} {Φ (Suc lv)} ) ) (λ ()) (ℵΦ< {_} {lv} {Φ (Suc lv)} )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
64 triOrdd {_} {Suc lv} (ℵ lv) (OSuc (Suc lv) y) = tri> ( λ lt → trio<> lt (ℵ< {_} {lv} {y} ) ) (λ ()) (ℵ< {_} {lv} {y} )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
65 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
66 triOrdd {_} {.(Suc lv)} (OSuc (Suc lv) x) (ℵ lv) = tri< ℵ< (λ ()) (λ lt → trio<> lt ℵ< )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
67 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
68 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
69 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
70 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
71
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
72 d<→lv : {n : Level} {x y : Ordinal {n}} → ord x d< ord y → lv x ≡ lv y
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
73 d<→lv Φ< = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
74 d<→lv (s< lt) = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
75 d<→lv ℵΦ< = refl
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
76 d<→lv ℵ< = refl
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
77
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
78 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
79 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
80 orddtrans {_} {Suc lx} {Φ (Suc lx)} {OSuc (Suc lx) y} {ℵ lx} Φ< ℵ< = ℵΦ< {_} {lx} {y}
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
81 orddtrans {_} {lx} {.(OSuc lx _)} {.(OSuc lx _)} {.(OSuc lx _)} (s< x<y) (s< y<z) = s< ( orddtrans x<y y<z )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
82 orddtrans {_} {Suc lx} {.(OSuc (Suc lx) _)} {.(OSuc (Suc lx) _)} {.(ℵ _)} (s< x<y) ℵ< = ℵ<
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
83 orddtrans {_} {Suc lx} {Φ (Suc lx)} {.(ℵ _)} {z} ℵΦ< ()
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
84 orddtrans {_} {Suc lx} {OSuc (Suc lx) _} {.(ℵ _)} {z} ℵ< ()
9
5ed16e2d8eb7 try to fix axiom of replacement
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
85
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
86 max : (x y : Nat) → Nat
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
87 max Zero Zero = Zero
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
88 max Zero (Suc x) = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
89 max (Suc x) Zero = (Suc x)
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
90 max (Suc x) (Suc y) = Suc ( max x y )
3
e7990ff544bf reocrd ZF
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
92 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
93 maxαd x y with triOrdd x y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
94 maxαd x y | tri< a ¬b ¬c = y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
95 maxαd x y | tri≈ ¬a b ¬c = x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
96 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
97
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
98 maxα : {n : Level} → Ordinal {n} → Ordinal → Ordinal
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
99 maxα x y with <-cmp (lv x) (lv y)
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
100 maxα x y | tri< a ¬b ¬c = x
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
101 maxα x y | tri> ¬a ¬b c = y
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
102 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
103
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
104 _o≤_ : {n : Level} → Ordinal → Ordinal → Set (suc n)
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
105 a o≤ b = (a ≡ b) ∨ ( a o< b )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
106
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
107 trio< : {n : Level } → Trichotomous {suc n} _≡_ _o<_
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
108 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
109 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
110 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
111 lemma1 (case1 x) = ¬c x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
112 lemma1 (case2 x) with d<→lv x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
113 lemma1 (case2 x) | refl = ¬b refl
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
114 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
115 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
116 lemma1 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
117 lemma1 (case2 x) with d<→lv x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
118 lemma1 (case2 x) | refl = ¬b refl
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
119 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
120 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
121 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
122 lemma1 refl = refl
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
123 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
124 lemma2 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
125 lemma2 (case2 x) = trio<> x a
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
126 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
127 lemma1 : (record { lv = _ ; ord = x }) ≡ b → x ≡ ord b
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
128 lemma1 refl = refl
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
129 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
130 lemma2 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
131 lemma2 (case2 x) = trio<> x c
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
132 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
133 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
134 lemma1 (case1 x) = ¬a x
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
135 lemma1 (case2 x) = ≡→¬d< x
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
136
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
137 OrdTrans : {n : Level} → Transitive {suc n} _o≤_
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
138 OrdTrans (case1 refl) (case1 refl) = case1 refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
139 OrdTrans (case1 refl) (case2 lt2) = case2 lt2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
140 OrdTrans (case2 lt1) (case1 refl) = case2 lt1
17
6a668c6086a5 clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
141 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
142 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
143 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
144 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
145 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
146 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
147 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
148
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
149 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
150 OrdPreorder {n} = record { Carrier = Ordinal
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
151 ; _≈_ = _≡_
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
152 ; _∼_ = _o≤_
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
153 ; isPreorder = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
154 isEquivalence = record { refl = refl ; sym = sym ; trans = trans }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
155 ; reflexive = case1
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
156 ; trans = OrdTrans
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
157 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
158 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
159
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
160 TransFinite : {n : Level} → ( ψ : Ordinal {n} → Set n )
22
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
161 → ( ∀ (lx : Nat ) → ψ ( record { lv = Suc lx ; ord = ℵ lx } ))
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
162 → ( ∀ (lx : Nat ) → ψ ( record { lv = lx ; ord = Φ lx } ) )
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
163 → ( ∀ (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
164 → ∀ (x : Ordinal) → ψ x
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
165 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = Φ lv } = caseΦ lv
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
166 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = lv ; ord = OSuc lv ord₁ } = caseOSuc lv ord₁
22
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
167 ( TransFinite ψ caseℵ caseΦ caseOSuc (record { lv = lv ; ord = ord₁ } ))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
168 TransFinite ψ caseℵ caseΦ caseOSuc record { lv = Suc lv₁ ; ord = ℵ lv₁ } = caseℵ lv₁
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
169
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
170 -- X' = { x ∈ X | ψ x } ∪ X , Mα = ( ∪ (β < α) Mβ ) '
7
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
171
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
172 record ConstructibleSet {n : Level} : Set (suc n) where
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
173 field
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
174 α : Ordinal {suc n}
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
175 constructible : Ordinal {suc n} → Set n
26
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
176 -- constructible : (x : Ordinal {suc n} ) → x o< α → Set n
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
177
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
178 open ConstructibleSet
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
179
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
180 _∋_ : {n : Level} → (ConstructibleSet {n}) → (ConstructibleSet {n} ) → Set (suc n)
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
181 a ∋ x = ( α x o< α a ) ∧ constructible a ( α x )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
182
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
183 c∅ : {n : Level} → ConstructibleSet
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
184 c∅ {n} = record {α = o∅ ; constructible = λ x → Lift n ⊥ }
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
185
25
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
186 record SupR {n m : Level} {S : Set n} ( _≤_ : S → S → Set m ) (ψ : S → S ) (X : S) : Set ((suc n) ⊔ m) where
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
187 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
188 sup : S
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
189 smax : ∀ { x : S } → x ≤ X → ψ x ≤ sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
190 suniq : {max : S} → ( ∀ { x : S } → x ≤ X → ψ x ≤ max ) → max ≤ sup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
191
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
192 open SupR
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
193
26
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
194 record dom-ψ {n m : Level} (X : ConstructibleSet {n}) (ψ : ConstructibleSet {n} → ConstructibleSet {n} ) : Set (suc (suc n) ⊔ suc m) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
195 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
196 αψ : Ordinal {suc n}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
197 inψ : (x : Ordinal {suc n} ) → Set m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
198 X∋x : (x : ConstructibleSet {n} ) → inψ (α x) → X ∋ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
199 vψ : (x : Ordinal {suc n} ) → inψ x → ConstructibleSet {n}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
200 cset≡ψ : (x : ConstructibleSet {n} ) → (t : inψ (α x) ) → x ≡ ψ ( vψ (α x) t )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
201
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
202 open dom-ψ
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
203
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
204 postulate
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
205 ψ→C : {n m : Level} (X : ConstructibleSet {n}) (ψ : ConstructibleSet {n} → ConstructibleSet {n} ) → dom-ψ {n} {m} X ψ
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
206
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
207 _⊆_ : {n : Level} → ( A B : ConstructibleSet ) → ∀{ x : ConstructibleSet } → Set (suc n)
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
208 _⊆_ A B {x} = A ∋ x → B ∋ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
209
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
210 suptraverse : {n : Level} → (X : ConstructibleSet {n}) ( max : ConstructibleSet {n}) ( ψ : ConstructibleSet {n} → ConstructibleSet {n}) → ConstructibleSet {n}
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
211 suptraverse X max ψ = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
212
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
213 Sup : {n : Level } → (ψ : ConstructibleSet → ConstructibleSet ) → (X : ConstructibleSet) → SupR (λ x a → (α a ≡ α x) ∨ (a ∋ x)) ψ X
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
214 sup (Sup {n} ψ X ) = suptraverse X (c∅ {n}) ψ
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
215 smax (Sup ψ X ) = {!!}
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
216 suniq (Sup ψ X ) = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
217
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
218 open import Data.Unit
23
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
219 open SupR
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
220
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
221 ConstructibleSet→ZF : {n : Level} → ZF {suc n} {suc n}
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
222 ConstructibleSet→ZF {n} = record {
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
223 ZFSet = ConstructibleSet
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
224 ; _∋_ = _∋_
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
225 ; _≈_ = _≡_
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
226 ; ∅ = c∅
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
227 ; _,_ = _,_
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
228 ; Union = Union
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
229 ; Power = {!!}
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
230 ; Select = Select
25
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
231 ; Replace = Replace
14
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
232 ; infinite = {!!}
e11e95d5ddee separete constructible set
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
233 ; isZF = {!!}
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
234 } where
26
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
235 Select : (X : ConstructibleSet {n}) → (ConstructibleSet {n} → Set (suc n)) → ConstructibleSet {n}
25
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
236 Select X ψ = record { α = α X ; constructible = λ x → select x } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
237 select : Ordinal → Set n
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
238 select x with ψ (record { α = x ; constructible = λ x → constructible X x })
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
239 ... | t = Lift n ⊤
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
240 Replace : (X : ConstructibleSet {n} ) → (ConstructibleSet → ConstructibleSet) → ConstructibleSet
26
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
241 Replace X ψ = record { α = αψ {n} {suc (suc n)} (ψ→C X ψ) ; constructible = λ x → inψ (ψ→C X ψ) x }
24
3186bbee99dd separte level
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
242 _,_ : ConstructibleSet {n} → ConstructibleSet → ConstructibleSet
25
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
243 a , b = record { α = maxα (α a) (α b) ; constructible = a∨b } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
244 a∨b : Ordinal {suc n} → Set n
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
245 a∨b x with (x ≡ α a ) ∨ ( x ≡ α b )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
246 ... | t = Lift n ⊤
18
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
247 Union : ConstructibleSet → ConstructibleSet
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
248 Union a = {!!}