comparison src/zorn.agda @ 785:7472e3dc002b

order done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 01 Aug 2022 18:51:27 +0900
parents d83b0f7ece32
children 1db222b676d8
comparison
equal deleted inserted replaced
784:d83b0f7ece32 785:7472e3dc002b
276 record ChainP (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal) (u z : Ordinal) : Set n where 276 record ChainP (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal) (u z : Ordinal) : Set n where
277 field 277 field
278 fcy<sup : {z : Ordinal } → FClosure A f y z → (z ≡ supf u) ∨ ( z << supf u ) 278 fcy<sup : {z : Ordinal } → FClosure A f y z → (z ≡ supf u) ∨ ( z << supf u )
279 order : {sup1 z1 : Ordinal} → (lt : supf sup1 o< supf u ) → FClosure A f (supf sup1 ) z1 → (z1 ≡ supf u ) ∨ ( z1 << supf u ) 279 order : {sup1 z1 : Ordinal} → (lt : supf sup1 o< supf u ) → FClosure A f (supf sup1 ) z1 → (z1 ≡ supf u ) ∨ ( z1 << supf u )
280 280
281 ChainP-next : (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal )
282 → {x z : Ordinal } → ChainP A f mf ay supf x z → ChainP A f mf ay supf x (f z )
283 ChainP-next A f mf {y} ay supf {x} {z} cp = record { fcy<sup = ChainP.fcy<sup cp ; order = ChainP.order cp }
284
281 -- Union of supf z which o< x 285 -- Union of supf z which o< x
282 -- 286 --
283 287
284 data UChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal } (ay : odef A y ) 288 data UChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal } (ay : odef A y )
285 (supf : Ordinal → Ordinal) (x : Ordinal) : (z : Ordinal) → Set n where 289 (supf : Ordinal → Ordinal) (x : Ordinal) : (z : Ordinal) → Set n where
309 f-total : IsTotalOrderSet chain 313 f-total : IsTotalOrderSet chain
310 314
311 sup : {x : Ordinal } → x o≤ z → SUP A (UnionCF A f mf ay supf x) 315 sup : {x : Ordinal } → x o≤ z → SUP A (UnionCF A f mf ay supf x)
312 supf-is-sup : {x : Ordinal } → (x≤z : x o≤ z) → supf x ≡ & (SUP.sup (sup x≤z) ) 316 supf-is-sup : {x : Ordinal } → (x≤z : x o≤ z) → supf x ≡ & (SUP.sup (sup x≤z) )
313 sup=u : {b : Ordinal} → (ab : odef A b) → b o< z → IsSup A (UnionCF A f mf ay supf (osuc b)) ab → supf b ≡ b 317 sup=u : {b : Ordinal} → (ab : odef A b) → b o< z → IsSup A (UnionCF A f mf ay supf (osuc b)) ab → supf b ≡ b
314 csupf : {b : Ordinal } → b o≤ z → odef (UnionCF A f mf ay supf b) (supf b) 318 csupf : {b : Ordinal } → b o≤ z → odef (UnionCF A f mf ay supf b) (supf b)
315 csupf = ? 319 supf-mono : {x y : Ordinal } → x o< y → supf x o≤ supf y
316 fcy<sup : {u w : Ordinal } → u o< z → FClosure A f y w → (w ≡ supf u ) ∨ ( w << supf u ) -- different from order because y o< supf 320 fcy<sup : {u w : Ordinal } → u o< z → FClosure A f y w → (w ≡ supf u ) ∨ ( w << supf u ) -- different from order because y o< supf
317 fcy<sup {u} {w} u<z fc with SUP.x<sup (sup (o<→≤ u<z)) ⟪ subst (λ k → odef A k ) (sym &iso) (A∋fc {A} y f mf fc) , ? ⟫ 321 fcy<sup {u} {w} u<z fc with SUP.x<sup (sup (o<→≤ u<z)) ⟪ subst (λ k → odef A k ) (sym &iso) (A∋fc {A} y f mf fc)
318 ... | case1 eq = ? 322 , ch-init (subst (λ k → FClosure A f y k) (sym &iso) fc ) ⟫
319 ... | case2 lt = ? 323 ... | case1 eq = case1 (subst (λ k → k ≡ supf u ) &iso (trans (cong (&) eq) (sym (supf-is-sup (o<→≤ u<z) ) ) ))
324 ... | case2 lt = case2 (subst (λ k → * w < k ) (subst (λ k → k ≡ _ ) *iso (cong (*) (sym (supf-is-sup (o<→≤ u<z) ))) ) lt )
320 order : {b s z1 : Ordinal} → b o< z → supf s o< supf b → FClosure A f (supf s) z1 → (z1 ≡ supf b) ∨ (z1 << supf b) 325 order : {b s z1 : Ordinal} → b o< z → supf s o< supf b → FClosure A f (supf s) z1 → (z1 ≡ supf b) ∨ (z1 << supf b)
321 order {b} {s} {.(f x)} b<z sf<sb (fsuc x fc) with proj1 (mf x (A∋fc _ f mf fc)) | order b<z sf<sb fc 326 order {b} {s} {z1} b<z sf<sb fc = zc04 where
322 ... | case1 eq | t = ? 327 zc01 : {z1 : Ordinal } → FClosure A f (supf s) z1 → UnionCF A f mf ay supf b ∋ * z1
323 ... | case2 lt | t = ? 328 zc01 (init x refl ) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc03 where
324 order {b} {s} {z1} b<z sf<sb (init x refl) = ? where 329 s<z : s o< z
325 zc01 : s o≤ z 330 s<z with trio< s z
326 zc01 = ? 331 ... | tri< a ¬b ¬c = a
327 zc00 : ( * (supf s) ≡ SUP.sup (sup (o<→≤ b<z ))) ∨ ( * (supf s) < SUP.sup ( sup (o<→≤ b<z )) ) 332 ... | tri≈ ¬a b ¬c = ⊥-elim ( o<¬≡ (cong supf b) (ordtrans<-≤ sf<sb (supf-mono b<z) ))
328 zc00 with csupf zc01 333 ... | tri> ¬a ¬b c with osuc-≡< ( supf-mono c )
329 ... | ⟪ ss , ch-init fc ⟫ = SUP.x<sup (sup (o<→≤ b<z)) ⟪ ? , ch-init ? ⟫ 334 ... | case1 eq = ⊥-elim ( o<¬≡ (sym eq) (ordtrans<-≤ sf<sb (supf-mono b<z) ))
330 ... | ⟪ ss , ch-is-sup us is-sup fc ⟫ = SUP.x<sup (sup (o<→≤ b<z)) ⟪ ? , ch-is-sup us ? ? ⟫ 335 ... | case2 lt = ⊥-elim ( o<> lt (ordtrans<-≤ sf<sb (supf-mono b<z) ))
336 zc03 : odef (UnionCF A f mf ay supf b) (supf s)
337 zc03 with csupf (o<→≤ s<z)
338 ... | ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫
339 ... | ⟪ as , ch-is-sup u is-sup fc ⟫ = ⟪ as , ch-is-sup u is-sup fc ⟫
340 zc01 (fsuc x fc) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc04 where
341 zc04 : odef (UnionCF A f mf ay supf b) (f x)
342 zc04 with subst (λ k → odef (UnionCF A f mf ay supf b) k ) &iso (zc01 fc )
343 ... | ⟪ as , ch-init fc ⟫ = ⟪ proj2 (mf _ as) , ch-init (fsuc _ fc) ⟫
344 ... | ⟪ as , ch-is-sup u is-sup fc ⟫ = ⟪ proj2 (mf _ as) , ch-is-sup u (ChainP-next A f mf ay _ is-sup ) (fsuc _ fc) ⟫
345 zc00 : ( * z1 ≡ SUP.sup (sup (o<→≤ b<z ))) ∨ ( * z1 < SUP.sup ( sup (o<→≤ b<z )) )
346 zc00 = SUP.x<sup (sup (o<→≤ b<z)) (zc01 fc )
347 zc04 : (z1 ≡ supf b) ∨ (z1 << supf b)
348 zc04 with zc00
349 ... | case1 eq = case1 (subst₂ (λ j k → j ≡ k ) &iso (sym (supf-is-sup (o<→≤ b<z )) ) (cong (&) eq) )
350 ... | case2 lt = case2 (subst₂ (λ j k → j < k ) refl (subst₂ (λ j k → j ≡ k ) *iso refl (cong (*) (sym (supf-is-sup (o<→≤ b<z )) ))) lt )
331 351
332 352
333 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) 353 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f)
334 {y : Ordinal} (ay : odef A y) (zc : ZChain A f mf ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where 354 {y : Ordinal} (ay : odef A y) (zc : ZChain A f mf ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where
335 field 355 field
415 ... | case2 lt = IsStrictPartialOrder.trans POO ct05 lt 435 ... | case2 lt = IsStrictPartialOrder.trans POO ct05 lt
416 436
417 init-uchain : (A : HOD) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal } → (ay : odef A y ) 437 init-uchain : (A : HOD) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal } → (ay : odef A y )
418 { supf : Ordinal → Ordinal } { x : Ordinal } → odef (UnionCF A f mf ay supf x) y 438 { supf : Ordinal → Ordinal } { x : Ordinal } → odef (UnionCF A f mf ay supf x) y
419 init-uchain A f mf ay = ⟪ ay , ch-init (init ay refl) ⟫ 439 init-uchain A f mf ay = ⟪ ay , ch-init (init ay refl) ⟫
420
421 ChainP-next : (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal )
422 → {x z : Ordinal } → ChainP A f mf ay supf x z → ChainP A f mf ay supf x (f z )
423 ChainP-next A f mf {y} ay supf {x} {z} cp = record { fcy<sup = ChainP.fcy<sup cp ; order = ChainP.order cp }
424 440
425 Zorn-lemma : { A : HOD } 441 Zorn-lemma : { A : HOD }
426 → o∅ o< & A 442 → o∅ o< & A
427 → ( ( B : HOD) → (B⊆A : B ⊆' A) → IsTotalOrderSet B → SUP A B ) -- SUP condition 443 → ( ( B : HOD) → (B⊆A : B ⊆' A) → IsTotalOrderSet B → SUP A B ) -- SUP condition
428 → Maximal A 444 → Maximal A
648 → SUP A (uchain f mf ay) 664 → SUP A (uchain f mf ay)
649 ysup f mf {y} ay = supP (uchain f mf ay) (λ lt → A∋fc y f mf lt) (utotal f mf ay) 665 ysup f mf {y} ay = supP (uchain f mf ay) (λ lt → A∋fc y f mf lt) (utotal f mf ay)
650 666
651 inititalChain : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → ZChain A f mf ay o∅ 667 inititalChain : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → ZChain A f mf ay o∅
652 inititalChain f mf {y} ay = record { supf = isupf ; chain⊆A = λ lt → proj1 lt ; chain∋init = cy 668 inititalChain f mf {y} ay = record { supf = isupf ; chain⊆A = λ lt → proj1 lt ; chain∋init = cy
653 ; csupf = λ z → csupf z ; fcy<sup = λ u<0 → ⊥-elim ( ¬x<0 u<0 ) ; supf-mono = λ _ → o≤-refl 669 ; initial = isy ; f-next = inext ; f-total = itotal ; sup=u = λ _ b<0 → ⊥-elim (¬x<0 b<0) } where
654 ; initial = isy ; f-next = inext ; f-total = itotal ; sup=u = λ _ b<0 → ⊥-elim (¬x<0 b<0) ; order = λ b<0 → ⊥-elim (¬x<0 b<0) } where
655 spi = & (SUP.sup (ysup f mf ay)) 670 spi = & (SUP.sup (ysup f mf ay))
656 isupf : Ordinal → Ordinal 671 isupf : Ordinal → Ordinal
657 isupf z = spi 672 isupf z = spi
658 sp = ysup f mf ay 673 sp = ysup f mf ay
659 asi = SUP.A∋maximal sp 674 asi = SUP.A∋maximal sp
795 zc20 {z} z=x with trio< z x | inspect psupf z 810 zc20 {z} z=x with trio< z x | inspect psupf z
796 ... | tri< a ¬b ¬c | _ = ⊥-elim ( ¬b z=x) 811 ... | tri< a ¬b ¬c | _ = ⊥-elim ( ¬b z=x)
797 ... | tri≈ ¬a b ¬c | record { eq = eq1 } = subst (λ k → spu ≡ psupf k) b (sym eq1) 812 ... | tri≈ ¬a b ¬c | record { eq = eq1 } = subst (λ k → spu ≡ psupf k) b (sym eq1)
798 ... | tri> ¬a ¬b c | _ = ⊥-elim ( ¬b z=x) 813 ... | tri> ¬a ¬b c | _ = ⊥-elim ( ¬b z=x)
799 814
815 csupf : (z : Ordinal) → odef (UnionCF A f mf ay psupf x) (psupf z)
816 csupf z with trio< z x | inspect psupf z
817 ... | tri< z<x ¬b ¬c | record { eq = eq1 } = zc11 where
818 ozc = pzc (osuc z) (ob<x lim z<x)
819 zc12 : odef A (ZChain.supf ozc z) ∧ UChain A f mf ay (ZChain.supf ozc) (osuc z) (ZChain.supf ozc z)
820 zc12 = ? -- ZChain.csupf ozc ?
821 zc11 : odef A (ZChain.supf ozc z) ∧ UChain A f mf ay psupf x (ZChain.supf ozc z)
822 zc11 = ⟪ az , ch-is-sup z cp1 (subst (λ k → FClosure A f k _) (sym eq1) (init az refl) ) ⟫ where
823 az : odef A ( ZChain.supf ozc z )
824 az = proj1 zc12
825 zc20 : {z1 : Ordinal} → FClosure A f y z1 → (z1 ≡ psupf z) ∨ (z1 << psupf z)
826 zc20 {z1} fc with ZChain.fcy<sup ozc <-osuc fc
827 ... | case1 eq = case1 (trans eq (sym eq1) )
828 ... | case2 lt = case2 (subst ( λ k → z1 << k ) (sym eq1) lt)
829 cp1 : ChainP A f mf ay psupf z (ZChain.supf ozc z)
830 cp1 = record { fcy<sup = zc20 ; order = ? }
831 --- u = supf u = supf z
832 ... | tri≈ ¬a b ¬c | record { eq = eq1 } = ⟪ sa , ch-is-sup {!!} {!!} {!!} ⟫ where
833 sa = SUP.A∋maximal usup
834 ... | tri> ¬a ¬b c | record { eq = eq1 } = {!!}
800 835
801 fcy<sup : {u w : Ordinal} → u o< x → FClosure A f y w → (w ≡ psupf u) ∨ (w << psupf u) 836 fcy<sup : {u w : Ordinal} → u o< x → FClosure A f y w → (w ≡ psupf u) ∨ (w << psupf u)
802 fcy<sup {u} {w} u<x fc with trio< u x 837 fcy<sup {u} {w} u<x fc with trio< u x
803 ... | tri< a ¬b ¬c = ZChain.fcy<sup uzc <-osuc fc where 838 ... | tri< a ¬b ¬c = ZChain.fcy<sup uzc <-osuc fc where
804 uzc = pzc (osuc u) (ob<x lim a) 839 uzc = pzc (osuc u) (ob<x lim a)
836 subst (λ k → UChain A f mf ay supf x k ) 871 subst (λ k → UChain A f mf ay supf x k )
837 (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u (ChainP-next A f mf ay _ is-sup) (fsuc _ fc)) ⟫ 872 (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u (ChainP-next A f mf ay _ is-sup) (fsuc _ fc)) ⟫
838 873
839 no-extension : ZChain A f mf ay x 874 no-extension : ZChain A f mf ay x
840 no-extension = record { initial = pinit ; chain∋init = pcy ; supf = psupf ; sup=u = {!!} 875 no-extension = record { initial = pinit ; chain∋init = pcy ; supf = psupf ; sup=u = {!!}
841 ; supf-mono = {!!} ; chain⊆A = pchain⊆A ; f-next = pnext ; f-total = ptotal } 876 ; chain⊆A = pchain⊆A ; f-next = pnext ; f-total = ptotal }
842 zc5 : ZChain A f mf ay x 877 zc5 : ZChain A f mf ay x
843 zc5 with ODC.∋-p O A (* x) 878 zc5 with ODC.∋-p O A (* x)
844 ... | no noax = no-extension -- ¬ A ∋ p, just skip 879 ... | no noax = no-extension -- ¬ A ∋ p, just skip
845 ... | yes ax with ODC.p∨¬p O ( HasPrev A pchain ax f ) 880 ... | yes ax with ODC.p∨¬p O ( HasPrev A pchain ax f )
846 -- we have to check adding x preserve is-max ZChain A y f mf x 881 -- we have to check adding x preserve is-max ZChain A y f mf x
847 ... | case1 pr = no-extension 882 ... | case1 pr = no-extension
848 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A pchain ax ) 883 ... | case2 ¬fy<x with ODC.p∨¬p O (IsSup A pchain ax )
849 ... | case1 is-sup = record { initial = {!!} ; chain∋init = {!!} ; supf = psupf1 ; csupf = {!!} ; sup=u = {!!} ; order = {!!} ; fcy<sup = {!!} 884 ... | case1 is-sup = record { initial = {!!} ; chain∋init = {!!} ; supf = psupf1 ; sup=u = {!!}
850 ; supf-mono = {!!} ; chain⊆A = {!!} ; f-next = {!!} ; f-total = {!!} } where -- x is a sup of (zc ?) 885 ; chain⊆A = {!!} ; f-next = {!!} ; f-total = {!!} } where -- x is a sup of (zc ?)
851 psupf1 : Ordinal → Ordinal 886 psupf1 : Ordinal → Ordinal
852 psupf1 z with trio< z x 887 psupf1 z with trio< z x
853 ... | tri< a ¬b ¬c = ZChain.supf (pzc z a) z 888 ... | tri< a ¬b ¬c = ZChain.supf (pzc z a) z
854 ... | tri≈ ¬a b ¬c = x 889 ... | tri≈ ¬a b ¬c = x
855 ... | tri> ¬a ¬b c = x 890 ... | tri> ¬a ¬b c = x