view cardinal.agda @ 225:5f48299929ac

does not work
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 11 Aug 2019 08:10:13 +0900
parents afc864169325
children 176ff97547b4
line wrap: on
line source

open import Level
open import Ordinals
module cardinal {n : Level } (O : Ordinals {n}) where

open import zf
open import logic
import OD 
open import Data.Nat renaming ( zero to Zero ; suc to Suc ;  ℕ to Nat ; _⊔_ to _n⊔_ ) 
open import Relation.Binary.PropositionalEquality
open import Data.Nat.Properties 
open import Data.Empty
open import Relation.Nullary
open import Relation.Binary
open import Relation.Binary.Core

open inOrdinal O
open OD O
open OD.OD

open _∧_
open _∨_
open Bool


func : (f : Ordinal → Ordinal ) → ( dom cod : OD ) → OD 
func f dom cod = record { def = λ z → {x y : Ordinal} → (z ≡ omax x y ) ∧  def dom x  ∧ def cod (f x ) }

-- Func :  ( dom cod : OD ) → OD
-- Func dom cod = record { def = λ x → x o< sup-o ( λ y → (f : Ordinal → Ordinal ) → y ≡ od→ord (func f dom cod) )  }

------------
--
-- Onto map
--          def X x ->  xmap
--     X ---------------------------> Y
--          ymap   <-  def Y y
--
record Onto  (X Y : OD )  : Set n where
   field
       xmap : (x : Ordinal ) → def X x → Ordinal  
       ymap : (y : Ordinal ) → def Y y → Ordinal  
       ymap-on-X  : {y :  Ordinal  } → (lty : def Y y ) → def X (ymap y lty)  
       onto-iso   : {y :  Ordinal  } → (lty : def Y y ) → xmap  ( ymap y lty ) (ymap-on-X lty ) ≡ y

record Cardinal  (X  : OD ) : Set n where
   field
       cardinal : Ordinal 
       conto : Onto (Ord cardinal) X 
       cmax : ( y : Ordinal  ) → cardinal o< y → ¬ Onto (Ord y) X 

cardinal :  (X  : OD ) → Cardinal X
cardinal  X = record {
       cardinal = sup-o ( λ x → proj1 ( cardinal-p x) )
     ; conto =  x∋minimul onto-set ∃-onto-set 
     ; cmax = cmax
   } where
    cardinal-p : (x  : Ordinal ) →  ( Ordinal  ∧ Dec (Onto (Ord x) X) )
    cardinal-p x with p∨¬p ( Onto (Ord x) X ) 
    cardinal-p x | case1 True = record { proj1 = x ; proj2 = yes True }
    cardinal-p x | case2 False = record { proj1 = o∅ ; proj2 = no False }
    onto-set : OD 
    onto-set = record { def = λ x →  Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X }
    ∃-onto-set : ¬ ( onto-set == od∅ )
    ∃-onto-set record { eq→ = eq→ ; eq← = eq← } = ¬x<0 {_} ( eq→ lemma ) where
          lemma : Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X 
          lemma = {!!}
    cmax : (y : Ordinal) → sup-o (λ x → proj1 (cardinal-p x)) o< y → ¬ Onto (Ord y) X
    cmax y lt ontoy = o<> lt (o<-subst  {_} {_} {y} {sup-o (λ x → proj1 (cardinal-p x))}
       (sup-o<  {λ x → proj1 ( cardinal-p x)}{y}  ) lemma refl ) where
          lemma : proj1 (cardinal-p y) ≡ y
          lemma with  p∨¬p ( Onto (Ord y) X )
          lemma | case1 x = refl
          lemma | case2 not = ⊥-elim ( not ontoy )

--  All cardinal is ℵ0,  since we are working on Countable Ordinal, 
--  Power ω is larger than ℵ0, so it has no cardinal.