comparison src/zorn.agda @ 761:9307f895891c

edge case done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 Jul 2022 08:29:15 +0900
parents 0dc7999b1d50
children eb68d0870cc6
comparison
equal deleted inserted replaced
760:0dc7999b1d50 761:9307f895891c
292 initial : {y : Ordinal } → odef chain y → * init ≤ * y 292 initial : {y : Ordinal } → odef chain y → * init ≤ * y
293 f-next : {a : Ordinal } → odef chain a → odef chain (f a) 293 f-next : {a : Ordinal } → odef chain a → odef chain (f a)
294 f-total : IsTotalOrderSet chain 294 f-total : IsTotalOrderSet chain
295 295
296 csupf : {z : Ordinal } → odef chain (supf z) 296 csupf : {z : Ordinal } → odef chain (supf z)
297 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 297 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
298 fcy<sup : {u w : Ordinal } → u o< z → FClosure A f init w → w << supf u -- different from order because y o< supf 298 fcy<sup : {u w : Ordinal } → u o< z → FClosure A f init w → w << supf u -- different from order because y o< supf
299 order : {b sup1 z1 : Ordinal} → b o< z → sup1 o≤ b → FClosure A f (supf sup1) z1 → z1 << supf b 299 order : {b sup1 z1 : Ordinal} → b o< z → sup1 o< b → FClosure A f (supf sup1) z1 → z1 << supf b
300 300
301 301
302 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) 302 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f)
303 {init : Ordinal} (ay : odef A init) (zc : ZChain A f mf ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where 303 {init : Ordinal} (ay : odef A init) (zc : ZChain A f mf ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where
304 field 304 field
467 px<x = subst (λ k → px o< k ) (Oprev.oprev=x op) <-osuc 467 px<x = subst (λ k → px o< k ) (Oprev.oprev=x op) <-osuc
468 m01 : odef (UnionCF A f mf ay (ZChain.supf zc) x) b 468 m01 : odef (UnionCF A f mf ay (ZChain.supf zc) x) b
469 m01 with trio< b px --- px < b < x 469 m01 with trio< b px --- px < b < x
470 ... | tri> ¬a ¬b c = ⊥-elim (¬p<x<op ⟪ c , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫) 470 ... | tri> ¬a ¬b c = ⊥-elim (¬p<x<op ⟪ c , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫)
471 ... | tri< b<px ¬b ¬c = chain-mono2 x ( o<→≤ (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc )) o≤-refl m04 where 471 ... | tri< b<px ¬b ¬c = chain-mono2 x ( o<→≤ (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc )) o≤-refl m04 where
472 m03 : odef (UnionCF A f mf ay (ZChain.supf zc) px) a 472 m03 : odef (UnionCF A f mf ay (ZChain.supf zc) px) a -- if a ∈ chain of px, is-max of px can be used
473 m03 with proj2 ua 473 m03 with proj2 ua
474 ... | ch-init fc = ⟪ proj1 ua , ch-init fc ⟫ 474 ... | ch-init fc = ⟪ proj1 ua , ch-init fc ⟫
475 ... | ch-is-sup u u≤x is-sup fc with trio< u px 475 ... | ch-is-sup u u≤x is-sup-a fc with trio< u px
476 ... | tri< a ¬b ¬c = ⟪ proj1 ua , ch-is-sup u (o<→≤ a) is-sup fc ⟫ -- u o< osuc x 476 ... | tri< a ¬b ¬c = ⟪ proj1 ua , ch-is-sup u (o<→≤ a) is-sup-a fc ⟫ -- u o< osuc x
477 ... | tri≈ ¬a u=px ¬c = ⟪ proj1 ua , ch-is-sup u (o≤-refl0 u=px) is-sup fc ⟫ 477 ... | tri≈ ¬a u=px ¬c = ⟪ proj1 ua , ch-is-sup u (o≤-refl0 u=px) is-sup-a fc ⟫
478 ... | tri> ¬a ¬b c = ? -- u = x → u = sup → (b o< x → b < a ) → ⊥ 478 ... | tri> ¬a ¬b c = ⊥-elim (<-irr u≤a (ptrans a<b b<u) ) where
479 su=u : ZChain.supf zc u ≡ u
480 su=u = ChainP.supfu=u is-sup-a
481 u<A : u o< & A
482 u<A = z09 (subst (λ k → odef A k ) su=u (proj1 (ZChain.csupf zc )))
483 u≤a : (* u ≡ * a) ∨ (u << a)
484 u≤a = s≤fc u f mf (subst (λ k → FClosure A f k a) su=u fc )
485 m07 : osuc b o≤ x
486 m07 = osucc (ordtrans b<px px<x )
487 fcb : FClosure A f (ZChain.supf zc b) b
488 fcb = subst (λ k → FClosure A f k b ) (sym (ZChain.sup=u zc ab (z09 ab)
489 (record {x<sup = λ {z} lt → IsSup.x<sup is-sup (chain-mono2 x m07 o≤-refl lt) } ) )) ( init ab )
490 b<u : b << u
491 b<u = subst (λ k → b << k ) su=u ( ZChain.order zc u<A (ordtrans b<px c) fcb )
479 m04 : odef (UnionCF A f mf ay (ZChain.supf zc) px) b 492 m04 : odef (UnionCF A f mf ay (ZChain.supf zc) px) b
480 m04 = ZChain1.is-max (prev px px<x) m03 b<px ab 493 m04 = ZChain1.is-max (prev px px<x) m03 b<px ab
481 (case2 record {x<sup = λ {z} lt → IsSup.x<sup is-sup (chain-mono2 x ( o<→≤ (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc )) o≤-refl lt) } ) a<b 494 (case2 record {x<sup = λ {z} lt → IsSup.x<sup is-sup (chain-mono2 x ( o<→≤ (subst (λ k → px o< k) (Oprev.oprev=x op) <-osuc )) o≤-refl lt) } ) a<b
482 ... | tri≈ ¬a b=px ¬c = ⟪ ab , ch-is-sup b (o<→≤ b<x) m06 (subst (λ k → FClosure A f k b) m05 (init ab)) ⟫ where 495 ... | tri≈ ¬a b=px ¬c = ⟪ ab , ch-is-sup b (o<→≤ b<x) m06 (subst (λ k → FClosure A f k b) m05 (init ab)) ⟫ where
483 m06 : ChainP A f mf ay (ZChain.supf zc) b b 496 m06 : ChainP A f mf ay (ZChain.supf zc) b b
484 m06 = ? 497 m06 = ?
485 m05 : b ≡ ZChain.supf zc b 498 m05 : b ≡ ZChain.supf zc b
486 m05 = sym ( ZChain.sup=u zc {b} {ab} (z09 ab) 499 m05 = sym ( ZChain.sup=u zc ab (z09 ab)
487 record { x<sup = λ {z} uz → IsSup.x<sup is-sup (chain-mono2 x (osucc b<x) o≤-refl uz ) } ) 500 record { x<sup = λ {z} uz → IsSup.x<sup is-sup (chain-mono2 x (osucc b<x) o≤-refl uz ) } )
488 -- b = px case, u = px u< osuc x
489 ... | no lim = record { is-max = is-max } where 501 ... | no lim = record { is-max = is-max } where
490 is-max : {a : Ordinal} {b : Ordinal} → odef (UnionCF A f mf ay (ZChain.supf zc) x) a → 502 is-max : {a : Ordinal} {b : Ordinal} → odef (UnionCF A f mf ay (ZChain.supf zc) x) a →
491 b o< x → (ab : odef A b) → 503 b o< x → (ab : odef A b) →
492 HasPrev A (UnionCF A f mf ay (ZChain.supf zc) x) ab f ∨ IsSup A (UnionCF A f mf ay (ZChain.supf zc) x) ab → 504 HasPrev A (UnionCF A f mf ay (ZChain.supf zc) x) ab f ∨ IsSup A (UnionCF A f mf ay (ZChain.supf zc) x) ab →
493 * a < * b → odef (UnionCF A f mf ay (ZChain.supf zc) x) b 505 * a < * b → odef (UnionCF A f mf ay (ZChain.supf zc) x) b
499 m09 : b o< & A 511 m09 : b o< & A
500 m09 = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) ab)) 512 m09 = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) ab))
501 m07 : {z : Ordinal} → FClosure A f y z → z << ZChain.supf zc b 513 m07 : {z : Ordinal} → FClosure A f y z → z << ZChain.supf zc b
502 m07 {z} fc = ZChain.fcy<sup zc m09 fc 514 m07 {z} fc = ZChain.fcy<sup zc m09 fc
503 m08 : {sup1 z1 : Ordinal} → sup1 o< b → FClosure A f (ZChain.supf zc sup1) z1 → z1 << ZChain.supf zc b 515 m08 : {sup1 z1 : Ordinal} → sup1 o< b → FClosure A f (ZChain.supf zc sup1) z1 → z1 << ZChain.supf zc b
504 m08 {sup1} {z1} s<b fc = ZChain.order zc m09 (o<→≤ s<b) fc 516 m08 {sup1} {z1} s<b fc = ZChain.order zc m09 s<b fc
505 m05 : b ≡ ZChain.supf zc b 517 m05 : b ≡ ZChain.supf zc b
506 m05 = sym (ZChain.sup=u zc {_} {ab} m09 518 m05 = sym (ZChain.sup=u zc ab m09
507 record { x<sup = λ lt → IsSup.x<sup is-sup (chain-mono2 x (o<→≤ (ob<x lim b<x)) o≤-refl lt )} ) -- ZChain on x 519 record { x<sup = λ lt → IsSup.x<sup is-sup (chain-mono2 x (o<→≤ (ob<x lim b<x)) o≤-refl lt )} ) -- ZChain on x
508 m06 : ChainP A f mf ay (ZChain.supf zc) b b 520 m06 : ChainP A f mf ay (ZChain.supf zc) b b
509 m06 = record { fcy<sup = m07 ; csupz = subst (λ k → FClosure A f k b ) m05 (init ab) ; order = m08 521 m06 = record { fcy<sup = m07 ; csupz = subst (λ k → FClosure A f k b ) m05 (init ab) ; order = m08
510 ; supfu=u = sym m05 } 522 ; supfu=u = sym m05 }
511 m04 : odef (UnionCF A f mf ay (ZChain.supf zc) (osuc b)) b 523 m04 : odef (UnionCF A f mf ay (ZChain.supf zc) (osuc b)) b
588 → SUP A (uchain f mf ay) 600 → SUP A (uchain f mf ay)
589 ysup f mf {y} ay = supP (uchain f mf ay) (λ lt → A∋fc y f mf lt) (utotal f mf ay) 601 ysup f mf {y} ay = supP (uchain f mf ay) (λ lt → A∋fc y f mf lt) (utotal f mf ay)
590 602
591 inititalChain : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → ZChain A f mf ay o∅ 603 inititalChain : ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → ZChain A f mf ay o∅
592 inititalChain f mf {y} ay = record { supf = isupf ; chain⊆A = λ lt → proj1 lt ; chain∋init = cy ; csupf = ? ; fcy<sup = ? 604 inititalChain f mf {y} ay = record { supf = isupf ; chain⊆A = λ lt → proj1 lt ; chain∋init = cy ; csupf = ? ; fcy<sup = ?
593 ; 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 605 ; 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
594 isupf : Ordinal → Ordinal 606 isupf : Ordinal → Ordinal
595 isupf z = & (SUP.sup (ysup f mf ay)) 607 isupf z = & (SUP.sup (ysup f mf ay))
596 cy : odef (UnionCF A f mf ay isupf o∅) y 608 cy : odef (UnionCF A f mf ay isupf o∅) y
597 cy = ⟪ ay , ch-init (init ay) ⟫ 609 cy = ⟪ ay , ch-init (init ay) ⟫
598 y<sup : * y ≤ SUP.sup (ysup f mf ay) 610 y<sup : * y ≤ SUP.sup (ysup f mf ay)