changeset 109:dab56d357fa3

remove o<→c< and add otrans in OD
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 18 Jun 2019 23:40:17 +0900
parents c8b79d303867
children 1daa1d24348c
files ordinal-definable.agda
diffstat 1 files changed, 85 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/ordinal-definable.agda	Wed Jun 12 10:45:00 2019 +0900
+++ b/ordinal-definable.agda	Tue Jun 18 23:40:17 2019 +0900
@@ -17,6 +17,7 @@
 record OD {n : Level}  : Set (suc n) where
   field
     def : (x : Ordinal {n} ) → Set n
+    otrans : {x y : Ordinal {n} } → def x → y o< x → def y
 
 open OD
 open import Data.Unit
@@ -42,30 +43,42 @@
 eq-trans : {n : Level} {  x y z :  OD {n} } → x == y → y == z → x == z
 eq-trans x=y y=z = record { eq→ = λ t → eq→ y=z ( eq→ x=y  t) ; eq← = λ t → eq← x=y ( eq← y=z t) }
 
+-- Ordinal in OD ( and ZFSet )
+Ord : { n : Level } → ( a : Ordinal {n} ) → OD {n}
+Ord {n} a = record { def = λ y → y o< a ; otrans = lemma }  where
+   lemma : {x y : Ordinal} → x o< a → y o< x → y o< a
+   lemma {x} {y} x<a y<x = ordtrans {n} {y} {x} {a} y<x x<a
+
+-- od∅ : {n : Level} → OD {n} 
+-- od∅ {n} = record { def = λ _ → Lift n ⊥ }
 od∅ : {n : Level} → OD {n} 
-od∅ {n} = record { def = λ _ → Lift n ⊥ }
+od∅ {n} = Ord o∅ 
 
 postulate      
   -- OD can be iso to a subset of Ordinal ( by means of Godel Set )
   od→ord : {n : Level} → OD {n} → Ordinal {n}
   ord→od : {n : Level} → Ordinal {n} → OD {n} 
+  c<→o<  : {n : Level} {x y : OD {n} }      → def y ( od→ord x ) → od→ord x o< od→ord y
+  -- next assumption causes ∀ x ∋ ∅ . It menas only an ordinal becomes a set
+  -- o<→c<  : {n : Level} {x y : Ordinal {n} } → x o< y             → def (ord→od y) x 
   oiso   : {n : Level} {x : OD {n}}      → ord→od ( od→ord x ) ≡ x
   diso   : {n : Level} {x : Ordinal {n}} → od→ord ( ord→od x ) ≡ x
   -- supermum as Replacement Axiom
   sup-o  : {n : Level } → ( Ordinal {n} → Ordinal {n}) →  Ordinal {n}
   sup-o< : {n : Level } → { ψ : Ordinal {n} →  Ordinal {n}} → ∀ {x : Ordinal {n}} →  ψ x  o<  sup-o ψ 
-  -- a contra-position of minimality of supermum 
+  -- a property of supermum required in Power Set Axiom
   sup-x  : {n : Level } → ( Ordinal {n} → Ordinal {n}) →  Ordinal {n}
   sup-lb : {n : Level } → { ψ : Ordinal {n} →  Ordinal {n}} → {z : Ordinal {n}}  →  z o< sup-o ψ → z o< osuc (ψ (sup-x ψ))
+  -- sup-lb : {n : Level } → ( ψ : Ordinal {n} →  Ordinal {n}) → ( ∀ {x : Ordinal {n}} →  ψx  o<  z ) →  z o< osuc ( sup-o ψ ) 
 
 _∋_ : { n : Level } → ( a x : OD {n} ) → Set n
 _∋_ {n} a x  = def a ( od→ord x )
 
 _c<_ : { n : Level } → ( x a : OD {n} ) → Set n
-x c< a =  od→ord x o< od→ord a
+x c< a = a ∋ x 
 
 postulate      
-   o<→c<  : {n : Level} {x y : Ordinal {n} } → x o< y  → ord→od x c< ord→od y
+  o<→c<  : {n : Level} {x y : Ordinal {n} } → x o< y  → Ord y ∋ Ord x 
 
 _c≤_ : {n : Level} →  OD {n} →  OD {n} → Set (suc n)
 a c≤ b  = (a ≡ b)  ∨ ( b ∋ a )
@@ -73,17 +86,14 @@
 def-subst : {n : Level } {Z : OD {n}} {X : Ordinal {n} }{z : OD {n}} {x : Ordinal {n} }→ def Z X → Z ≡ z  →  X ≡ x  →  def z x
 def-subst df refl refl = df
 
--- sup-min : {n : Level } → ( ψ : Ordinal {n} →  Ordinal {n}) → {z : Ordinal {n}}  →  ψ z  o<  z  →   sup-o ψ  o< osuc z
-
 sup-od : {n : Level } → ( OD {n} → OD {n}) →  OD {n}
-sup-od ψ = ord→od ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )
+sup-od ψ = Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )
 
 sup-c< : {n : Level } → ( ψ : OD {n} →  OD {n}) → ∀ {x : OD {n}} → def ( sup-od ψ ) (od→ord ( ψ x ))
-sup-c< {n} ψ {x} = def-subst {n} {_} {_} {sup-od ψ} {od→ord ( ψ x )}
-        {!!} refl (cong ( λ k → od→ord (ψ k) ) oiso)
-
-∅1 : {n : Level} →  ( x : OD {n} )  → ¬ ( x c< od∅ {n} )
-∅1 {n} x = {!!}
+sup-c< {n} ψ {x} = def-subst {n} {_} {_} {Ord ( sup-o ( λ x → od→ord (ψ (ord→od x ))) )} {od→ord ( ψ x )}
+        lemma refl (cong ( λ k → od→ord (ψ k) ) oiso) where
+    lemma : od→ord (ψ (ord→od (od→ord x))) o< sup-o (λ x → od→ord (ψ (ord→od x)))
+    lemma = subst₂ (λ j k → j o< k ) refl diso (o<-subst sup-o< refl (sym diso)  )
 
 ∅3 : {n : Level} →  { x : Ordinal {n}}  → ( ∀(y : Ordinal {n}) → ¬ (y o< x ) ) → x ≡ o∅ {n}
 ∅3 {n} {x} = TransFinite {n} c2 c3 x where
@@ -103,13 +113,18 @@
    c3 lx (OSuc .lx x₁) d not | t | ()
 
 transitive : {n : Level } { z y x : OD {suc n} } → z ∋ y → y ∋ x → z  ∋ x
-transitive  {n} {z} {y} {x} z∋y x∋y  with  ordtrans {!!} {!!} 
+transitive  {n} {z} {y} {x} z∋y x∋y  with  ordtrans ( c<→o< {suc n} {x} {y} x∋y ) (  c<→o< {suc n} {y} {z} z∋y ) 
 ... | t = lemma0 (lemma t) where
    lemma : ( od→ord x ) o< ( od→ord z ) → def ( ord→od ( od→ord z )) ( od→ord x)
-   lemma xo<z = {!!}
+   lemma xo<z = {!!} -- o<→c< xo<z
    lemma0 :  def ( ord→od ( od→ord z )) ( od→ord x) →  def z (od→ord x)
    lemma0 dz  = def-subst {suc n} { ord→od ( od→ord z )} { od→ord x} dz (oiso)  refl
 
+record Minimumo {n : Level } (x : Ordinal {n}) : Set (suc n) where
+  field
+     mino : Ordinal {n}
+     min<x :  mino o< x
+
 ∅5 : {n : Level} →  { x : Ordinal {n} }  → ¬ ( x  ≡ o∅ {n} ) → o∅ {n} o< x
 ∅5 {n} {record { lv = Zero ; ord = (Φ .0) }} not = ⊥-elim (not refl) 
 ∅5 {n} {record { lv = Zero ; ord = (OSuc .0 ord) }} not = case2 Φ<
@@ -150,11 +165,11 @@
 o<→o> : {n : Level} →  { x y : OD {n} } →  (x == y) → (od→ord x ) o< ( od→ord y) → ⊥
 o<→o> {n} {x} {y} record { eq→ = xy ; eq← = yx } (case1 lt) with
      yx (def-subst {n} {ord→od (od→ord y)} {od→ord x} {!!} oiso refl )
-... | oyx with o<¬≡ (od→ord x) (od→ord x) refl {!!}
+... | oyx with o<¬≡ (od→ord x) (od→ord x) refl (c<→o< oyx )
 ... | ()
 o<→o> {n} {x} {y} record { eq→ = xy ; eq← = yx } (case2 lt) with
      yx (def-subst {n} {ord→od (od→ord y)} {od→ord x} {!!} oiso refl )
-... | oyx with o<¬≡ (od→ord x) (od→ord x) refl {!!}
+... | oyx with o<¬≡ (od→ord x) (od→ord x) refl (c<→o< oyx )
 ... | ()
 
 ==→o≡ : {n : Level} →  { x y : Ordinal {suc n} } → ord→od x == ord→od y →  x ≡ y 
@@ -163,12 +178,12 @@
 ==→o≡ {n} {x} {y} eq | tri≈ ¬a b ¬c = b
 ==→o≡ {n} {x} {y} eq | tri> ¬a ¬b c = ⊥-elim ( o<→o> (eq-sym eq) (o<-subst c (sym ord-iso) (sym ord-iso )))
 
-≡-def : {n : Level} →  { x : Ordinal {suc n} } → x ≡ od→ord (record { def = λ z → z o< x } )
+≡-def : {n : Level} →  { x : Ordinal {suc n} } → x ≡ od→ord (Ord x)
 ≡-def {n} {x} = ==→o≡ {n} (subst (λ k → ord→od x == k ) (sym oiso) lemma ) where
     lemma :  ord→od x == record { def = λ z → z o< x }
     eq→ lemma {w} z = subst₂ (λ k j → k o< j ) diso refl (subst (λ k → (od→ord ( ord→od w)) o< k ) diso t ) where 
         t : (od→ord ( ord→od w)) o< (od→ord (ord→od x))
-        t = {!!}
+        t = c<→o< {suc n} {ord→od w} {ord→od x} (def-subst {suc n} {_} {_} {ord→od x} {_} z refl (sym diso))
     eq← lemma {w} z = def-subst {suc n} {_} {_} {ord→od x} {w} {!!} refl refl
 
 od≡-def : {n : Level} →  { x : Ordinal {suc n} } → ord→od x ≡ record { def = λ z → z o< x } 
@@ -186,12 +201,12 @@
 ∋→o< : {n : Level} →  { a x : OD {suc n} } → a ∋ x → od→ord x o< od→ord a
 ∋→o< {n} {a} {x} lt = t where
          t : (od→ord x) o< (od→ord a)
-         t = {!!}
+         t = c<→o< {suc n} {x} {a} lt 
 
 o<∋→ : {n : Level} →  { a x : OD {suc n} } → od→ord x o< od→ord a → a ∋ x 
 o<∋→ {n} {a} {x} lt = subst₂ (λ k j → def k j ) oiso refl t  where
          t : def (ord→od (od→ord a)) (od→ord x)
-         t = {!!}
+         t = {!!} -- o<→c< {suc n} {od→ord x} {od→ord a} lt 
 
 o∅≡od∅ : {n : Level} → ord→od (o∅ {suc n}) ≡ od∅ {suc n}
 o∅≡od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (od∅ {suc n} ))
@@ -202,14 +217,24 @@
 o∅≡od∅ {n} | tri≈ ¬a b ¬c = trans (cong (λ k → ord→od k ) b ) oiso
 o∅≡od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c)
 
+ord-od∅ :  {n : Level} → o∅ {suc n} ≡ od→ord (Ord (o∅ {suc n}))
+ord-od∅ {n} with trio< {n} (o∅ {suc n}) (od→ord (Ord (o∅ {suc n})))
+ord-od∅ {n} | tri< a ¬b ¬c = ⊥-elim (lemma a) where
+    lemma :  o∅ {suc n } o< (od→ord (Ord (o∅ {suc n}))) → ⊥
+    lemma lt with  o<→c< lt
+    lemma lt | t = o<¬≡ _ _ refl t
+ord-od∅ {n} | tri≈ ¬a b ¬c = b
+ord-od∅ {n} | tri> ¬a ¬b c = ⊥-elim (¬x<0 c)
+
+
 o<→¬== : {n : Level} →  { x y : OD {n} } → (od→ord x ) o< ( od→ord y) →  ¬ (x == y )
 o<→¬== {n} {x} {y} lt eq = o<→o> eq lt
 
 o<→¬c> : {n : Level} →  { x y : OD {n} } → (od→ord x ) o< ( od→ord y) →  ¬ (y c< x )
-o<→¬c> {n} {x} {y} olt clt = o<> olt {!!} where
+o<→¬c> {n} {x} {y} olt clt = o<> olt (c<→o< clt ) where
 
 o≡→¬c< : {n : Level} →  { x y : OD {n} } →  (od→ord x ) ≡ ( od→ord y) →   ¬ x c< y
-o≡→¬c< {n} {x} {y} oeq lt  = o<¬≡ (od→ord x) (od→ord y) (orefl oeq ) lt  
+o≡→¬c< {n} {x} {y} oeq lt  = o<¬≡ (od→ord x) (od→ord y) (orefl oeq ) (c<→o< lt) 
 
 tri-c< : {n : Level} →  Trichotomous _==_ (_c<_ {suc n})
 tri-c< {n} x y with trio< {n} (od→ord x) (od→ord y) 
@@ -220,24 +245,29 @@
 c<> : {n : Level } { x y : OD {suc n}} → x c<  y  → y c< x  →  ⊥
 c<> {n} {x} {y} x<y y<x with tri-c< x y
 c<> {n} {x} {y} x<y y<x | tri< a ¬b ¬c = ¬c y<x
-c<> {n} {x} {y} x<y y<x | tri≈ ¬a b ¬c = o<→o> b x<y 
+c<> {n} {x} {y} x<y y<x | tri≈ ¬a b ¬c = o<→o> b ( c<→o< x<y )
 c<> {n} {x} {y} x<y y<x | tri> ¬a ¬b c = ¬a x<y
 
+∅0 : {n : Level} →  record { def = λ x →  Lift n ⊥ ; otrans = λ () } == od∅ {n} 
+eq→ ∅0 {w} (lift ())
+eq← ∅0 {w} (case1 ())
+eq← ∅0 {w} (case2 ())
+
 ∅< : {n : Level} →  { x y : OD {n} } → def x (od→ord y ) → ¬ (  x  == od∅ {n} )
-∅< {n} {x} {y} d eq with eq→ eq d
+∅< {n} {x} {y} d eq with eq→ (eq-trans eq (eq-sym ∅0) ) d
 ∅< {n} {x} {y} d eq | lift ()
        
 ∅6 : {n : Level} →  { x : OD {suc n} }  → ¬ ( x ∋ x )    --  no Russel paradox
-∅6 {n} {x} x∋x = c<> {n} {x} {x} {!!} {!!}
+∅6 {n} {x} x∋x = c<> {n} {x} {x} x∋x x∋x
 
 def-iso : {n : Level} {A B : OD {n}} {x y : Ordinal {n}} → x ≡ y  → (def A y → def B y)  → def A x → def B x
 def-iso refl t = t
 
 is-∋ : {n : Level} →  ( x y : OD {suc n} ) → Dec ( x ∋ y )
 is-∋ {n} x y with tri-c< x y
-is-∋ {n} x y | tri< a ¬b ¬c = no {!!}
-is-∋ {n} x y | tri≈ ¬a b ¬c = no {!!}
-is-∋ {n} x y | tri> ¬a ¬b c = yes {!!}
+is-∋ {n} x y | tri< a ¬b ¬c = no ¬c
+is-∋ {n} x y | tri≈ ¬a b ¬c = no ¬c
+is-∋ {n} x y | tri> ¬a ¬b c = yes c
 
 is-o∅ : {n : Level} →  ( x : Ordinal {suc n} ) → Dec ( x ≡ o∅ {suc n} )
 is-o∅ {n} record { lv = Zero ; ord = (Φ .0) } = yes refl
@@ -246,16 +276,6 @@
 
 open _∧_
 
-¬∅=→∅∈ :  {n : Level} →  { x : OD {suc n} } → ¬ (  x  == od∅ {suc n} ) → x ∋ od∅ {suc n} 
-¬∅=→∅∈  {n} {x} ne = def-subst (lemma (od→ord x) (subst (λ k → ¬ (k == od∅ {suc n} )) (sym oiso) ne )) oiso refl where
-     lemma : (ox : Ordinal {suc n}) →  ¬ (ord→od  ox  == od∅ {suc n} ) → ord→od ox ∋ od∅ {suc n}
-     lemma ox ne with is-o∅ ox
-     lemma ox ne | yes refl with ne ( ord→== lemma1 ) where
-         lemma1 : od→ord (ord→od o∅) ≡ od→ord od∅
-         lemma1 = cong ( λ k → od→ord k ) o∅≡od∅
-     lemma o∅ ne | yes refl | ()
-     lemma ox ne | no ¬p = subst ( λ k → def (ord→od ox) (od→ord k) ) o∅≡od∅ {!!}
-
 -- open import Relation.Binary.HeterogeneousEquality as HE using (_≅_ ) 
 -- postulate f-extensionality : { n : Level}  → Relation.Binary.PropositionalEquality.Extensionality (suc n) (suc (suc n))
 
@@ -265,7 +285,7 @@
 -- Power Set of X ( or constructible by λ y → def X (od→ord y )
 
 ZFSubset : {n : Level} → (A x : OD {suc n} ) → OD {suc n}
-ZFSubset A x =  record { def = λ y → def A y ∧  def x y }  
+ZFSubset A x =  record { def = λ y → def A y ∧  def x y ; otrans = {!!} }  
 
 Def :  {n : Level} → (A :  OD {suc n}) → OD {suc n}
 Def {n} A = ord→od ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) )  
@@ -275,7 +295,7 @@
 L {n}  record { lv = Zero ; ord = (Φ .0) } = od∅
 L {n}  record { lv = lx ; ord = (OSuc lv ox) } = Def ( L {n} ( record { lv = lx ; ord = ox } ) ) 
 L {n}  record { lv = (Suc lx) ; ord = (Φ (Suc lx)) } = -- Union ( L α )
-    record { def = λ y → osuc y o< (od→ord (L {n}  (record { lv = lx ; ord = Φ lx }) )) }
+    record { def = λ y → osuc y o< (od→ord (L {n}  (record { lv = lx ; ord = Φ lx }) )) ; otrans = {!!} }
 
 OD→ZF : {n : Level} → ZF {suc (suc n)} {suc n}
 OD→ZF {n}  = record { 
@@ -294,11 +314,11 @@
     Replace : OD {suc n} → (OD {suc n} → OD {suc n} ) → OD {suc n}
     Replace X ψ = sup-od ψ
     Select : OD {suc n} → (OD {suc n} → Set (suc n) ) → OD {suc n}
-    Select X ψ = record { def = λ x →  ( def X  x ∧  ψ ( ord→od x )) } 
+    Select X ψ = record { def = λ x →  ( def X  x ∧  ψ ( Ord x )) ; otrans = {!!} } 
     _,_ : OD {suc n} → OD {suc n} → OD {suc n}
-    x , y = record { def = λ z → z o< (omax (od→ord x) (od→ord y)) }
+    x , y = Ord (omax (od→ord x) (od→ord y))
     Union : OD {suc n} → OD {suc n}
-    Union U = record { def = λ y → osuc y o< (od→ord U) }
+    Union U = record { def = λ y → osuc y o< (od→ord U) ; otrans = {!!} }
     -- power : ∀ X ∃ A ∀ t ( t ∈ A ↔ ( ∀ {x} → t ∋ x →  X ∋ x )
     Power : OD {suc n} → OD {suc n}
     Power A = Def A
@@ -313,6 +333,7 @@
     -- A ∪ B = Select (A , B) (  λ x → (A ∋ x)  ∨ ( B ∋ x ) )
     {_} : ZFSet → ZFSet
     { x } = ( x ,  x )
+
     infixr  200 _∈_
     -- infixr  230 _∩_ _∪_
     infixr  220 _⊆_
@@ -335,16 +356,18 @@
        ;   replacement = replacement
      } where
          open _∧_ 
+         open Minimumo
          pair : (A B : OD {suc n} ) → ((A , B) ∋ A) ∧  ((A , B) ∋ B)
          proj1 (pair A B ) = omax-x {n} (od→ord A) (od→ord B)
          proj2 (pair A B ) = omax-y {n} (od→ord A) (od→ord B)
          empty : (x : OD {suc n} ) → ¬  (od∅ ∋ x)
-         empty x ()
+         empty x (case1 ())
+         empty x (case2 ())
          ---
          --- ZFSubset A x =  record { def = λ y → def A y ∧  def x y }                   subset of A
          --- Power X = ord→od ( sup-o ( λ x → od→ord ( ZFSubset A (ord→od x )) ) )       Power X is a sup of all subset of A
          --
-         --  if Power A ∋ t, from a minimulity of sup, there is osuc ZFSubset A ∋ t 
+         --  if Power A ∋ t, from a propertiy of minimum sup there is osuc ZFSubset A ∋ t 
          --    then ZFSubset A ≡ t or ZFSubset A ∋ t. In the former case ZFSubset A ∋ x implies A ∋ x
          --    In case of later, ZFSubset A ∋ t and t ∋ x implies ZFSubset A ∋ x by transitivity
          --
@@ -353,9 +376,11 @@
               minsup :  OD
               minsup =  ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x))))) 
               lemma-t : csuc minsup ∋ t
-              lemma-t = {!!}
+              lemma-t = {!!} -- o<→c< (o<-subst (sup-lb (o<-subst (c<→o< P∋t) refl diso )) refl refl ) 
               lemma-s : ZFSubset A ( ord→od ( sup-x (λ x → od→ord ( ZFSubset A (ord→od x)))))  ∋ x
-              lemma-s = {!!}
+              lemma-s with osuc-≡< ( o<-subst (c<→o< lemma-t ) refl diso  )
+              lemma-s | case1 eq = def-subst ( ==-def-r (o≡→== eq) (subst (λ k → def k (od→ord x)) (sym oiso) t∋x ) ) oiso refl
+              lemma-s | case2 lt = transitive {n} {minsup} {t} {x} (def-subst {!!} oiso refl ) t∋x
          -- 
          -- we have t ∋ x → A ∋ x means t is a subset of A, that is ZFSubset A t == t
          -- Power A is a sup of ZFSubset A t, so Power A ∋ t
@@ -377,49 +402,49 @@
              lemma {oz} {ooz} lt = def-subst {suc n} {ord→od  ooz} {!!} refl refl
          union→ :  (X z u : OD) → (X ∋ u) ∧ (u ∋ z) → Union X ∋ z
          union→ X y u xx with trio< ( od→ord u ) ( osuc ( od→ord y ))
-         union→ X y u xx | tri< a ¬b ¬c with  osuc-< a {!!}
+         union→ X y u xx | tri< a ¬b ¬c with  osuc-< a (c<→o< (proj2 xx))
          union→ X y u xx | tri< a ¬b ¬c | ()
-         union→ X y u xx | tri≈ ¬a b ¬c = lemma b {!!} where
+         union→ X y u xx | tri≈ ¬a b ¬c = lemma b (c<→o< (proj1 xx )) where
              lemma : {oX ou ooy : Ordinal {suc n}} →  ou ≡ ooy  → ou o< oX   → ooy  o< oX
              lemma refl lt = lt
-         union→ X y u xx | tri> ¬a ¬b c = ordtrans {suc n} {osuc ( od→ord y )} {od→ord u} {od→ord X} c {!!} 
+         union→ X y u xx | tri> ¬a ¬b c = ordtrans {suc n} {osuc ( od→ord y )} {od→ord u} {od→ord X} c ( c<→o< (proj1 xx )) 
          union← :  (X z : OD) (X∋z : Union X ∋ z) → (X ∋ csuc z) ∧ (csuc z ∋ z )
          union← X z X∋z = record { proj1 = def-subst {suc n} {_} {_} {X} {od→ord (csuc z )} {!!} oiso (sym diso) ; proj2 = union-lemma-u X∋z } 
          ψiso :  {ψ : OD {suc n} → Set (suc n)} {x y : OD {suc n}} → ψ x → x ≡ y   → ψ y
          ψiso {ψ} t refl = t
          selection : {ψ : OD → Set (suc n)} {X y : OD} → ((X ∋ y) ∧ ψ y) ⇔ (Select X ψ ∋ y)
          selection {ψ} {X} {y} = record {
-              proj1 = λ cond → record { proj1 = proj1 cond ; proj2 = ψiso {ψ} (proj2 cond) (sym oiso)  }
-            ; proj2 = λ select → record { proj1 = proj1 select  ; proj2 =  ψiso {ψ} (proj2 select) oiso  }
+              proj1 = λ cond → record { proj1 = proj1 cond ; proj2 = {!!} } -- ψiso {ψ} (proj2 cond) (sym oiso)  }
+            ; proj2 = λ select → record { proj1 = proj1 select  ; proj2 =  ψiso {ψ} (proj2 select) {!!}  }
            }
          replacement : {ψ : OD → OD} (X x : OD) → Replace X ψ ∋ ψ x
          replacement {ψ} X x = sup-c< ψ {x}
          ∅-iso :  {x : OD} → ¬ (x == od∅) → ¬ ((ord→od (od→ord x)) == od∅) 
          ∅-iso {x} neq = subst (λ k → ¬ k) (=-iso {n} ) neq  
          minimul : (x : OD {suc n} ) → ¬ (x == od∅ )→ OD {suc n} 
-         minimul x  not = od∅   
+         minimul x  not = {!!}
          regularity :  (x : OD) (not : ¬ (x == od∅)) →
             (x ∋ minimul x not) ∧ (Select (minimul x not) (λ x₁ → (minimul x not ∋ x₁) ∧ (x ∋ x₁)) == od∅)
-         proj1 (regularity x not ) = ¬∅=→∅∈ not 
-         proj2 (regularity x not ) = record { eq→ = reg ; eq← = λ () } where
+         proj1 (regularity x not ) = {!!}
+         proj2 (regularity x not ) = record { eq→ = reg ; eq← = {!!} } where
             reg : {y : Ordinal} → def (Select (minimul x not) (λ x₂ → (minimul x not ∋ x₂) ∧ (x ∋ x₂))) y → def od∅ y
             reg {y} t with proj1 t
-            ... | x∈∅ = x∈∅
+            ... | x∈∅ = {!!}
          extensionality : {A B : OD {suc n}} → ((z : OD) → (A ∋ z) ⇔ (B ∋ z)) → A == B
          eq→ (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {A} {B} (sym diso) (proj1 (eq (ord→od x))) d  
          eq← (extensionality {A} {B} eq ) {x} d = def-iso {suc n} {B} {A} (sym diso) (proj2 (eq (ord→od x))) d  
          xx-union : {x  : OD {suc n}} → (x , x) ≡ record { def = λ z → z o< osuc (od→ord x) }
-         xx-union {x} = cong ( λ k → record { def = λ z → z o< k } ) (omxx (od→ord x))
+         xx-union {x} = cong ( λ k → Ord k ) (omxx (od→ord x))
          xxx-union : {x  : OD {suc n}} → (x , (x , x)) ≡ record { def = λ z → z o< osuc (osuc (od→ord x))}
-         xxx-union {x} = cong ( λ k → record { def = λ z → z o< k } ) lemma where
+         xxx-union {x} = cong ( λ k → Ord k ) lemma where
              lemma1 : {x  : OD {suc n}} → od→ord x o< od→ord (x , x)
-             lemma1 {x} = {!!}
+             lemma1 {x} = c<→o< ( proj1 (pair x x ) )
              lemma2 : {x  : OD {suc n}} → od→ord (x , x) ≡ osuc (od→ord x)
              lemma2 = trans ( cong ( λ k →  od→ord k ) xx-union ) (sym ≡-def)
              lemma : {x  : OD {suc n}} → omax (od→ord x) (od→ord (x , x)) ≡ osuc (osuc (od→ord x))
              lemma {x} = trans ( sym ( omax< (od→ord x) (od→ord (x , x)) lemma1 ) ) ( cong ( λ k → osuc k ) lemma2 )
          uxxx-union : {x  : OD {suc n}} → Union (x , (x , x)) ≡ record { def = λ z → osuc z o< osuc (osuc (od→ord x)) }
-         uxxx-union {x} = cong ( λ k → record { def = λ z → osuc z o< k } ) lemma where
+         uxxx-union {x} = cong ( λ k → record { def = λ z → osuc z o< k ; otrans = {!!} } ) lemma where
              lemma : od→ord (x , (x , x)) ≡ osuc (osuc (od→ord x))
              lemma = trans ( cong ( λ k → od→ord k ) xxx-union ) (sym ≡-def )
          uxxx-2 : {x  : OD {suc n}} → record { def = λ z → osuc z o< osuc (osuc (od→ord x)) } == record { def = λ z → z o< osuc (od→ord x) }
@@ -461,4 +486,3 @@
          -- axiom-of-choice : { X : OD } → ( ¬x∅ : ¬ ( X == od∅ ) ) → { A : OD } → (A∈X : A ∈ X ) →  choice ¬x∅ A∈X ∈ A 
          -- axiom-of-choice {X} nx {A} lt = ¬∅=→∅∈ {!!}
 
-