# HG changeset patch # User Shinji KONO # Date 1565139051 -32400 # Node ID 43021d2b8756aed2596a960d11fabc287f48e8a1 # Parent eee983e4b402c90f2c915ffd5736f2ebdcb258d6 separate cardinal diff -r eee983e4b402 -r 43021d2b8756 OD.agda --- a/OD.agda Tue Aug 06 15:50:14 2019 +0900 +++ b/OD.agda Wed Aug 07 09:50:51 2019 +0900 @@ -622,83 +622,3 @@ ; eq← = λ {x} lt → ⊥-elim ( ¬x<0 lt ) } - ------------ - -- - -- Onto map - -- def X x -> xmap - -- X ---------------------------> Y - -- ymap <- def Y y - -- - record Onto {n : Level } (X Y : OD {n}) : Set (suc n) where - field - xmap : (x : Ordinal {n}) → def X x → Ordinal {n} - ymap : (y : Ordinal {n}) → def Y y → Ordinal {n} - ymap-on-X : {y : Ordinal {n} } → (lty : def Y y ) → def X (ymap y lty) - onto-iso : {y : Ordinal {n} } → (lty : def Y y ) → xmap ( ymap y lty ) (ymap-on-X lty ) ≡ y - - record Cardinal {n : Level } (X : OD {n}) : Set (suc n) where - field - cardinal : Ordinal {n} - conto : Onto (Ord cardinal) X - cmax : ( y : Ordinal {n} ) → cardinal o< y → ¬ Onto (Ord y) X - - cardinal : {n : Level } (X : OD {suc n}) → Cardinal X - cardinal {n} X = record { - cardinal = sup-o ( λ x → proj1 ( cardinal-p x) ) - ; conto = onto - ; cmax = cmax - } where - cardinal-p : (x : Ordinal {suc n}) → ( Ordinal {suc n} ∧ 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 {suc n} - onto-set = record { def = λ x → {!!} } -- Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X } - onto : Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X - onto = record { - xmap = xmap - ; ymap = ymap - ; ymap-on-X = ymap-on-X - ; onto-iso = onto-iso - } where - -- - -- Ord cardinal itself has no onto map, but if we have x o< cardinal, there is one - -- od→ord X o< cardinal, so if we have def Y y or def X y, there is an Onto (Ord y) X - Y = (Ord (sup-o (λ x → proj1 (cardinal-p x)))) - lemma1 : (y : Ordinal {suc n}) → def Y y → Onto (Ord y) X - lemma1 y y lt (o<-subst {suc n} {_} {_} {y} {sup-o (λ x → proj1 (cardinal-p x))} - (sup-o< {suc n} {λ 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 ) - -func : {n : Level} → (f : Ordinal {suc n} → Ordinal {suc n}) → OD {suc n} -func {n} f = record { def = λ y → (x : Ordinal {suc n}) → y ≡ f x } - -Func : {n : Level} → OD {suc n} -Func {n} = record { def = λ x → (f : Ordinal {suc n} → Ordinal {suc n}) → x ≡ od→ord (func f) } - -odmap : {n : Level} → { x : OD {suc n} } → Func ∋ x → Ordinal {suc n} → OD {suc n} -odmap {n} {f} lt x = record { def = λ y → def f y } - - - ----- - -- All cardinal is ℵ0, since we are working on Countable Ordinal, - -- Power ω is larger than ℵ0, so it has no cardinal. - - - diff -r eee983e4b402 -r 43021d2b8756 cardinal.agda --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cardinal.agda Wed Aug 07 09:50:51 2019 +0900 @@ -0,0 +1,105 @@ +open import Level +module cardinal where + +open import zf +open import ordinal +open import logic +open 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 OD.OD + +open Ordinal +open _∧_ +open _∨_ +open Bool + +------------ +-- +-- Onto map +-- def X x -> xmap +-- X ---------------------------> Y +-- ymap <- def Y y +-- +record Onto {n : Level } (X Y : OD {n}) : Set (suc n) where + field + xmap : (x : Ordinal {n}) → def X x → Ordinal {n} + ymap : (y : Ordinal {n}) → def Y y → Ordinal {n} + ymap-on-X : {y : Ordinal {n} } → (lty : def Y y ) → def X (ymap y lty) + onto-iso : {y : Ordinal {n} } → (lty : def Y y ) → xmap ( ymap y lty ) (ymap-on-X lty ) ≡ y + +record Cardinal {n : Level } (X : OD {n}) : Set (suc n) where + field + cardinal : Ordinal {n} + conto : Onto (Ord cardinal) X + cmax : ( y : Ordinal {n} ) → cardinal o< y → ¬ Onto (Ord y) X + +cardinal : {n : Level } (X : OD {suc n}) → Cardinal X +cardinal {n} X = record { + cardinal = sup-o ( λ x → proj1 ( cardinal-p x) ) + ; conto = onto + ; cmax = cmax + } where + cardinal-p : (x : Ordinal {suc n}) → ( Ordinal {suc n} ∧ 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 {suc n} + onto-set = record { def = λ x → {!!} } -- Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X } + onto : Onto (Ord (sup-o (λ x → proj1 (cardinal-p x)))) X + onto = record { + xmap = xmap + ; ymap = ymap + ; ymap-on-X = ymap-on-X + ; onto-iso = onto-iso + } where + -- + -- Ord cardinal itself has no onto map, but if we have x o< cardinal, there is one + -- od→ord X o< cardinal, so if we have def Y y or def X y, there is an Onto (Ord y) X + Y = (Ord (sup-o (λ x → proj1 (cardinal-p x)))) + lemma1 : (y : Ordinal {suc n}) → def Y y → Onto (Ord y) X + lemma1 y y lt (o<-subst {suc n} {_} {_} {y} {sup-o (λ x → proj1 (cardinal-p x))} + (sup-o< {suc n} {λ 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 ) + +func : {n : Level} → (f : Ordinal {suc n} → Ordinal {suc n}) → OD {suc n} +func {n} f = record { def = λ y → (x : Ordinal {suc n}) → y ≡ f x } + +Func : {n : Level} → OD {suc n} +Func {n} = record { def = λ x → (f : Ordinal {suc n} → Ordinal {suc n}) → x ≡ od→ord (func f) } + +odmap : {n : Level} → { x : OD {suc n} } → Func ∋ x → Ordinal {suc n} → OD {suc n} +odmap {n} {f} lt x = record { def = λ y → def f y } + +lemma1 : {n : Level} → { x : OD {suc n} } → Func ∋ x → {!!} -- ¬ ( (f : Ordinal {suc n} → Ordinal {suc n}) → ¬ ( x ≡ od→ord (func f) )) +lemma1 = {!!} + + +----- +-- All cardinal is ℵ0, since we are working on Countable Ordinal, +-- Power ω is larger than ℵ0, so it has no cardinal. + + +