changeset 331:12071f79f3cf

HOD done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 05 Jul 2020 16:56:21 +0900
parents 0faa7120e4b5
children fcc65e37e72b
files BAlgbra.agda LEMC.agda ODC.agda cardinal.agda filter.agda
diffstat 5 files changed, 102 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/BAlgbra.agda	Sun Jul 05 15:49:00 2020 +0900
+++ b/BAlgbra.agda	Sun Jul 05 16:56:21 2020 +0900
@@ -19,60 +19,66 @@
 open OD O
 open OD.OD
 open ODAxiom odAxiom
+open HOD
 
 open _∧_
 open _∨_
 open Bool
 
 _∩_ : ( A B : HOD  ) → HOD
-A ∩ B = record { def = λ x → def A x ∧ def B x } 
+A ∩ B = record { od = record { def = λ x → odef A x ∧ odef B x } ;
+    odmax = omin (odmax A) (odmax B) ; <odmax = λ y → min1 (<odmax A (proj1 y)) (<odmax B (proj2 y)) }
 
 _∪_ : ( A B : HOD  ) → HOD
-A ∪ B = record { def = λ x → def A x ∨ def B x } 
+A ∪ B = record { od = record { def = λ x → odef A x ∨ odef B x } ;
+    odmax = omax (odmax A) (odmax B) ; <odmax = lemma } where
+      lemma :  {y : Ordinal} → odef A y ∨ odef B y → y o< omax (odmax A) (odmax B)
+      lemma {y} (case1 a) = ordtrans (<odmax A a) (omax-x _ _)
+      lemma {y} (case2 b) = ordtrans (<odmax B b) (omax-y _ _)
 
 _\_ : ( A B : HOD  ) → HOD
-A \ B = record { def = λ x → def A x ∧ ( ¬ ( def B x ) ) }
+A \ B = record { od = record { def = λ x → odef A x ∧ ( ¬ ( odef B x ) ) }; odmax = odmax A ; <odmax = λ y → <odmax A (proj1 y) }
 
 ∪-Union : { A B : HOD } → Union (A , B) ≡ ( A ∪ B )
 ∪-Union {A} {B} = ==→o≡ ( record { eq→ =  lemma1 ; eq← = lemma2 } )  where
-    lemma1 :  {x : Ordinal} → def (Union (A , B)) x → def (A ∪ B) x
+    lemma1 :  {x : Ordinal} → odef (Union (A , B)) x → odef (A ∪ B) x
     lemma1 {x} lt = lemma3 lt where
-        lemma4 : {y : Ordinal} → def (A , B) y ∧ def (ord→od y) x → ¬ (¬ ( def A x ∨ def B x) )
+        lemma4 : {y : Ordinal} → odef (A , B) y ∧ odef (ord→od y) x → ¬ (¬ ( odef A x ∨ odef B x) )
         lemma4 {y} z with proj1 z
-        lemma4 {y} z | case1 refl = double-neg (case1 ( subst (λ k → def k x ) oiso (proj2 z)) )
-        lemma4 {y} z | case2 refl = double-neg (case2 ( subst (λ k → def k x ) oiso (proj2 z)) )
-        lemma3 : (((u : Ordinals.ord O) → ¬ def (A , B) u ∧ def (ord→od u) x) → ⊥) → def (A ∪ B) x
+        lemma4 {y} z | case1 refl = double-neg (case1 ( subst (λ k → odef k x ) oiso (proj2 z)) )
+        lemma4 {y} z | case2 refl = double-neg (case2 ( subst (λ k → odef k x ) oiso (proj2 z)) )
+        lemma3 : (((u : Ordinals.ord O) → ¬ odef (A , B) u ∧ odef (ord→od u) x) → ⊥) → odef (A ∪ B) x
         lemma3 not = ODC.double-neg-eilm O (FExists _ lemma4 not)   -- choice
-    lemma2 :  {x : Ordinal} → def (A ∪ B) x → def (Union (A , B)) x
-    lemma2 {x} (case1 A∋x) = subst (λ k → def (Union (A , B)) k) diso ( IsZF.union→ isZF (A , B) (ord→od x) A
-       (record { proj1 = case1 refl ; proj2 = subst (λ k → def A k) (sym diso) A∋x}))
-    lemma2 {x} (case2 B∋x) = subst (λ k → def (Union (A , B)) k) diso ( IsZF.union→ isZF (A , B) (ord→od x) B
-       (record { proj1 = case2 refl ; proj2 = subst (λ k → def B k) (sym diso) B∋x}))
+    lemma2 :  {x : Ordinal} → odef (A ∪ B) x → odef (Union (A , B)) x
+    lemma2 {x} (case1 A∋x) = subst (λ k → odef (Union (A , B)) k) diso ( IsZF.union→ isZF (A , B) (ord→od x) A
+       (record { proj1 = case1 refl ; proj2 = subst (λ k → odef A k) (sym diso) A∋x}))
+    lemma2 {x} (case2 B∋x) = subst (λ k → odef (Union (A , B)) k) diso ( IsZF.union→ isZF (A , B) (ord→od x) B
+       (record { proj1 = case2 refl ; proj2 = subst (λ k → odef B k) (sym diso) B∋x}))
 
 ∩-Select : { A B : HOD } →  Select A (  λ x → ( A ∋ x ) ∧ ( B ∋ x )  ) ≡ ( A ∩ B )
 ∩-Select {A} {B} = ==→o≡ ( record { eq→ =  lemma1 ; eq← = lemma2 } ) where
-    lemma1 : {x : Ordinal} → def (Select A (λ x₁ → (A ∋ x₁) ∧ (B ∋ x₁))) x → def (A ∩ B) x
-    lemma1 {x} lt = record { proj1 = proj1 lt ; proj2 = subst (λ k → def B k ) diso (proj2 (proj2 lt)) }
-    lemma2 : {x : Ordinal} → def (A ∩ B) x → def (Select A (λ x₁ → (A ∋ x₁) ∧ (B ∋ x₁))) x
+    lemma1 : {x : Ordinal} → odef (Select A (λ x₁ → (A ∋ x₁) ∧ (B ∋ x₁))) x → odef (A ∩ B) x
+    lemma1 {x} lt = record { proj1 = proj1 lt ; proj2 = subst (λ k → odef B k ) diso (proj2 (proj2 lt)) }
+    lemma2 : {x : Ordinal} → odef (A ∩ B) x → odef (Select A (λ x₁ → (A ∋ x₁) ∧ (B ∋ x₁))) x
     lemma2 {x} lt = record { proj1 = proj1 lt ; proj2 =
-        record { proj1 = subst (λ k → def A k) (sym diso) (proj1 lt) ; proj2 = subst (λ k → def B k ) (sym diso) (proj2 lt) } }
+        record { proj1 = subst (λ k → odef A k) (sym diso) (proj1 lt) ; proj2 = subst (λ k → odef B k ) (sym diso) (proj2 lt) } }
 
 dist-ord : {p q r : HOD } → p ∩ ( q ∪ r ) ≡   ( p ∩ q ) ∪ ( p ∩ r )
 dist-ord {p} {q} {r} = ==→o≡ ( record { eq→ = lemma1 ; eq← = lemma2 } ) where
-    lemma1 :  {x : Ordinal} → def (p ∩ (q ∪ r)) x → def ((p ∩ q) ∪ (p ∩ r)) x
+    lemma1 :  {x : Ordinal} → odef (p ∩ (q ∪ r)) x → odef ((p ∩ q) ∪ (p ∩ r)) x
     lemma1 {x} lt with proj2 lt
     lemma1 {x} lt | case1 q∋x = case1 ( record { proj1 = proj1 lt ; proj2 = q∋x } )
     lemma1 {x} lt | case2 r∋x = case2 ( record { proj1 = proj1 lt ; proj2 = r∋x } )
-    lemma2  : {x : Ordinal} → def ((p ∩ q) ∪ (p ∩ r)) x → def (p ∩ (q ∪ r)) x
+    lemma2  : {x : Ordinal} → odef ((p ∩ q) ∪ (p ∩ r)) x → odef (p ∩ (q ∪ r)) x
     lemma2 {x} (case1 p∩q) = record { proj1 = proj1 p∩q ; proj2 = case1 (proj2 p∩q ) } 
     lemma2 {x} (case2 p∩r) = record { proj1 = proj1 p∩r ; proj2 = case2 (proj2 p∩r ) } 
 
 dist-ord2 : {p q r : HOD } → p ∪ ( q ∩ r ) ≡   ( p ∪ q ) ∩ ( p ∪ r )
 dist-ord2 {p} {q} {r} = ==→o≡ ( record { eq→ = lemma1 ; eq← = lemma2 } ) where
-    lemma1 : {x : Ordinal} → def (p ∪ (q ∩ r)) x → def ((p ∪ q) ∩ (p ∪ r)) x
+    lemma1 : {x : Ordinal} → odef (p ∪ (q ∩ r)) x → odef ((p ∪ q) ∩ (p ∪ r)) x
     lemma1 {x} (case1 cp) = record { proj1 = case1 cp ; proj2 = case1 cp }
     lemma1 {x} (case2 cqr) = record { proj1 = case2 (proj1 cqr) ; proj2 = case2 (proj2 cqr) }
-    lemma2 : {x : Ordinal} → def ((p ∪ q) ∩ (p ∪ r)) x → def (p ∪ (q ∩ r)) x
+    lemma2 : {x : Ordinal} → odef ((p ∪ q) ∩ (p ∪ r)) x → odef (p ∪ (q ∩ r)) x
     lemma2 {x} lt with proj1 lt | proj2 lt
     lemma2 {x} lt | case1 cp | _ = case1 cp
     lemma2 {x} lt | _ | case1 cp = case1 cp 
--- a/LEMC.agda	Sun Jul 05 15:49:00 2020 +0900
+++ b/LEMC.agda	Sun Jul 05 16:56:21 2020 +0900
@@ -112,7 +112,7 @@
                  lemma : {y : Ordinal} → OD.def (od x) y ∧ OD.def (od u) y → y o< omin (odmax x) (odmax u)
                  lemma {y} lt = min1 (<odmax x (proj1 lt)) (<odmax u (proj2 lt))
               np : ¬ (p =h= od∅)
-              np p∅ =  NP (λ y p∋y → ∅< p∋y p∅ ) 
+              np p∅ =  NP (λ y p∋y → ∅< {p} {_} p∋y p∅ ) 
               y1choice : choiced p
               y1choice = choice-func p np
               y1 : HOD
@@ -126,9 +126,9 @@
          cx : {x : HOD} →  ¬ (x =h= od∅ ) → choiced x 
          cx {x} nx = choice-func x nx
          minimal : (x : HOD  ) → ¬ (x =h= od∅ ) → HOD 
-         minimal x not = min (Min2 (a-choice (cx not) ) x (is-in (cx not))) 
+         minimal x ne = min (Min2 (a-choice (cx {x} ne) ) x (is-in (cx ne))) 
          x∋minimal : (x : HOD  ) → ( ne : ¬ (x =h= od∅ ) ) → odef x ( od→ord ( minimal x ne ) )
-         x∋minimal x ne = x∋min (Min2 (a-choice (cx ne) ) x (is-in (cx ne))) 
+         x∋minimal x ne = x∋min (Min2 (a-choice (cx {x} ne) ) x (is-in (cx ne))) 
          minimal-1 : (x : HOD  ) → ( ne : ¬ (x =h= od∅ ) ) → (y : HOD ) → ¬ ( odef (minimal x ne) (od→ord y)) ∧ (odef x (od→ord  y) )
          minimal-1 x ne y = min-empty (Min2 (a-choice (cx ne) ) x (is-in (cx ne))) y
 
--- a/ODC.agda	Sun Jul 05 15:49:00 2020 +0900
+++ b/ODC.agda	Sun Jul 05 16:56:21 2020 +0900
@@ -23,6 +23,8 @@
 
 open HOD
 
+open _∧_
+
 _=h=_ : (x y : HOD) → Set n
 x =h= y  = od x == od y
 
@@ -40,26 +42,29 @@
 --     https://plato.stanford.edu/entries/axiom-choice/#AxiChoLog
 --
 
-ppp :  { p : Set n } { a : HOD  } → record { od = record { def = λ x → p } ; odmax = {!!} ; <odmax = {!!} } ∋ a → p
-ppp  {p} {a} d = d
+pred-od :  ( p : Set n )  → HOD
+pred-od  p  = record { od = record { def = λ x → (x ≡ o∅) ∧ p } ;
+   odmax = osuc o∅; <odmax = λ x → subst (λ k →  k o< osuc o∅) (sym (proj1 x)) <-osuc } 
+
+ppp :  { p : Set n } { a : HOD  } → pred-od p ∋ a → p
+ppp  {p} {a} d = proj2 d
 
--- p∨¬p : ( p : Set n ) → p ∨ ( ¬ p )         -- assuming axiom of choice
--- p∨¬p  p with is-o∅ ( od→ord ( record { odef = λ x → p } ))
--- p∨¬p  p | yes eq = case2 (¬p eq) where
---    ps = record { odef = λ x → p }
---    lemma : ps =h= od∅ → p → ⊥
---    lemma eq p0 = ¬x<0  {od→ord ps} (eq→ eq p0 )
---    ¬p : (od→ord ps ≡ o∅) → p → ⊥
---    ¬p eq = lemma ( subst₂ (λ j k → j =h=  k ) oiso o∅≡od∅ ( o≡→== eq ))
--- p∨¬p  p | no ¬p = case1 (ppp  {p} {minimal ps (λ eq →  ¬p (eqo∅ eq))} lemma) where
---    ps = record { odef = λ x → p }
---    eqo∅ : ps =h=  od∅  → od→ord ps ≡  o∅  
---    eqo∅ eq = subst (λ k → od→ord ps ≡ k) ord-od∅ ( cong (λ k → od→ord k ) (==→o≡ eq)) 
---    lemma : ps ∋ minimal ps (λ eq →  ¬p (eqo∅ eq)) 
---    lemma = x∋minimal ps (λ eq →  ¬p (eqo∅ eq))
-
-postulate 
-   p∨¬p : ( p : Set n ) → p ∨ ( ¬ p )         -- assuming axiom of choice
+p∨¬p : ( p : Set n ) → p ∨ ( ¬ p )         -- assuming axiom of choice
+p∨¬p  p with is-o∅ ( od→ord (pred-od p ))
+p∨¬p  p | yes eq = case2 (¬p eq) where
+   ps = pred-od p 
+   eqo∅ : ps =h=  od∅  → od→ord ps ≡  o∅  
+   eqo∅ eq = subst (λ k → od→ord ps ≡ k) ord-od∅ ( cong (λ k → od→ord k ) (==→o≡ eq)) 
+   lemma : ps =h= od∅ → p → ⊥
+   lemma eq p0 = ¬x<0  {od→ord ps} (eq→ eq record { proj1 = eqo∅ eq ; proj2 = p0 } )
+   ¬p : (od→ord ps ≡ o∅) → p → ⊥
+   ¬p eq = lemma ( subst₂ (λ j k → j =h=  k ) oiso o∅≡od∅ ( o≡→== eq ))
+p∨¬p  p | no ¬p = case1 (ppp  {p} {minimal ps (λ eq →  ¬p (eqo∅ eq))} lemma) where
+   ps = pred-od p 
+   eqo∅ : ps =h=  od∅  → od→ord ps ≡  o∅  
+   eqo∅ eq = subst (λ k → od→ord ps ≡ k) ord-od∅ ( cong (λ k → od→ord k ) (==→o≡ eq)) 
+   lemma : ps ∋ minimal ps (λ eq →  ¬p (eqo∅ eq)) 
+   lemma = x∋minimal ps (λ eq →  ¬p (eqo∅ eq))
 
 decp : ( p : Set n ) → Dec p   -- assuming axiom of choice    
 decp  p with p∨¬p p
--- a/cardinal.agda	Sun Jul 05 15:49:00 2020 +0900
+++ b/cardinal.agda	Sun Jul 05 16:56:21 2020 +0900
@@ -29,49 +29,48 @@
 -- we have to work on Ordinal to keep OD Level n
 -- since we use p∨¬p which works only on Level n
 
-    
-∋-p : (A x : OD ) → Dec ( A ∋ x ) 
+∋-p : (A x : HOD ) → Dec ( A ∋ x ) 
 ∋-p A x with ODC.p∨¬p O ( A ∋ x )
 ∋-p A x | case1 t = yes t
 ∋-p A x | case2 t = no t
 
-_⊗_  : (A B : OD) → OD
-A ⊗ B  = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkAB p ) } where
+_⊗_  : (A B : HOD) → HOD
+A ⊗ B  = record { od = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkAB p ) } } where
     checkAB : { p : Ordinal } → def ZFProduct p → Set n
-    checkAB (pair x y) = def A x ∧ def B y
+    checkAB (pair x y) = odef A x ∧ odef B y
 
-func→od0  : (f : Ordinal → Ordinal ) → OD
-func→od0  f = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkfunc p ) } where
+func→od0  : (f : Ordinal → Ordinal ) → HOD
+func→od0  f = record { od = record { def = λ x → def ZFProduct x ∧ ( { x : Ordinal } → (p : def ZFProduct x ) → checkfunc p ) }}  where
     checkfunc : { p : Ordinal } → def ZFProduct p → Set n
     checkfunc (pair x y) = f x ≡ y
 
 --  Power (Power ( A ∪ B )) ∋ ( A ⊗ B )
 
-Func :  ( A B : OD ) → OD
-Func A B = record { def = λ x → def (Power (A ⊗ B)) x } 
+Func :  ( A B : HOD ) → HOD
+Func A B = record { od = record { def = λ x → odef (Power (A ⊗ B)) x }  }
 
 -- power→ :  ( A t : OD) → Power A ∋ t → {x : OD} → t ∋ x → ¬ ¬ (A ∋ x)
 
-func→od : (f : Ordinal → Ordinal ) → ( dom : OD ) → OD 
+func→od : (f : Ordinal → Ordinal ) → ( dom : HOD ) → HOD 
 func→od f dom = Replace dom ( λ x →  < x , ord→od (f (od→ord x)) > )
 
-record Func←cd { dom cod : OD } {f : Ordinal }  : Set n where
+record Func←cd { dom cod : HOD } {f : Ordinal }  : Set n where
    field
       func-1 : Ordinal → Ordinal
       func→od∈Func-1 :  Func dom cod ∋  func→od func-1 dom
  
-od→func : { dom cod : OD } → {f : Ordinal }  → def (Func dom cod ) f  → Func←cd {dom} {cod} {f} 
-od→func {dom} {cod} {f} lt = record { func-1 = λ x → sup-o ( λ y → lemma x {!!} ) ; func→od∈Func-1 = record { proj1 = {!!} ; proj2 = {!!} } } where
+od→func : { dom cod : HOD } → {f : Ordinal }  → odef (Func dom cod ) f  → Func←cd {dom} {cod} {f} 
+od→func {dom} {cod} {f} lt = record { func-1 = λ x → sup-o {!!} ( λ y lt → lemma x {!!} ) ; func→od∈Func-1 = record { proj1 = {!!} ; proj2 = {!!} } } where
    lemma : Ordinal → Ordinal → Ordinal
-   lemma x y with IsZF.power→ isZF (dom ⊗ cod) (ord→od f) (subst (λ k → def (Power (dom ⊗ cod)) k ) (sym diso) lt ) | ∋-p (ord→od f) (ord→od y)
+   lemma x y with IsZF.power→ isZF (dom ⊗ cod) (ord→od f) (subst (λ k → odef (Power (dom ⊗ cod)) k ) (sym diso) lt ) | ∋-p (ord→od f) (ord→od y)
    lemma x y | p | no n  = o∅
    lemma x y | p | yes f∋y = lemma2 (proj1 (ODC.double-neg-eilm O ( p {ord→od y} f∋y ))) where -- p : {y : OD} → f ∋ y → ¬ ¬ (dom ⊗ cod ∋ y) 
            lemma2 : {p : Ordinal} → ord-pair p  → Ordinal
            lemma2 (pair x1 y1) with ODC.decp O ( x1 ≡ x)
            lemma2 (pair x1 y1) | yes p = y1
            lemma2 (pair x1 y1) | no ¬p = o∅
-   fod : OD
-   fod = Replace dom ( λ x →  < x , ord→od (sup-o ( λ y → lemma (od→ord x) {!!} )) > )
+   fod : HOD
+   fod = Replace dom ( λ x →  < x , ord→od (sup-o {!!} ( λ y lt → lemma (od→ord x) {!!} )) > )
 
 
 open Func←cd
@@ -91,18 +90,18 @@
 --     X ---------------------------> Y
 --          ymap   <-  def Y y
 --
-record Onto  (X Y : OD )  : Set n where
+record Onto  (X Y : HOD )  : Set n where
    field
        xmap : Ordinal 
        ymap : Ordinal 
-       xfunc : def (Func X Y) xmap 
-       yfunc : def (Func Y X) ymap 
-       onto-iso   : {y :  Ordinal  } → (lty : def Y y ) →
+       xfunc : odef (Func X Y) xmap 
+       yfunc : odef (Func Y X) ymap 
+       onto-iso   : {y :  Ordinal  } → (lty : odef Y y ) →
           func-1 ( od→func {X} {Y} {xmap} xfunc ) ( func-1 (od→func  yfunc) y )  ≡ y 
 
 open Onto
 
-onto-restrict : {X Y Z : OD} → Onto X Y → Z ⊆ Y  → Onto X Z
+onto-restrict : {X Y Z : HOD} → Onto X Y → Z ⊆ Y  → Onto X Z
 onto-restrict {X} {Y} {Z} onto  Z⊆Y = record {
      xmap = xmap1
    ; ymap = zmap
@@ -114,23 +113,23 @@
        xmap1 = od→ord (Select (ord→od (xmap onto)) {!!} ) 
        zmap : Ordinal 
        zmap = {!!}
-       xfunc1 : def (Func X Z) xmap1
+       xfunc1 : odef (Func X Z) xmap1
        xfunc1 = {!!}
-       zfunc : def (Func Z X) zmap 
+       zfunc : odef (Func Z X) zmap 
        zfunc = {!!}
-       onto-iso1   : {z :  Ordinal  } → (ltz : def Z z ) → func-1 (od→func  xfunc1 )  (func-1 (od→func  zfunc ) z )  ≡ z
+       onto-iso1   : {z :  Ordinal  } → (ltz : odef Z z ) → func-1 (od→func  xfunc1 )  (func-1 (od→func  zfunc ) z )  ≡ z
        onto-iso1   = {!!}
 
 
-record Cardinal  (X  : OD ) : Set n where
+record Cardinal  (X  : HOD ) : Set n where
    field
        cardinal : Ordinal 
        conto : Onto X (Ord cardinal)  
        cmax : ( y : Ordinal  ) → cardinal o< y → ¬ Onto X (Ord y)  
 
-cardinal :  (X  : OD ) → Cardinal X
+cardinal :  (X  : HOD ) → Cardinal X
 cardinal  X = record {
-       cardinal = sup-o ( λ x → proj1 ( cardinal-p {!!}) )
+       cardinal = sup-o {!!} ( λ x lt → proj1 ( cardinal-p {!!}) )
      ; conto = onto
      ; cmax = cmax
    } where
@@ -138,24 +137,24 @@
     cardinal-p x with ODC.p∨¬p O ( Onto X (Ord x)  ) 
     cardinal-p x | case1 True  = record { proj1 = x  ; proj2 = yes True }
     cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False }
-    S = sup-o (λ x → proj1 (cardinal-p {!!}))
-    lemma1 :  (x : Ordinal) → ((y : Ordinal) → y o< x → Lift (suc n) (y o< (osuc S) → Onto X (Ord y))) →
-                    Lift (suc n) (x o< (osuc S) → Onto X (Ord x) )
+    S = sup-o {!!} (λ x lt → proj1 (cardinal-p {!!}))
+    lemma1 :  (x : Ordinal) → ((y : Ordinal) → y o< x →  (y o< (osuc S) → Onto X (Ord y))) →
+                     (x o< (osuc S) → Onto X (Ord x) )
     lemma1 x prev with trio< x (osuc S)
     lemma1 x prev | tri< a ¬b ¬c with osuc-≡< a
-    lemma1 x prev | tri< a ¬b ¬c | case1 x=S = lift ( λ lt → {!!} )
-    lemma1 x prev | tri< a ¬b ¬c | case2 x<S = lift ( λ lt → lemma2 ) where
+    lemma1 x prev | tri< a ¬b ¬c | case1 x=S = ( λ lt → {!!} )
+    lemma1 x prev | tri< a ¬b ¬c | case2 x<S = ( λ lt → lemma2 ) where
          lemma2 : Onto X (Ord x) 
          lemma2 with prev {!!} {!!}
-         ... | lift t = t {!!}
-    lemma1 x prev | tri≈ ¬a b ¬c = lift ( λ lt → ⊥-elim ( o<¬≡ b lt ))
-    lemma1 x prev | tri> ¬a ¬b c = lift ( λ lt → ⊥-elim ( o<> c lt ))
+         ... | t = {!!}
+    lemma1 x prev | tri≈ ¬a b ¬c = ( λ lt → ⊥-elim ( o<¬≡ b lt ))
+    lemma1 x prev | tri> ¬a ¬b c = ( λ lt → ⊥-elim ( o<> c lt ))
     onto : Onto X (Ord S) 
-    onto with TransFinite {λ x → Lift (suc n) ( x o< osuc S → Onto X (Ord x) ) } lemma1 S 
-    ... | lift t = t <-osuc  
+    onto with TransFinite {λ x →  ( x o< osuc S → Onto X (Ord x) ) } lemma1 S 
+    ... | t = t <-osuc  
     cmax : (y : Ordinal) → S o< y → ¬ Onto X (Ord y) 
-    cmax y lt ontoy = o<> lt (o<-subst  {_} {_} {y} {S}
-       (sup-o<  {λ x → proj1 ( cardinal-p {!!})}{{!!}}  ) lemma refl ) where
+    cmax y lt ontoy = o<> lt (o<-subst  {_} {_} {y} {S} {!!} lemma refl ) where
+       -- (sup-o<  ? {λ x lt → proj1 ( cardinal-p {!!})}{{!!}}  ) lemma refl ) where
           lemma : proj1 (cardinal-p y) ≡ y
           lemma with  ODC.p∨¬p O ( Onto X (Ord y) )
           lemma | case1 x = refl
--- a/filter.agda	Sun Jul 05 15:49:00 2020 +0900
+++ b/filter.agda	Sun Jul 05 16:56:21 2020 +0900
@@ -54,7 +54,7 @@
 trans-⊆ A⊆B B⊆C = record { incl = λ x → incl B⊆C (incl A⊆B x) }
 
 power→⊆ :  ( A t : HOD) → Power A ∋ t → t ⊆ A
-power→⊆ A t  PA∋t = record { incl = λ {x} t∋x → HODC.double-neg-eilm O (t1 t∋x) } where
+power→⊆ A t  PA∋t = record { incl = λ {x} t∋x → ODC.double-neg-eilm O (t1 t∋x) } where
    t1 : {x : HOD }  → t ∋ x → ¬ ¬ (A ∋ x)
    t1 = zf.IsZF.power→ isZF A t PA∋t
 
@@ -70,6 +70,10 @@
 q∩q⊆q : {p q : HOD } → (q ∩ p) ⊆ q 
 q∩q⊆q = record { incl = λ lt → proj1 lt } 
 
+open HOD
+_=h=_ : (x y : HOD) → Set n
+x =h= y  = od x == od y
+
 -----
 --
 --  ultra filter is prime
@@ -84,11 +88,11 @@
   lemma3 {p} {q} lt with ultra-filter.ultra u (∪-lemma1 (∈-filter P lt) )
   ... | case1 p∈P  = case1 p∈P
   ... | case2 ¬p∈P = case2 (filter1 P {q ∩ (L \ p)} (∪-lemma2 (∈-filter P lt)) lemma7 lemma8) where
-    lemma5 : ((p ∪ q ) ∩ (L \ p)) ==  (q ∩ (L \ p))
+    lemma5 : ((p ∪ q ) ∩ (L \ p)) =h=  (q ∩ (L \ p))
     lemma5 = record { eq→ = λ {x} lt → record { proj1 = lemma4 x lt ; proj2 = proj2 lt  }
        ;  eq← = λ {x} lt → record { proj1 = case2 (proj1 lt) ; proj2 = proj2 lt }
       } where
-         lemma4 : (x : Ordinal ) → def ((p ∪ q) ∩ (L \ p)) x → def q x
+         lemma4 : (x : Ordinal ) → odef ((p ∪ q) ∩ (L \ p)) x → odef q x
          lemma4 x lt with proj1 lt
          lemma4 x lt | case1 px = ⊥-elim ( proj2 (proj2 lt) px )
          lemma4 x lt | case2 qx = qx
@@ -110,11 +114,11 @@
        ; ultra = λ {p}  p⊆L → prime-filter.prime prime (lemma p  p⊆L)
    } where
         open _==_
-        p+1-p=1 : {p : HOD} → p ⊆ L → L == (p ∪ (L \ p)) 
-        eq→ (p+1-p=1 {p} p⊆L) {x} lt with HODC.decp O (def p x)
+        p+1-p=1 : {p : HOD} → p ⊆ L → L =h= (p ∪ (L \ p)) 
+        eq→ (p+1-p=1 {p} p⊆L) {x} lt with ODC.decp O (odef p x)
         eq→ (p+1-p=1 {p} p⊆L) {x} lt | yes p∋x = case1 p∋x
         eq→ (p+1-p=1 {p} p⊆L) {x} lt | no ¬p = case2 (record { proj1 = lt ; proj2 = ¬p })
-        eq← (p+1-p=1 {p} p⊆L) {x} ( case1 p∋x ) = subst (λ k → def L k ) diso (incl p⊆L ( subst (λ k → def p k) (sym diso) p∋x  )) 
+        eq← (p+1-p=1 {p} p⊆L) {x} ( case1 p∋x ) = subst (λ k → odef L k ) diso (incl p⊆L ( subst (λ k → odef p k) (sym diso) p∋x  )) 
         eq← (p+1-p=1 {p} p⊆L) {x} ( case2 ¬p  ) = proj1 ¬p
         lemma : (p : HOD) → p ⊆ L   →  filter P ∋ (p ∪ (L \ p))
         lemma p p⊆L = subst (λ k → filter P ∋ k ) (==→o≡ (p+1-p=1 p⊆L)) f∋L