Mercurial > hg > Members > kono > Proof > ZF-in-agda
changeset 1242:e843ace90b31
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 Mar 2023 13:32:22 +0900 |
parents | 5f1572d1f19a |
children | 50fcf7f047d1 |
files | src/generic-filter.agda |
diffstat | 1 files changed, 101 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/src/generic-filter.agda Mon Mar 13 01:30:55 2023 +0900 +++ b/src/generic-filter.agda Mon Mar 13 13:32:22 2023 +0900 @@ -1,7 +1,7 @@ {-# OPTIONS --allow-unsolved-metas #-} -open import Level +import Level open import Ordinals -module generic-filter {n : Level } (O : Ordinals {n}) where +module generic-filter {n : Level.Level } (O : Ordinals {n}) where import filter open import zf @@ -15,7 +15,7 @@ open import Relation.Binary open import Relation.Binary.Core open import Relation.Binary.PropositionalEquality -open import Data.Nat renaming ( zero to Zero ; suc to Suc ; ℕ to Nat ; _⊔_ to _n⊔_ ) +open import Data.Nat import BAlgebra open BAlgebra O @@ -54,15 +54,15 @@ open import ZProduct O -record CountableModel : Set (suc (suc n)) where +record CountableModel : Set (Level.suc (Level.suc n)) where field ctl-M : HOD - ctl→ : Nat → Ordinal - ctl<M : (x : Nat) → odef (ctl-M) (ctl→ x) - ctl← : (x : Ordinal )→ odef (ctl-M ) x → Nat + ctl→ : ℕ → Ordinal + ctl<M : (x : ℕ) → odef (ctl-M) (ctl→ x) + ctl← : (x : Ordinal )→ odef (ctl-M ) x → ℕ ctl-iso→ : { x : Ordinal } → (lt : odef (ctl-M) x ) → ctl→ (ctl← x lt ) ≡ x -- we have no otherway round - -- ctl-iso← : { x : Nat } → ctl← (ctl→ x ) (ctl<M x) ≡ x + -- ctl-iso← : { x : ℕ } → ctl← (ctl→ x ) (ctl<M x) ≡ x -- -- almmost universe -- find-p contains ∃ x : Ordinal → x o< & M → ∀ r ∈ M → ∈ Ord x @@ -76,7 +76,7 @@ -- a(n) ∈ M -- ∃ q ∈ L ⊆ Power P → q ∈ a(n) ∧ p(n) ⊆ q -- -PGHOD : (i : Nat) (L : HOD) (C : CountableModel ) → (p : Ordinal) → HOD +PGHOD : (i : ℕ) (L : HOD) (C : CountableModel ) → (p : Ordinal) → HOD PGHOD i L C p = record { od = record { def = λ x → odef L x ∧ odef (* (ctl→ C i)) x ∧ ( (y : Ordinal ) → odef (* p) y → odef (* x) y ) } ; odmax = odmax L ; <odmax = λ {y} lt → <odmax L (proj1 lt) } @@ -84,9 +84,9 @@ --- -- p(n+1) = if ({q | q ∈ a(n) ∧ p(n) ⊆ q)} != ∅ then q otherwise p(n) -- -find-p : (L : HOD ) (C : CountableModel ) (i : Nat) → (x : Ordinal) → Ordinal -find-p L C Zero x = x -find-p L C (Suc i) x with is-o∅ ( & ( PGHOD i L C (find-p L C i x)) ) +find-p : (L : HOD ) (C : CountableModel ) (i : ℕ) → (x : Ordinal) → Ordinal +find-p L C zero x = x +find-p L C (suc i) x with is-o∅ ( & ( PGHOD i L C (find-p L C i x)) ) ... | yes y = find-p L C i x ... | no not = & (ODC.minimal O ( PGHOD i L C (find-p L C i x)) (λ eq → not (=od∅→≡o∅ eq))) -- axiom of choice @@ -95,7 +95,7 @@ -- record PDN (L p : HOD ) (C : CountableModel ) (x : Ordinal) : Set n where field - gr : Nat + gr : ℕ pn<gr : (y : Ordinal) → odef (* x) y → odef (* (find-p L C gr (& p))) y x∈PP : odef L x @@ -111,7 +111,7 @@ open PDN ---- --- Generic Filter on Power P for HOD's Countable Ordinal (G ⊆ Power P ≡ G i.e. Nat → P → Set ) +-- Generic Filter on Power P for HOD's Countable Ordinal (G ⊆ Power P ≡ G i.e. ℕ → P → Set ) -- -- p 0 ≡ ∅ -- p (suc n) = if ∃ q ∈ M ∧ p n ⊆ q → q (by axiom of choice) ( q = * ( ctl→ n ) ) @@ -124,27 +124,38 @@ x<y→∋ : {x y : Ordinal} → odef (* x) y → * x ∋ * y x<y→∋ {x} {y} lt = subst (λ k → odef (* x) k ) (sym &iso) lt +gf05 : {a b : HOD} {x : Ordinal } → (odef (a ∪ b) x ) → ¬ odef a x → ¬ odef b x → ⊥ +gf05 {a} {b} {x} (case1 ax) nax nbx = nax ax +gf05 {a} {b} {x} (case2 bx) nax nbx = nbx bx + +gf02 : {P a b : HOD } → (P \ a) ∩ (P \ b) ≡ ( P \ (a ∪ b) ) +gf02 {P} {a} {b} = ==→o≡ record { eq→ = gf03 ; eq← = gf04 }where + gf03 : {x : Ordinal} → odef ((P \ a) ∩ (P \ b)) x → odef (P \ (a ∪ b)) x + gf03 {x} ⟪ ⟪ Px , ¬ax ⟫ , ⟪ _ , ¬bx ⟫ ⟫ = ⟪ Px , (λ pab → gf05 {a} {b} {x} pab ¬ax ¬bx ) ⟫ + gf04 : {x : Ordinal} → odef (P \ (a ∪ b)) x → odef ((P \ a) ∩ (P \ b)) x + gf04 {x} ⟪ Px , abx ⟫ = ⟪ ⟪ Px , (λ ax → abx (case1 ax) ) ⟫ , ⟪ Px , (λ bx → abx (case2 bx) ) ⟫ ⟫ + open import Data.Nat.Properties open import nat -p-monotonic1 : (L p : HOD ) (C : CountableModel ) → {n : Nat} → (* (find-p L C (Suc n) (& p))) ⊆ (* (find-p L C n (& p))) +p-monotonic1 : (L p : HOD ) (C : CountableModel ) → {n : ℕ} → (* (find-p L C n (& p))) ⊆ (* (find-p L C (suc n) (& p))) p-monotonic1 L p C {n} {x} with is-o∅ (& (PGHOD n L C (find-p L C n (& p)))) ... | yes y = refl-⊆ {* (find-p L C n (& p))} -... | no not = ? where -- λ lt → proj2 (proj2 fmin∈PGHOD) _ ? where +... | no not = λ lt → proj2 (proj2 fmin∈PGHOD) _ lt where fmin : HOD fmin = ODC.minimal O (PGHOD n L C (find-p L C n (& p))) (λ eq → not (=od∅→≡o∅ eq)) fmin∈PGHOD : PGHOD n L C (find-p L C n (& p)) ∋ fmin fmin∈PGHOD = ODC.x∋minimal O (PGHOD n L C (find-p L C n (& p))) (λ eq → not (=od∅→≡o∅ eq)) -p-monotonic : (L p : HOD ) (C : CountableModel ) → {n m : Nat} → n ≤ m → (* (find-p L C m (& p))) ⊆ (* (find-p L C n (& p))) -p-monotonic L p C {Zero} {Zero} n≤m = refl-⊆ {* (find-p L C Zero (& p))} -p-monotonic L p C {Zero} {Suc m} z≤n lt = (p-monotonic L p C {Zero} {m} z≤n ) (p-monotonic1 L p C {m} lt ) -p-monotonic L p C {Suc n} {Suc m} (s≤s n≤m) with <-cmp n m -... | tri< a ¬b ¬c = λ lt → (p-monotonic L p C {Suc n} {m} a) (p-monotonic1 L p C {m} lt ) +p-monotonic : (L p : HOD ) (C : CountableModel ) → {n m : ℕ} → n ≤ m → (* (find-p L C n (& p))) ⊆ (* (find-p L C m (& p))) +p-monotonic L p C {zero} {zero} n≤m = refl-⊆ {* (find-p L C zero (& p))} +p-monotonic L p C {zero} {suc m} z≤n lt = p-monotonic1 L p C {m} (p-monotonic L p C {zero} {m} z≤n lt ) +p-monotonic L p C {suc n} {suc m} (s≤s n≤m) with <-cmp n m +... | tri< a ¬b ¬c = λ lt → p-monotonic1 L p C {m} (p-monotonic L p C {suc n} {m} a lt) ... | tri≈ ¬a refl ¬c = λ x → x ... | tri> ¬a ¬b c = ⊥-elim ( nat-≤> n≤m c ) -record Dense {L P : HOD } (LP : L ⊆ Power P) : Set (suc n) where +record Dense {L P : HOD } (LP : L ⊆ Power P) : Set (Level.suc n) where field dense : HOD d⊆P : dense ⊆ L @@ -152,7 +163,7 @@ dense-d : { p : HOD} → (lt : L ∋ p) → dense ∋ dense-f lt dense-p : { p : HOD} → (lt : L ∋ p) → (dense-f lt) ⊆ p -record GenericFilter {L P : HOD} (LP : L ⊆ Power P) (M : HOD) : Set (suc n) where +record GenericFilter {L P : HOD} (LP : L ⊆ Power P) (M : HOD) : Set (Level.suc n) where field genf : Filter {L} {P} LP generic : (D : Dense {L} {P} LP ) → M ∋ Dense.dense D → ¬ ( (Dense.dense D ∩ Replace (Filter.filter genf) (λ x → P \ x )) ≡ od∅ ) @@ -172,16 +183,77 @@ f⊆PL lt = x∈PP lt gf01 : Replace (PDHOD L p0 C) (λ x → P \ x) ⊆ L gf01 {x} record { z = z ; az = az ; x=ψz = x=ψz } = subst (λ k → odef L k) (sym x=ψz) ( NEG (subst (λ k → odef L k) (sym &iso) (f⊆PL az)) ) + gf141 : {xp xq : Ordinal } → (Pp : PDN L p0 C xp) (Pq : PDN L p0 C xq) → (* xp ∪ * xq) ⊆ P + gf141 Pp Pq {x} (case1 xpx) = L⊆PP (PDN.x∈PP Pp) _ xpx + gf141 Pp Pq {x} (case2 xqx) = L⊆PP (PDN.x∈PP Pq) _ xqx + gf121 : {p q : HOD} (gp : GP ∋ p) (gq : GP ∋ q) → p ∩ q ≡ P \ * (& (* (Replaced.z gp) ∪ * (Replaced.z gq))) + gf121 {p} {q} gp gq = begin + p ∩ q ≡⟨ cong₂ (λ j k → j ∩ k ) (sym *iso) (sym *iso) ⟩ + (* (& p)) ∩ (* (& q)) ≡⟨ cong₂ (λ j k → ( * j ) ∩ ( * k)) (Replaced.x=ψz gp) (Replaced.x=ψz gq) ⟩ + * (& (P \ (* xp ))) ∩ (* (& (P \ (* xq )))) ≡⟨ cong₂ (λ j k → j ∩ k ) *iso *iso ⟩ + (P \ (* xp )) ∩ (P \ (* xq )) ≡⟨ gf02 {P} {* xp} {* xq} ⟩ + P \ ((* xp) ∪ (* xq)) ≡⟨ cong (λ k → P \ k) (sym *iso) ⟩ + P \ * (& (* xp ∪ * xq)) ∎ where + open ≡-Reasoning + xp = Replaced.z gp + xq = Replaced.z gq + gf131 : {p q : HOD} (gp : GP ∋ p) (gq : GP ∋ q) → P \ (p ∩ q) ≡ * (Replaced.z gp) ∪ * (Replaced.z gq) + gf131 {p} {q} gp gq = trans (cong (λ k → P \ k) (gf121 gp gq)) + (trans ( L\Lx=x (subst (λ k → k ⊆ P) (sym *iso) (gf141 (Replaced.az gp) (Replaced.az gq))) ) *iso ) + f1 : {p q : HOD} → L ∋ q → PDHOD L p0 C ∋ p → p ⊆ q → PDHOD L p0 C ∋ q f1 {p} {q} L∋q PD∋p p⊆q = ? f2 : {p q : HOD} → GP ∋ p → GP ∋ q → L ∋ (p ∩ q) → GP ∋ (p ∩ q) f2 {p} {q} record { z = xp ; az = Pp ; x=ψz = peq } record { z = xq ; az = Pq ; x=ψz = qeq } L∋pq with <-cmp (gr Pp) (gr Pq) - ... | tri< a ¬b ¬c = ? - ... | tri≈ ¬a eq ¬c = ? - ... | tri> ¬a ¬b c = ? + ... | tri< a ¬b ¬c = record { z = & ( (* xp) ∪ (* xq) ) ; az = gf10 ; x=ψz = cong (&) (gf121 gp gq) } where + gp = record { z = xp ; az = Pp ; x=ψz = peq } + gq = record { z = xq ; az = Pq ; x=ψz = qeq } + gf10 : odef (PDHOD L p0 C) (& (* xp ∪ * xq)) + gf10 = record { gr = PDN.gr Pq ; pn<gr = gf15 ; x∈PP = subst (λ k → odef L k) (cong (&) (gf131 gp gq)) ( NEG L∋pq ) } where + gf16 : gr Pp ≤ gr Pq + gf16 = <to≤ a + gf15 : (y : Ordinal) → odef (* (& (* xp ∪ * xq))) y → odef (* (find-p L C (gr Pq) (& p0))) y + gf15 y gpqy with subst (λ k → odef k y ) *iso gpqy + ... | case1 xpy = p-monotonic L p0 C gf16 (PDN.pn<gr Pp y xpy ) + ... | case2 xqy = PDN.pn<gr Pq _ xqy + ... | tri≈ ¬a refl ¬c = record { z = xp ; az = Pp ; x=ψz = trans (cong (&) gf17) peq } where + gf17 : p ∩ q ≡ p + gf17 = ==→o≡ record { eq→ = proj1 ; eq← = λ {y} px → ⟪ px , ? ⟫ } + ... | tri> ¬a ¬b c = record { z = & ( (* xp) ∪ (* xq) ) ; az = gf10 ; x=ψz = cong (&) (gf121 gp gq ) } where + gp = record { z = xp ; az = Pp ; x=ψz = peq } + gq = record { z = xq ; az = Pq ; x=ψz = qeq } + gf10 : odef (PDHOD L p0 C) (& (* xp ∪ * xq)) + gf10 = record { gr = PDN.gr Pp ; pn<gr = gf15 ; x∈PP = subst (λ k → odef L k) (cong (&) (gf131 gp gq)) ( NEG L∋pq ) } where + gf16 : gr Pq ≤ gr Pp + gf16 = <to≤ c + gf15 : (y : Ordinal) → odef (* (& (* xp ∪ * xq))) y → odef (* (find-p L C (gr Pp) (& p0))) y + gf15 y gpqy with subst (λ k → odef k y ) *iso gpqy + ... | case1 xpy = PDN.pn<gr Pp _ xpy + ... | case2 xqy = p-monotonic L p0 C gf16 (PDN.pn<gr Pq y xqy ) gf00 : Replace (Replace (PDHOD L p0 C) (λ x → P \ x)) (_\_ P) ≡ PDHOD L p0 C - gf00 = ? + gf00 = ==→o≡ record { eq→ = gf20 ; eq← = gf22 } where + gf20 : {x : Ordinal} → odef (Replace (Replace (PDHOD L p0 C) (λ x₁ → P \ x₁)) (_\_ P)) x → PDN L p0 C x + gf20 {x} record { z = z₁ ; az = record { z = z ; az = az ; x=ψz = x=ψz₁ } ; x=ψz = x=ψz } = + subst (λ k → PDN L p0 C k ) (begin + z ≡⟨ sym &iso ⟩ + & (* z) ≡⟨ cong (&) (sym (L\Lx=x gf21 )) ⟩ + & (P \ ( P \ (* z) )) ≡⟨ cong (λ k → & ( P \ k)) (sym *iso) ⟩ + & (P \ (* ( & (P \ (* z ))))) ≡⟨ cong (λ k → & (P \ (* k))) (sym x=ψz₁) ⟩ + & (P \ (* z₁)) ≡⟨ sym x=ψz ⟩ + x ∎ ) az where + open ≡-Reasoning + gf21 : {x : Ordinal } → odef (* z) x → odef P x + gf21 {x} lt = L⊆PP ( PDN.x∈PP az) _ lt + gf22 : {x : Ordinal} → PDN L p0 C x → odef (Replace (Replace (PDHOD L p0 C) (λ x₁ → P \ x₁)) (_\_ P)) x + gf22 {x} pdx = record { z = _ ; az = record { z = _ ; az = pdx ; x=ψz = refl } ; x=ψz = ( begin + x ≡⟨ sym &iso ⟩ + & (* x) ≡⟨ cong (&) (sym (L\Lx=x gf21 )) ⟩ + & (P \ (P \ * x)) ≡⟨ cong (λ k → & ( P \ k)) (sym *iso) ⟩ + & (P \ * (& (P \ * x))) ∎ ) } where + open ≡-Reasoning + gf21 : {z : Ordinal } → odef (* x) z → odef P z + gf21 {z} lt = L⊆PP ( PDN.x∈PP pdx ) z lt fdense : (D : Dense {L} {P} L⊆PP ) → (ctl-M C ) ∋ Dense.dense D → ¬ (Dense.dense D ∩ (PDHOD L p0 C)) ≡ od∅ fdense D MD eq0 = ? where open Dense @@ -189,7 +261,7 @@ open GenericFilter open Filter -record NonAtomic (L a : HOD ) (L∋a : L ∋ a ) : Set (suc (suc n)) where +record NonAtomic (L a : HOD ) (L∋a : L ∋ a ) : Set (Level.suc (Level.suc n)) where field b : HOD 0<b : ¬ o∅ ≡ & b @@ -215,7 +287,7 @@ -- val x G = { val y G | ∃ p → G ∋ p → x ∋ < y , p > } -- -record valR (x : HOD) {P L : HOD} {LP : L ⊆ Power P} (C : CountableModel ) (G : GenericFilter {L} {P} LP (ctl-M C) ) : Set (suc n) where +record valR (x : HOD) {P L : HOD} {LP : L ⊆ Power P} (C : CountableModel ) (G : GenericFilter {L} {P} LP (ctl-M C) ) : Set (Level.suc n) where field valx : HOD