comparison src/zorn.agda @ 938:93a49ffa9183

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 28 Oct 2022 18:37:05 +0900
parents 3a511519bd10
children 187594116449
comparison
equal deleted inserted replaced
937:3a511519bd10 938:93a49ffa9183
276 chain-total : (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal ) 276 chain-total : (A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal )
277 {s s1 a b : Ordinal } ( ca : UChain A f mf ay supf s a ) ( cb : UChain A f mf ay supf s1 b ) → Tri (* a < * b) (* a ≡ * b) (* b < * a ) 277 {s s1 a b : Ordinal } ( ca : UChain A f mf ay supf s a ) ( cb : UChain A f mf ay supf s1 b ) → Tri (* a < * b) (* a ≡ * b) (* b < * a )
278 chain-total A f mf {y} ay supf {xa} {xb} {a} {b} ca cb = ct-ind xa xb ca cb where 278 chain-total A f mf {y} ay supf {xa} {xb} {a} {b} ca cb = ct-ind xa xb ca cb where
279 ct-ind : (xa xb : Ordinal) → {a b : Ordinal} → UChain A f mf ay supf xa a → UChain A f mf ay supf xb b → Tri (* a < * b) (* a ≡ * b) (* b < * a) 279 ct-ind : (xa xb : Ordinal) → {a b : Ordinal} → UChain A f mf ay supf xa a → UChain A f mf ay supf xb b → Tri (* a < * b) (* a ≡ * b) (* b < * a)
280 ct-ind xa xb {a} {b} (ch-init fca) (ch-init fcb) = fcn-cmp y f mf fca fcb 280 ct-ind xa xb {a} {b} (ch-init fca) (ch-init fcb) = fcn-cmp y f mf fca fcb
281 ct-ind xa xb {a} {b} (ch-init fca) (ch-is-sup ub u≤x supb fcb) with ChainP.fcy<sup supb fca 281 ct-ind xa xb {a} {b} (ch-init fca) (ch-is-sup ub u<x supb fcb) with ChainP.fcy<sup supb fca
282 ... | case1 eq with s≤fc (supf ub) f mf fcb 282 ... | case1 eq with s≤fc (supf ub) f mf fcb
283 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 283 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
284 ct00 : * a ≡ * b 284 ct00 : * a ≡ * b
285 ct00 = trans (cong (*) eq) eq1 285 ct00 = trans (cong (*) eq) eq1
286 ... | case2 lt = tri< ct01 (λ eq → <-irr (case1 (sym eq)) ct01) (λ lt → <-irr (case2 ct01) lt) where 286 ... | case2 lt = tri< ct01 (λ eq → <-irr (case1 (sym eq)) ct01) (λ lt → <-irr (case2 ct01) lt) where
287 ct01 : * a < * b 287 ct01 : * a < * b
288 ct01 = subst (λ k → * k < * b ) (sym eq) lt 288 ct01 = subst (λ k → * k < * b ) (sym eq) lt
289 ct-ind xa xb {a} {b} (ch-init fca) (ch-is-sup ub u≤x supb fcb) | case2 lt = tri< ct01 (λ eq → <-irr (case1 (sym eq)) ct01) (λ lt → <-irr (case2 ct01) lt) where 289 ct-ind xa xb {a} {b} (ch-init fca) (ch-is-sup ub u<x supb fcb) | case2 lt = tri< ct01 (λ eq → <-irr (case1 (sym eq)) ct01) (λ lt → <-irr (case2 ct01) lt) where
290 ct00 : * a < * (supf ub) 290 ct00 : * a < * (supf ub)
291 ct00 = lt 291 ct00 = lt
292 ct01 : * a < * b 292 ct01 : * a < * b
293 ct01 with s≤fc (supf ub) f mf fcb 293 ct01 with s≤fc (supf ub) f mf fcb
294 ... | case1 eq = subst (λ k → * a < k ) eq ct00 294 ... | case1 eq = subst (λ k → * a < k ) eq ct00
295 ... | case2 lt = IsStrictPartialOrder.trans POO ct00 lt 295 ... | case2 lt = IsStrictPartialOrder.trans POO ct00 lt
296 ct-ind xa xb {a} {b} (ch-is-sup ua u≤x supa fca) (ch-init fcb) with ChainP.fcy<sup supa fcb 296 ct-ind xa xb {a} {b} (ch-is-sup ua u<x supa fca) (ch-init fcb) with ChainP.fcy<sup supa fcb
297 ... | case1 eq with s≤fc (supf ua) f mf fca 297 ... | case1 eq with s≤fc (supf ua) f mf fca
298 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 298 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
299 ct00 : * a ≡ * b 299 ct00 : * a ≡ * b
300 ct00 = sym (trans (cong (*) eq) eq1 ) 300 ct00 = sym (trans (cong (*) eq) eq1 )
301 ... | case2 lt = tri> (λ lt → <-irr (case2 ct01) lt) (λ eq → <-irr (case1 eq) ct01) ct01 where 301 ... | case2 lt = tri> (λ lt → <-irr (case2 ct01) lt) (λ eq → <-irr (case1 eq) ct01) ct01 where
302 ct01 : * b < * a 302 ct01 : * b < * a
303 ct01 = subst (λ k → * k < * a ) (sym eq) lt 303 ct01 = subst (λ k → * k < * a ) (sym eq) lt
304 ct-ind xa xb {a} {b} (ch-is-sup ua u≤x supa fca) (ch-init fcb) | case2 lt = tri> (λ lt → <-irr (case2 ct01) lt) (λ eq → <-irr (case1 eq) ct01) ct01 where 304 ct-ind xa xb {a} {b} (ch-is-sup ua u<x supa fca) (ch-init fcb) | case2 lt = tri> (λ lt → <-irr (case2 ct01) lt) (λ eq → <-irr (case1 eq) ct01) ct01 where
305 ct00 : * b < * (supf ua) 305 ct00 : * b < * (supf ua)
306 ct00 = lt 306 ct00 = lt
307 ct01 : * b < * a 307 ct01 : * b < * a
308 ct01 with s≤fc (supf ua) f mf fca 308 ct01 with s≤fc (supf ua) f mf fca
309 ... | case1 eq = subst (λ k → * b < k ) eq ct00 309 ... | case1 eq = subst (λ k → * b < k ) eq ct00
422 422
423 chain∋init : odef chain y 423 chain∋init : odef chain y
424 chain∋init = ⟪ ay , ch-init (init ay refl) ⟫ 424 chain∋init = ⟪ ay , ch-init (init ay refl) ⟫
425 f-next : {a z : Ordinal} → odef (UnionCF A f mf ay supf z) a → odef (UnionCF A f mf ay supf z) (f a) 425 f-next : {a z : Ordinal} → odef (UnionCF A f mf ay supf z) a → odef (UnionCF A f mf ay supf z) (f a)
426 f-next {a} ⟪ aa , ch-init fc ⟫ = ⟪ proj2 (mf a aa) , ch-init (fsuc _ fc) ⟫ 426 f-next {a} ⟪ aa , ch-init fc ⟫ = ⟪ proj2 (mf a aa) , ch-init (fsuc _ fc) ⟫
427 f-next {a} ⟪ aa , ch-is-sup u u≤x is-sup fc ⟫ = ⟪ proj2 (mf a aa) , ch-is-sup u u≤x is-sup (fsuc _ fc ) ⟫ 427 f-next {a} ⟪ aa , ch-is-sup u u<x is-sup fc ⟫ = ⟪ proj2 (mf a aa) , ch-is-sup u u<x is-sup (fsuc _ fc ) ⟫
428 initial : {z : Ordinal } → odef chain z → * y ≤ * z 428 initial : {z : Ordinal } → odef chain z → * y ≤ * z
429 initial {a} ⟪ aa , ua ⟫ with ua 429 initial {a} ⟪ aa , ua ⟫ with ua
430 ... | ch-init fc = s≤fc y f mf fc 430 ... | ch-init fc = s≤fc y f mf fc
431 ... | ch-is-sup u u≤x is-sup fc = ≤-ftrans (<=to≤ zc7) (s≤fc _ f mf fc) where 431 ... | ch-is-sup u u<x is-sup fc = ≤-ftrans (<=to≤ zc7) (s≤fc _ f mf fc) where
432 zc7 : y <= supf u 432 zc7 : y <= supf u
433 zc7 = ChainP.fcy<sup is-sup (init ay refl) 433 zc7 = ChainP.fcy<sup is-sup (init ay refl)
434 f-total : IsTotalOrderSet chain 434 f-total : IsTotalOrderSet chain
435 f-total {a} {b} ca cb = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where 435 f-total {a} {b} ca cb = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where
436 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 436 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
588 is-max-hp : (x : Ordinal) {a : Ordinal} {b : Ordinal} → odef (UnionCF A f mf ay (ZChain.supf zc) x) a → (ab : odef A b) 588 is-max-hp : (x : Ordinal) {a : Ordinal} {b : Ordinal} → odef (UnionCF A f mf ay (ZChain.supf zc) x) a → (ab : odef A b)
589 → HasPrev A (UnionCF A f mf ay (ZChain.supf zc) x) b f 589 → HasPrev A (UnionCF A f mf ay (ZChain.supf zc) x) b f
590 → * a < * b → odef (UnionCF A f mf ay (ZChain.supf zc) x) b 590 → * a < * b → odef (UnionCF A f mf ay (ZChain.supf zc) x) b
591 is-max-hp x {a} {b} ua ab has-prev a<b with HasPrev.ay has-prev 591 is-max-hp x {a} {b} ua ab has-prev a<b with HasPrev.ay has-prev
592 ... | ⟪ ab0 , ch-init fc ⟫ = ⟪ ab , ch-init ( subst (λ k → FClosure A f y k) (sym (HasPrev.x=fy has-prev)) (fsuc _ fc )) ⟫ 592 ... | ⟪ ab0 , ch-init fc ⟫ = ⟪ ab , ch-init ( subst (λ k → FClosure A f y k) (sym (HasPrev.x=fy has-prev)) (fsuc _ fc )) ⟫
593 ... | ⟪ ab0 , ch-is-sup u u≤x is-sup fc ⟫ = ⟪ ab , subst (λ k → UChain A f mf ay (ZChain.supf zc) x k ) 593 ... | ⟪ ab0 , ch-is-sup u u<x is-sup fc ⟫ = ⟪ ab , subst (λ k → UChain A f mf ay (ZChain.supf zc) x k )
594 (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u u≤x is-sup (fsuc _ fc)) ⟫ 594 (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u u<x is-sup (fsuc _ fc)) ⟫
595 595
596 supf = ZChain.supf zc 596 supf = ZChain.supf zc
597 597
598 csupf-fc : {b s z1 : Ordinal} → b o< & A → supf s o< supf b → FClosure A f (supf s) z1 → UnionCF A f mf ay supf b ∋ * z1 598 csupf-fc : {b s z1 : Ordinal} → b o< & A → supf s o< supf b → FClosure A f (supf s) z1 → UnionCF A f mf ay supf b ∋ * z1
599 csupf-fc {b} {s} {z1} b<z ss<sb (init x refl ) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc05 where 599 csupf-fc {b} {s} {z1} b<z ss<sb (init x refl ) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc05 where
604 zc04 : odef (UnionCF A f mf ay supf (& A)) (supf s) 604 zc04 : odef (UnionCF A f mf ay supf (& A)) (supf s)
605 zc04 = ZChain.csupf zc (z09 (ZChain.asupf zc)) 605 zc04 = ZChain.csupf zc (z09 (ZChain.asupf zc))
606 zc05 : odef (UnionCF A f mf ay supf b) (supf s) 606 zc05 : odef (UnionCF A f mf ay supf b) (supf s)
607 zc05 with zc04 607 zc05 with zc04
608 ... | ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫ 608 ... | ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫
609 ... | ⟪ as , ch-is-sup u u≤x is-sup fc ⟫ = ⟪ as , ch-is-sup u zc08 is-sup fc ⟫ where 609 ... | ⟪ as , ch-is-sup u u<x is-sup fc ⟫ = ⟪ as , ch-is-sup u zc08 is-sup fc ⟫ where
610 zc07 : FClosure A f (supf u) (supf s) -- supf u ≤ supf s → supf u o≤ supf s 610 zc07 : FClosure A f (supf u) (supf s) -- supf u ≤ supf s → supf u o≤ supf s
611 zc07 = fc 611 zc07 = fc
612 zc06 : supf u ≡ u 612 zc06 : supf u ≡ u
613 zc06 = ChainP.supu=u is-sup 613 zc06 = ChainP.supu=u is-sup
614 zc08 : supf u o< supf b 614 zc08 : supf u o< supf b
615 zc08 = ordtrans≤-< (ZChain.supf-<= zc (≤to<= ( s≤fc _ f mf fc ))) ss<sb 615 zc08 = ordtrans≤-< (ZChain.supf-<= zc (≤to<= ( s≤fc _ f mf fc ))) ss<sb
616 csupf-fc {b} {s} {z1} b<z ss≤sb (fsuc x fc) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc04 where 616 csupf-fc {b} {s} {z1} b<z ss≤sb (fsuc x fc) = subst (λ k → odef (UnionCF A f mf ay supf b) k ) (sym &iso) zc04 where
617 zc04 : odef (UnionCF A f mf ay supf b) (f x) 617 zc04 : odef (UnionCF A f mf ay supf b) (f x)
618 zc04 with subst (λ k → odef (UnionCF A f mf ay supf b) k ) &iso (csupf-fc b<z ss≤sb fc ) 618 zc04 with subst (λ k → odef (UnionCF A f mf ay supf b) k ) &iso (csupf-fc b<z ss≤sb fc )
619 ... | ⟪ as , ch-init fc ⟫ = ⟪ proj2 (mf _ as) , ch-init (fsuc _ fc) ⟫ 619 ... | ⟪ as , ch-init fc ⟫ = ⟪ proj2 (mf _ as) , ch-init (fsuc _ fc) ⟫
620 ... | ⟪ as , ch-is-sup u u≤x is-sup fc ⟫ = ⟪ proj2 (mf _ as) , ch-is-sup u u≤x is-sup (fsuc _ fc) ⟫ 620 ... | ⟪ as , ch-is-sup u u<x is-sup fc ⟫ = ⟪ proj2 (mf _ as) , ch-is-sup u u<x is-sup (fsuc _ fc) ⟫
621 order : {b s z1 : Ordinal} → b o< & A → supf s o< supf b → FClosure A f (supf s) z1 → (z1 ≡ supf b) ∨ (z1 << supf b) 621 order : {b s z1 : Ordinal} → b o< & A → supf s o< supf b → FClosure A f (supf s) z1 → (z1 ≡ supf b) ∨ (z1 << supf b)
622 order {b} {s} {z1} b<z ss<sb fc = zc04 where 622 order {b} {s} {z1} b<z ss<sb fc = zc04 where
623 zc00 : ( z1 ≡ MinSUP.sup (ZChain.minsup zc (o<→≤ b<z) )) ∨ ( z1 << MinSUP.sup ( ZChain.minsup zc (o<→≤ b<z) ) ) 623 zc00 : ( z1 ≡ MinSUP.sup (ZChain.minsup zc (o<→≤ b<z) )) ∨ ( z1 << MinSUP.sup ( ZChain.minsup zc (o<→≤ b<z) ) )
624 zc00 = MinSUP.x<sup (ZChain.minsup zc (o<→≤ b<z) ) (subst (λ k → odef (UnionCF A f mf ay (ZChain.supf zc) b) k ) &iso (csupf-fc b<z ss<sb fc )) 624 zc00 = MinSUP.x<sup (ZChain.minsup zc (o<→≤ b<z) ) (subst (λ k → odef (UnionCF A f mf ay (ZChain.supf zc) b) k ) &iso (csupf-fc b<z ss<sb fc ))
625 -- supf (supf b) ≡ supf b 625 -- supf (supf b) ≡ supf b
887 u<x : u o< x 887 u<x : u o< x
888 u<x = ? 888 u<x = ?
889 zc21 : {z1 : Ordinal } → FClosure A f (supf0 u) z1 → odef (UnionCF A f mf ay supf1 x) z1 889 zc21 : {z1 : Ordinal } → FClosure A f (supf0 u) z1 → odef (UnionCF A f mf ay supf1 x) z1
890 zc21 {z1} (fsuc z2 fc ) with zc21 fc 890 zc21 {z1} (fsuc z2 fc ) with zc21 fc
891 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫ 891 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫
892 ... | ⟪ ua1 , ch-is-sup u u≤x u1-is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u≤x u1-is-sup (fsuc _ fc₁) ⟫ 892 ... | ⟪ ua1 , ch-is-sup u u<x u1-is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x u1-is-sup (fsuc _ fc₁) ⟫
893 zc21 (init asp refl ) with trio< u px | inspect supf1 u 893 zc21 (init asp refl ) with trio< u px | inspect supf1 u
894 ... | tri< a ¬b ¬c | _ = ⟪ asp , ch-is-sup u 894 ... | tri< a ¬b ¬c | _ = ⟪ asp , ch-is-sup u
895 ? 895 ?
896 record {fcy<sup = zc13 ; order = zc17 ; supu=u = trans (sf1=sf0 ? ) (ChainP.supu=u is-sup) } zc14 ⟫ where 896 record {fcy<sup = zc13 ; order = zc17 ; supu=u = trans (sf1=sf0 ? ) (ChainP.supu=u is-sup) } zc14 ⟫ where
897 zc17 : {s : Ordinal} {z1 : Ordinal} → supf1 s o< supf1 u → 897 zc17 : {s : Ordinal} {z1 : Ordinal} → supf1 s o< supf1 u →
926 ... | tri> ¬a ¬b c | _ = ⊥-elim ( ¬p<x<op ⟪ c , ? ⟫ ) 926 ... | tri> ¬a ¬b c | _ = ⊥-elim ( ¬p<x<op ⟪ c , ? ⟫ )
927 zc12 {z} (case2 fc) = zc21 fc where 927 zc12 {z} (case2 fc) = zc21 fc where
928 zc21 : {z1 : Ordinal } → FClosure A f (supf0 px) z1 → odef (UnionCF A f mf ay supf1 x) z1 928 zc21 : {z1 : Ordinal } → FClosure A f (supf0 px) z1 → odef (UnionCF A f mf ay supf1 x) z1
929 zc21 {z1} (fsuc z2 fc ) with zc21 fc 929 zc21 {z1} (fsuc z2 fc ) with zc21 fc
930 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫ 930 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫
931 ... | ⟪ ua1 , ch-is-sup u u≤x u1-is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u≤x u1-is-sup (fsuc _ fc₁) ⟫ 931 ... | ⟪ ua1 , ch-is-sup u u<x u1-is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x u1-is-sup (fsuc _ fc₁) ⟫
932 zc21 (init asp refl ) with osuc-≡< ( subst (λ k → supf0 px o< k ) (sym (Oprev.oprev=x op)) sfpx<x ) 932 zc21 (init asp refl ) with osuc-≡< ( subst (λ k → supf0 px o< k ) (sym (Oprev.oprev=x op)) sfpx<x )
933 ... | case1 sfpx=px = ⟪ asp , ch-is-sup px ? -- (pxo<x op) 933 ... | case1 sfpx=px = ⟪ asp , ch-is-sup px ? -- (pxo<x op)
934 record {fcy<sup = zc13 ; order = zc17 ; supu=u = zc15 } zc14 ⟫ where 934 record {fcy<sup = zc13 ; order = zc17 ; supu=u = zc15 } zc14 ⟫ where
935 zc15 : supf1 px ≡ px 935 zc15 : supf1 px ≡ px
936 zc15 = trans (sf1=sf0 o≤-refl ) (sfpx=px) 936 zc15 = trans (sf1=sf0 o≤-refl ) (sfpx=px)
954 csupf17 (init as refl ) = ZChain.csupf zc sf<px 954 csupf17 (init as refl ) = ZChain.csupf zc sf<px
955 csupf17 (fsuc x fc) = ZChain.f-next zc (csupf17 fc) 955 csupf17 (fsuc x fc) = ZChain.f-next zc (csupf17 fc)
956 956
957 ... | case2 sfp<px with ZChain.csupf zc sfp<px -- odef (UnionCF A f mf ay supf0 px) (supf0 px) 957 ... | case2 sfp<px with ZChain.csupf zc sfp<px -- odef (UnionCF A f mf ay supf0 px) (supf0 px)
958 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ ua1 , ch-init fc₁ ⟫ 958 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ ua1 , ch-init fc₁ ⟫
959 ... | ⟪ ua1 , ch-is-sup u u≤x is-sup fc₁ ⟫ = ⟪ ua1 , ch-is-sup u ? 959 ... | ⟪ ua1 , ch-is-sup u u<x is-sup fc₁ ⟫ = ⟪ ua1 , ch-is-sup u ?
960 record { fcy<sup = z10 ; order = z11 ; supu=u = z12 } (fcpu fc₁ ? ) ⟫ where 960 record { fcy<sup = z10 ; order = z11 ; supu=u = z12 } (fcpu fc₁ ? ) ⟫ where
961 z10 : {z : Ordinal } → FClosure A f y z → (z ≡ supf1 u) ∨ ( z << supf1 u ) 961 z10 : {z : Ordinal } → FClosure A f y z → (z ≡ supf1 u) ∨ ( z << supf1 u )
962 z10 {z} fc = subst (λ k → (z ≡ k) ∨ ( z << k )) (sym (sf1=sf0 ? )) (ChainP.fcy<sup is-sup fc) 962 z10 {z} fc = subst (λ k → (z ≡ k) ∨ ( z << k )) (sym (sf1=sf0 ? )) (ChainP.fcy<sup is-sup fc)
963 z11 : {s z1 : Ordinal} → (lt : supf1 s o< supf1 u ) → FClosure A f (supf1 s ) z1 963 z11 : {s z1 : Ordinal} → (lt : supf1 s o< supf1 u ) → FClosure A f (supf1 s ) z1
964 → (z1 ≡ supf1 u ) ∨ ( z1 << supf1 u ) 964 → (z1 ≡ supf1 u ) ∨ ( z1 << supf1 u )
965 z11 {s} {z} lt fc = subst (λ k → (z ≡ k) ∨ ( z << k )) (sym (sf1=sf0 ? )) 965 z11 {s} {z} lt fc = subst (λ k → (z ≡ k) ∨ ( z << k )) (sym (sf1=sf0 ? ))
966 (ChainP.order is-sup lt0 (fcup fc s≤px )) where 966 (ChainP.order is-sup lt0 (fcup fc s≤px )) where
967 s<u : s o< u 967 s<u : s o< u
968 s<u = supf-inject0 supf1-mono lt 968 s<u = supf-inject0 supf1-mono lt
969 s≤px : s o≤ px 969 s≤px : s o≤ px
970 s≤px = ordtrans s<u ? -- (o<→≤ u≤x) 970 s≤px = ordtrans s<u ? -- (o<→≤ u<x)
971 lt0 : supf0 s o< supf0 u 971 lt0 : supf0 s o< supf0 u
972 lt0 = subst₂ (λ j k → j o< k ) (sf1=sf0 s≤px) (sf1=sf0 ? ) lt 972 lt0 = subst₂ (λ j k → j o< k ) (sf1=sf0 s≤px) (sf1=sf0 ? ) lt
973 z12 : supf1 u ≡ u 973 z12 : supf1 u ≡ u
974 z12 = trans (sf1=sf0 ? ) (ChainP.supu=u is-sup) 974 z12 = trans (sf1=sf0 ? ) (ChainP.supu=u is-sup)
975 975
1109 s1u=x = trans ? eq 1109 s1u=x = trans ? eq
1110 zc13 : osuc px o< osuc u1 1110 zc13 : osuc px o< osuc u1
1111 zc13 = o≤-refl0 ( trans (Oprev.oprev=x op) (sym eq ) ) 1111 zc13 = o≤-refl0 ( trans (Oprev.oprev=x op) (sym eq ) )
1112 x<sup : {w : Ordinal} → odef (UnionCF A f mf ay supf0 px) w → (w ≡ x) ∨ (w << x) 1112 x<sup : {w : Ordinal} → odef (UnionCF A f mf ay supf0 px) w → (w ≡ x) ∨ (w << x)
1113 x<sup {w} ⟪ az , ch-init {w} fc ⟫ = subst (λ k → (w ≡ k) ∨ (w << k)) s1u=x ? 1113 x<sup {w} ⟪ az , ch-init {w} fc ⟫ = subst (λ k → (w ≡ k) ∨ (w << k)) s1u=x ?
1114 x<sup {w} ⟪ az , ch-is-sup u u≤x is-sup fc ⟫ with osuc-≡< ( supf-mono (ordtrans (o<→≤ u≤x) ? )) 1114 x<sup {w} ⟪ az , ch-is-sup u u<x is-sup fc ⟫ with osuc-≡< ( supf-mono (ordtrans (o<→≤ u<x) ? ))
1115 ... | case1 eq1 = ⊥-elim ( o<¬≡ zc14 ? ) where 1115 ... | case1 eq1 = ⊥-elim ( o<¬≡ zc14 ? ) where
1116 zc14 : u ≡ osuc px 1116 zc14 : u ≡ osuc px
1117 zc14 = begin 1117 zc14 = begin
1118 u ≡⟨ sym ( ChainP.supu=u is-sup) ⟩ 1118 u ≡⟨ sym ( ChainP.supu=u is-sup) ⟩
1119 supf0 u ≡⟨ ? ⟩ 1119 supf0 u ≡⟨ ? ⟩
1233 b o< x → (ab : odef A b) → 1233 b o< x → (ab : odef A b) →
1234 HasPrev A (UnionCF A f mf ay supf x) b f → 1234 HasPrev A (UnionCF A f mf ay supf x) b f →
1235 * a < * b → odef (UnionCF A f mf ay supf x) b 1235 * a < * b → odef (UnionCF A f mf ay supf x) b
1236 is-max-hp supf x {a} {b} ua b<x ab has-prev a<b with HasPrev.ay has-prev 1236 is-max-hp supf x {a} {b} ua b<x ab has-prev a<b with HasPrev.ay has-prev
1237 ... | ⟪ ab0 , ch-init fc ⟫ = ⟪ ab , ch-init ( subst (λ k → FClosure A f y k) (sym (HasPrev.x=fy has-prev)) (fsuc _ fc )) ⟫ 1237 ... | ⟪ ab0 , ch-init fc ⟫ = ⟪ ab , ch-init ( subst (λ k → FClosure A f y k) (sym (HasPrev.x=fy has-prev)) (fsuc _ fc )) ⟫
1238 ... | ⟪ ab0 , ch-is-sup u u≤x is-sup fc ⟫ = ? -- ⟪ ab , 1238 ... | ⟪ ab0 , ch-is-sup u u<x is-sup fc ⟫ = ? -- ⟪ ab ,
1239 -- subst (λ k → UChain A f mf ay supf x k ) 1239 -- subst (λ k → UChain A f mf ay supf x k )
1240 -- (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u u≤x is-sup (fsuc _ fc)) ⟫ 1240 -- (sym (HasPrev.x=fy has-prev)) ( ch-is-sup u u<x is-sup (fsuc _ fc)) ⟫
1241 1241
1242 zc70 : HasPrev A pchain x f → ¬ xSUP pchain x 1242 zc70 : HasPrev A pchain x f → ¬ xSUP pchain x
1243 zc70 pr xsup = ? 1243 zc70 pr xsup = ?
1244 1244
1245 no-extension : ¬ ( xSUP (UnionCF A f mf ay supf0 x) x ) → ZChain A f mf ay x 1245 no-extension : ¬ ( xSUP (UnionCF A f mf ay supf0 x) x ) → ZChain A f mf ay x
1249 supfu {u} a z = ZChain.supf (pzc (osuc u) (ob<x lim a)) z 1249 supfu {u} a z = ZChain.supf (pzc (osuc u) (ob<x lim a)) z
1250 pchain0=1 : pchain ≡ pchain1 1250 pchain0=1 : pchain ≡ pchain1
1251 pchain0=1 = ==→o≡ record { eq→ = zc10 ; eq← = zc11 } where 1251 pchain0=1 = ==→o≡ record { eq→ = zc10 ; eq← = zc11 } where
1252 zc10 : {z : Ordinal} → OD.def (od pchain) z → OD.def (od pchain1) z 1252 zc10 : {z : Ordinal} → OD.def (od pchain) z → OD.def (od pchain1) z
1253 zc10 {z} ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫ 1253 zc10 {z} ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫
1254 zc10 {z} ⟪ az , ch-is-sup u u≤x is-sup fc ⟫ = zc12 fc where 1254 zc10 {z} ⟪ az , ch-is-sup u u<x is-sup fc ⟫ = zc12 fc where
1255 zc12 : {z : Ordinal} → FClosure A f (supf0 u) z → odef pchain1 z 1255 zc12 : {z : Ordinal} → FClosure A f (supf0 u) z → odef pchain1 z
1256 zc12 (fsuc x fc) with zc12 fc 1256 zc12 (fsuc x fc) with zc12 fc
1257 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫ 1257 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫
1258 ... | ⟪ ua1 , ch-is-sup u u≤x is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u≤x is-sup (fsuc _ fc₁) ⟫ 1258 ... | ⟪ ua1 , ch-is-sup u u<x is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x is-sup (fsuc _ fc₁) ⟫
1259 zc12 (init asu su=z ) = ⟪ subst (λ k → odef A k) su=z asu , ch-is-sup u ? ? (init ? ? ) ⟫ 1259 zc12 (init asu su=z ) = ⟪ subst (λ k → odef A k) su=z asu , ch-is-sup u ? ? (init ? ? ) ⟫
1260 zc11 : {z : Ordinal} → OD.def (od pchain1) z → OD.def (od pchain) z 1260 zc11 : {z : Ordinal} → OD.def (od pchain1) z → OD.def (od pchain) z
1261 zc11 {z} ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫ 1261 zc11 {z} ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫
1262 zc11 {z} ⟪ az , ch-is-sup u u≤x is-sup fc ⟫ = zc13 fc where 1262 zc11 {z} ⟪ az , ch-is-sup u u<x is-sup fc ⟫ = zc13 fc where
1263 zc13 : {z : Ordinal} → FClosure A f (supf1 u) z → odef pchain z 1263 zc13 : {z : Ordinal} → FClosure A f (supf1 u) z → odef pchain z
1264 zc13 (fsuc x fc) with zc13 fc 1264 zc13 (fsuc x fc) with zc13 fc
1265 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫ 1265 ... | ⟪ ua1 , ch-init fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫
1266 ... | ⟪ ua1 , ch-is-sup u u≤x is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u≤x is-sup (fsuc _ fc₁) ⟫ 1266 ... | ⟪ ua1 , ch-is-sup u u<x is-sup fc₁ ⟫ = ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x is-sup (fsuc _ fc₁) ⟫
1267 zc13 (init asu su=z ) with trio< u x 1267 zc13 (init asu su=z ) with trio< u x
1268 ... | tri< a ¬b ¬c = ⟪ ? , ch-is-sup u ? ? (init ? ? ) ⟫ 1268 ... | tri< a ¬b ¬c = ⟪ ? , ch-is-sup u ? ? (init ? ? ) ⟫
1269 ... | tri≈ ¬a b ¬c = ? 1269 ... | tri≈ ¬a b ¬c = ?
1270 ... | tri> ¬a ¬b c = ? -- ⊥-elim ( o≤> u≤x c ) 1270 ... | tri> ¬a ¬b c = ? -- ⊥-elim ( o≤> u<x c )
1271 sup : {z : Ordinal} → z o≤ x → SUP A (UnionCF A f mf ay supf1 z) 1271 sup : {z : Ordinal} → z o≤ x → SUP A (UnionCF A f mf ay supf1 z)
1272 sup {z} z≤x with trio< z x 1272 sup {z} z≤x with trio< z x
1273 ... | tri< a ¬b ¬c = SUP⊆ ? (ZChain.sup (pzc (osuc z) {!!}) {!!} ) 1273 ... | tri< a ¬b ¬c = SUP⊆ ? (ZChain.sup (pzc (osuc z) {!!}) {!!} )
1274 ... | tri≈ ¬a b ¬c = {!!} 1274 ... | tri≈ ¬a b ¬c = {!!}
1275 ... | tri> ¬a ¬b x<z = ⊥-elim (o<¬≡ refl (ordtrans<-≤ x<z z≤x )) 1275 ... | tri> ¬a ¬b x<z = ⊥-elim (o<¬≡ refl (ordtrans<-≤ x<z z≤x ))
1467 1467
1468 sc<<d : {mc : Ordinal } → {asc : odef A (supf mc)} → (spd : MinSUP A (uchain (cf nmx) (cf-is-≤-monotonic nmx) asc )) 1468 sc<<d : {mc : Ordinal } → {asc : odef A (supf mc)} → (spd : MinSUP A (uchain (cf nmx) (cf-is-≤-monotonic nmx) asc ))
1469 → supf mc << MinSUP.sup spd 1469 → supf mc << MinSUP.sup spd
1470 sc<<d {mc} {asc} spd = z25 where 1470 sc<<d {mc} {asc} spd = z25 where
1471 d1 : Ordinal 1471 d1 : Ordinal
1472 d1 = MinSUP.sup spd 1472 d1 = MinSUP.sup spd -- supf d1 ≡ d
1473 z24 : (supf mc ≡ d1) ∨ ( supf mc << d1 ) 1473 z24 : (supf mc ≡ d1) ∨ ( supf mc << d1 )
1474 z24 = MinSUP.x<sup spd (init asc refl) 1474 z24 = MinSUP.x<sup spd (init asc refl)
1475 z26 : odef (ZChain.chain zc) (supf mc)
1476 z26 = ?
1477 z28 : supf mc o< & A 1475 z28 : supf mc o< & A
1478 z28 = z09 (ZChain.asupf zc) 1476 z28 = z09 (ZChain.asupf zc)
1479 z25 : supf mc << d1 1477 z25 : supf mc << d1
1480 z25 with z24 1478 z25 with z24
1481 ... | case2 lt = lt 1479 ... | case2 lt = lt
1482 ... | case1 eq = ? where 1480 ... | case1 eq = ⊥-elim ( <-irr z29 (proj1 (cf-is-<-monotonic nmx d1 (MinSUP.asm spd)) ) ) where
1481 -- supf mc ≡ d1
1483 z27 : odef (ZChain.chain zc) (cf nmx d1) 1482 z27 : odef (ZChain.chain zc) (cf nmx d1)
1484 z27 = ZChain.f-next zc (subst (λ k → odef (ZChain.chain zc) k ) eq (ZChain.csupf zc z28)) 1483 z27 = ZChain.f-next zc (subst (λ k → odef (ZChain.chain zc) k ) eq (ZChain.csupf zc z28))
1485 1484 z31 : {z w : Ordinal } → odef (uchain (cf nmx) (cf-is-≤-monotonic nmx) asc) z
1485 → (* w ≡ * z) ∨ (* w < * z)
1486 → (* w ≡ * d1) ∨ (* w < * d1)
1487 z31 {z} uz (case1 w=z) with MinSUP.x<sup spd uz
1488 ... | case1 eq = case1 (trans w=z (cong (*) eq) )
1489 ... | case2 lt = case2 (subst (λ k → k < * d1 ) (sym w=z) lt )
1490 z31 {z} {w} uz (case2 w<z) with MinSUP.x<sup spd uz
1491 ... | case1 eq = case2 (subst (λ k → * w < k ) (cong (*) eq) w<z )
1492 ... | case2 lt = case2 ( IsStrictPartialOrder.trans PO w<z lt)
1493 z29 : (* (cf nmx d1) ≡ * d1) ∨ (* (cf nmx d1) < * d1)
1494 z29 with z27
1495 ... | ⟪ aa , ch-init fc ⟫ = ? where
1496 z30 : FClosure A (cf nmx) (& s) (cf nmx d1)
1497 z30 = fc
1498 ... | ⟪ aa , ch-is-sup u u<x is-sup fc ⟫ with trio< u (supf mc) -- u<x : supf u o< supf (& A)
1499 ... | tri< a ¬b ¬c = ? -- u o< supf mc
1500 ... | tri> ¬a ¬b c = ? -- supf mc o< u
1501 ... | tri≈ ¬a b ¬c with MinSUP.x<sup spd ( subst₂ (λ j k → FClosure A (cf nmx) j k ) (trans (ChainP.supu=u is-sup) b) refl fc )
1502 ... | case1 eq = case1 (cong (*) eq)
1503 ... | case2 lt = case2 lt
1486 sc<sd : {mc d : Ordinal } → supf mc << supf d → supf mc o< supf d 1504 sc<sd : {mc d : Ordinal } → supf mc << supf d → supf mc o< supf d
1487 sc<sd {mc} {d} sc<<sd with osuc-≡< ( ZChain.supf-<= zc (case2 sc<<sd ) ) 1505 sc<sd {mc} {d} sc<<sd with osuc-≡< ( ZChain.supf-<= zc (case2 sc<<sd ) )
1488 ... | case1 eq = ⊥-elim ( <-irr (case1 (cong (*) (sym eq) )) sc<<sd ) 1506 ... | case1 eq = ⊥-elim ( <-irr (case1 (cong (*) (sym eq) )) sc<<sd )
1489 ... | case2 lt = lt 1507 ... | case2 lt = lt
1490 1508