comparison src/zorn.agda @ 1088:125605b5bf47

supf-idem is not so easy
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Dec 2022 16:56:17 +0900
parents 2fa98e3c0fa3
children
comparison
equal deleted inserted replaced
1087:2fa98e3c0fa3 1088:125605b5bf47
340 340
341 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f) 341 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f)
342 {y : Ordinal} (ay : odef A y) ( z : Ordinal ) : Set (Level.suc n) where 342 {y : Ordinal} (ay : odef A y) ( z : Ordinal ) : Set (Level.suc n) where
343 field 343 field
344 supf : Ordinal → Ordinal 344 supf : Ordinal → Ordinal
345
346 cfcs : {a b w : Ordinal } → a o< b → b o≤ z → supf a o< b → FClosure A f (supf a) w → odef (UnionCF A f ay supf b) w
347 order : {a b w : Ordinal } → b o≤ z → supf a o< supf b → FClosure A f (supf a) w → w ≤ supf b
348
345 asupf : {x : Ordinal } → odef A (supf x) 349 asupf : {x : Ordinal } → odef A (supf x)
346
347 supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y 350 supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y
348 zo≤sz : {x : Ordinal } → x o≤ z → x o≤ supf x 351 zo≤sz : {x : Ordinal } → x o≤ z → x o≤ supf x
352
349 is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → IsMinSUP A (UnionCF A f ay supf x) (supf x) 353 is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → IsMinSUP A (UnionCF A f ay supf x) (supf x)
350 cfcs : {a b w : Ordinal } → a o< b → b o≤ z → supf a o< b → FClosure A f (supf a) w → odef (UnionCF A f ay supf b) w
351 supf-idem : {b : Ordinal } → b o≤ z → supf b o≤ z → supf (supf b) ≡ supf b
352 354
353 chain : HOD 355 chain : HOD
354 chain = UnionCF A f ay supf z 356 chain = UnionCF A f ay supf z
355 chain⊆A : chain ⊆' A 357 chain⊆A : chain ⊆' A
356 chain⊆A = λ lt → proj1 lt 358 chain⊆A = λ lt → proj1 lt
395 ... | case2 lt = case2 (subst₂ (λ j k → j << k ) &iso (sym (supf-is-minsup u≤z )) lt ) 397 ... | case2 lt = case2 (subst₂ (λ j k → j << k ) &iso (sym (supf-is-minsup u≤z )) lt )
396 398
397 initial : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) x → y ≤ x 399 initial : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) x → y ≤ x
398 initial {x} x≤z ⟪ aa , ch-init fc ⟫ = s≤fc y f mf fc 400 initial {x} x≤z ⟪ aa , ch-init fc ⟫ = s≤fc y f mf fc
399 initial {x} x≤z ⟪ aa , ch-is-sup u u<x is-sup fc ⟫ = ≤-ftrans (fcy<sup (ordtrans u<x x≤z) (init ay refl)) (s≤fc _ f mf fc) 401 initial {x} x≤z ⟪ aa , ch-is-sup u u<x is-sup fc ⟫ = ≤-ftrans (fcy<sup (ordtrans u<x x≤z) (init ay refl)) (s≤fc _ f mf fc)
400
401 supfeq : {a b : Ordinal } → a o≤ z → b o≤ z → UnionCF A f ay supf a ≡ UnionCF A f ay supf b → supf a ≡ supf b
402 supfeq {a} {b} a≤z b≤z ua=ub with trio< (supf a) (supf b)
403 ... | tri< sa<sb ¬b ¬c = ⊥-elim ( o≤> (
404 IsMinSUP.minsup (is-minsup b≤z) asupf (λ {z} uzb → IsMinSUP.x≤sup (is-minsup a≤z) (subst (λ k → odef k z) (sym ua=ub) uzb)) ) sa<sb )
405 ... | tri≈ ¬a b ¬c = b
406 ... | tri> ¬a ¬b sb<sa = ⊥-elim ( o≤> (
407 IsMinSUP.minsup (is-minsup a≤z) asupf (λ {z} uza → IsMinSUP.x≤sup (is-minsup b≤z) (subst (λ k → odef k z) ua=ub uza)) ) sb<sa )
408
409 union-max : {a b : Ordinal } → z o≤ supf a → b o≤ z → supf a o< supf b → UnionCF A f ay supf a ≡ UnionCF A f ay supf b
410 union-max {a} {b} z≤sa b≤z sa<sb = ==→o≡ record { eq→ = z47 ; eq← = z48 } where
411 z47 : {w : Ordinal } → odef (UnionCF A f ay supf a ) w → odef ( UnionCF A f ay supf b ) w
412 z47 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
413 z47 {w} ⟪ aw , ch-is-sup u u<a su=u fc ⟫ = ⟪ aw , ch-is-sup u u<b su=u fc ⟫ where
414 u<b : u o< b
415 u<b = ordtrans u<a (supf-inject sa<sb )
416 z48 : {w : Ordinal } → odef (UnionCF A f ay supf b ) w → odef ( UnionCF A f ay supf a ) w
417 z48 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
418 z48 {w} ⟪ aw , ch-is-sup u u<b su=u fc ⟫ = ⟪ aw , ch-is-sup u u<a su=u fc ⟫ where
419 u<a : u o< a
420 u<a = supf-inject ( osucprev (begin
421 osuc (supf u) ≡⟨ cong osuc su=u ⟩
422 osuc u ≤⟨ osucc (ordtrans<-≤ u<b b≤z ) ⟩
423 z ≤⟨ z≤sa ⟩
424 supf a ∎ )) where open o≤-Reasoning O
425
426 sup=u : {b : Ordinal} → (ab : odef A b) → b o≤ z
427 → IsSUP A (UnionCF A f ay supf b) b → supf b ≡ b
428 sup=u {b} ab b≤z is-sup = z50 where
429 z48 : supf b o≤ b
430 z48 = IsMinSUP.minsup (is-minsup b≤z) ab (λ ux → IsSUP.x≤sup is-sup ux )
431 z50 : supf b ≡ b
432 z50 with trio< (supf b) b
433 ... | tri< sb<b ¬b ¬c = ⊥-elim ( o≤> z47 sb<b ) where
434 z47 : b o≤ supf b
435 z47 = zo≤sz b≤z
436 ... | tri≈ ¬a b ¬c = b
437 ... | tri> ¬a ¬b b<sb = ⊥-elim ( o≤> z48 b<sb )
438
439 x≤supfx : {x : Ordinal } → x o≤ z → supf x o≤ z → x o≤ supf x
440 x≤supfx {x} x≤z sx≤z with x<y∨y≤x (supf x) x
441 ... | case2 le = le
442 ... | case1 spx<px = ⊥-elim ( <<-irr z45 (proj1 ( mf< (supf x) asupf ))) where
443 z46 : odef (UnionCF A f ay supf x) (f (supf x))
444 z46 = ⟪ proj2 ( mf (supf x) asupf ) , ch-is-sup (supf x) spx<px z47 (fsuc _ (init asupf z47 )) ⟫ where
445 z47 : supf (supf x) ≡ supf x
446 z47 = supf-idem x≤z sx≤z
447 z45 : f (supf x) ≤ supf x
448 z45 = IsMinSUP.x≤sup (is-minsup x≤z ) z46
449
450 order : {a b w : Ordinal } → b o≤ z → supf a o< supf b → FClosure A f (supf a) w → w ≤ supf b
451 order {a} {b} {w} b≤z sa<sb fc with x<y∨y≤x (supf a) z
452 ... | case2 z≤sa = ⊥-elim ( o<¬≡ z27 sa<sb ) where
453 z27 : supf a ≡ supf b
454 z27 = supfeq (OrdTrans (o<→≤ (supf-inject sa<sb)) b≤z) b≤z ( union-max z≤sa b≤z sa<sb)
455 ... | case1 sa<z = IsMinSUP.x≤sup (is-minsup b≤z) (cfcs (supf-inject sa<sb) b≤z sa<b fc) where
456 sa<b : supf a o< b
457 sa<b with x<y∨y≤x (supf a) b
458 ... | case1 lt = lt
459 ... | case2 b≤sa = ⊥-elim ( o≤> b≤sa ( supf-inject ( osucprev ( begin
460 osuc (supf (supf a)) ≡⟨ cong osuc (supf-idem (ordtrans (supf-inject sa<sb) b≤z) (o<→≤ sa<z)) ⟩
461 osuc (supf a) ≤⟨ osucc sa<sb ⟩
462 supf b ∎ )))) where open o≤-Reasoning O
463
464 supf-mono< : {a b : Ordinal } → b o≤ z → supf a o< supf b → supf a << supf b
465 supf-mono< {a} {b} b≤z sa<sb with order {a} {b} b≤z sa<sb (init asupf refl)
466 ... | case2 lt = lt
467 ... | case1 eq = ⊥-elim ( o<¬≡ eq sa<sb )
468 402
469 f-total : IsTotalOrderSet chain 403 f-total : IsTotalOrderSet chain
470 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ = 404 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ =
471 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso fc-total where 405 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso fc-total where
472 fc-total : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 406 fc-total : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
502 b<a = subst₂ (λ j k → j < k ) *iso *iso lt 436 b<a = subst₂ (λ j k → j < k ) *iso *iso lt
503 ft00 : Tri ( a < b) ( a ≡ b) ( b < a ) 437 ft00 : Tri ( a < b) ( a ≡ b) ( b < a )
504 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sua<x) fcb) (s≤fc {A} _ f mf fca)) 438 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sua<x) fcb) (s≤fc {A} _ f mf fca))
505 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-init fcb ⟫ = 439 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-init fcb ⟫ =
506 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp y f mf fca fcb ) 440 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp y f mf fca fcb )
441
442 supf-mono< : {a b : Ordinal } → b o≤ z → supf a o< supf b → supf a << supf b
443 supf-mono< {a} {b} b≤z sa<sb with order {a} {b} b≤z sa<sb (init asupf refl)
444 ... | case2 lt = lt
445 ... | case1 eq = ⊥-elim ( o<¬≡ eq sa<sb )
446
447 supfeq : {a b : Ordinal } → a o≤ z → b o≤ z → UnionCF A f ay supf a ≡ UnionCF A f ay supf b → supf a ≡ supf b
448 supfeq {a} {b} a≤z b≤z ua=ub with trio< (supf a) (supf b)
449 ... | tri< sa<sb ¬b ¬c = ⊥-elim ( o≤> (
450 IsMinSUP.minsup (is-minsup b≤z) asupf (λ {z} uzb → IsMinSUP.x≤sup (is-minsup a≤z) (subst (λ k → odef k z) (sym ua=ub) uzb)) ) sa<sb )
451 ... | tri≈ ¬a b ¬c = b
452 ... | tri> ¬a ¬b sb<sa = ⊥-elim ( o≤> (
453 IsMinSUP.minsup (is-minsup a≤z) asupf (λ {z} uza → IsMinSUP.x≤sup (is-minsup b≤z) (subst (λ k → odef k z) ua=ub uza)) ) sb<sa )
454
455 union-max : {a b : Ordinal } → z o≤ supf a → b o≤ z → supf a o< supf b → UnionCF A f ay supf a ≡ UnionCF A f ay supf b
456 union-max {a} {b} z≤sa b≤z sa<sb = ==→o≡ record { eq→ = z47 ; eq← = z48 } where
457 z47 : {w : Ordinal } → odef (UnionCF A f ay supf a ) w → odef ( UnionCF A f ay supf b ) w
458 z47 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
459 z47 {w} ⟪ aw , ch-is-sup u u<a su=u fc ⟫ = ⟪ aw , ch-is-sup u u<b su=u fc ⟫ where
460 u<b : u o< b
461 u<b = ordtrans u<a (supf-inject sa<sb )
462 z48 : {w : Ordinal } → odef (UnionCF A f ay supf b ) w → odef ( UnionCF A f ay supf a ) w
463 z48 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
464 z48 {w} ⟪ aw , ch-is-sup u u<b su=u fc ⟫ = ⟪ aw , ch-is-sup u u<a su=u fc ⟫ where
465 u<a : u o< a
466 u<a = supf-inject ( osucprev (begin
467 osuc (supf u) ≡⟨ cong osuc su=u ⟩
468 osuc u ≤⟨ osucc (ordtrans<-≤ u<b b≤z ) ⟩
469 z ≤⟨ z≤sa ⟩
470 supf a ∎ )) where open o≤-Reasoning O
471
472 sup=u : {b : Ordinal} → (ab : odef A b) → b o≤ z
473 → IsSUP A (UnionCF A f ay supf b) b → supf b ≡ b
474 sup=u {b} ab b≤z is-sup = z50 where
475 z48 : supf b o≤ b
476 z48 = IsMinSUP.minsup (is-minsup b≤z) ab (λ ux → IsSUP.x≤sup is-sup ux )
477 z50 : supf b ≡ b
478 z50 with trio< (supf b) b
479 ... | tri< sb<b ¬b ¬c = ⊥-elim ( o≤> z47 sb<b ) where
480 z47 : b o≤ supf b
481 z47 = zo≤sz b≤z
482 ... | tri≈ ¬a b ¬c = b
483 ... | tri> ¬a ¬b b<sb = ⊥-elim ( o≤> z48 b<sb )
484
485 supf-idem : {b : Ordinal } → b o≤ z → supf b o≤ z → supf (supf b) ≡ supf b
486 supf-idem {b} b≤z sfb≤x = z52 where
487 z54 : {w : Ordinal} → odef (UnionCF A f ay supf (supf b)) w → (w ≡ supf b) ∨ (w << supf b)
488 z54 {w} ⟪ aw , ch-init fc ⟫ = fcy<sup b≤z fc
489 z54 {w} ⟪ aw , ch-is-sup u u<x su=u fc ⟫ = order b≤z (subst (λ k → k o< supf b) (sym su=u) u<x) fc where
490 u<b : u o< b
491 u<b = supf-inject (subst (λ k → k o< supf b ) (sym (su=u)) u<x )
492 z52 : supf (supf b) ≡ supf b
493 z52 = sup=u asupf sfb≤x record { ax = asupf ; x≤sup = z54 }
494
495 x≤supfx : {x : Ordinal } → x o≤ z → supf x o≤ z → x o≤ supf x
496 x≤supfx {x} x≤z sx≤z with x<y∨y≤x (supf x) x
497 ... | case2 le = le
498 ... | case1 spx<px = ⊥-elim ( <<-irr z45 (proj1 ( mf< (supf x) asupf ))) where
499 z46 : odef (UnionCF A f ay supf x) (f (supf x))
500 z46 = ⟪ proj2 ( mf (supf x) asupf ) , ch-is-sup (supf x) spx<px z47 (fsuc _ (init asupf z47 )) ⟫ where
501 z47 : supf (supf x) ≡ supf x
502 z47 = supf-idem x≤z sx≤z
503 z45 : f (supf x) ≤ supf x
504 z45 = IsMinSUP.x≤sup (is-minsup x≤z ) z46
505
506 -- order may proved is-minsup and supf-idem, but supf-idem uses order
507 -- Is proving supf-idem is easier than order?
508 --
509 order0 : {a b w : Ordinal } → b o≤ z → supf a o< supf b → FClosure A f (supf a) w → w ≤ supf b
510 order0 {a} {b} {w} b≤z sa<sb fc with x<y∨y≤x (supf a) z
511 ... | case2 z≤sa = ⊥-elim ( o<¬≡ z27 sa<sb ) where
512 z27 : supf a ≡ supf b
513 z27 = supfeq (OrdTrans (o<→≤ (supf-inject sa<sb)) b≤z) b≤z ( union-max z≤sa b≤z sa<sb)
514 ... | case1 sa<z = IsMinSUP.x≤sup (is-minsup b≤z) (cfcs (supf-inject sa<sb) b≤z sa<b fc) where
515 sa<b : supf a o< b
516 sa<b with x<y∨y≤x (supf a) b
517 ... | case1 lt = lt
518 ... | case2 b≤sa = ⊥-elim ( o≤> b≤sa ( supf-inject ( osucprev ( begin
519 osuc (supf (supf a)) ≡⟨ cong osuc (supf-idem (ordtrans (supf-inject sa<sb) b≤z) (o<→≤ sa<z)) ⟩
520 osuc (supf a) ≤⟨ osucc sa<sb ⟩
521 supf b ∎ )))) where open o≤-Reasoning O
507 522
508 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f) 523 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f)
509 {y : Ordinal} (ay : odef A y) (zc : ZChain A f mf< ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where 524 {y : Ordinal} (ay : odef A y) (zc : ZChain A f mf< ay (& A)) ( z : Ordinal ) : Set (Level.suc n) where
510 supf = ZChain.supf zc 525 supf = ZChain.supf zc
511 field 526 field
1108 z25 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = sup ⟪ ua , ch-is-sup u u<x 1123 z25 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = sup ⟪ ua , ch-is-sup u u<x
1109 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where 1124 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where
1110 u≤px : u o≤ px 1125 u≤px : u o≤ px
1111 u≤px = ordtrans u<x z≤px 1126 u≤px = ordtrans u<x z≤px
1112 1127
1128 supfeq1 : {a b : Ordinal } → a o≤ x → b o≤ x → UnionCF A f ay supf1 a ≡ UnionCF A f ay supf1 b → supf1 a ≡ supf1 b
1129 supfeq1 {a} {b} a≤z b≤z ua=ub with trio< (supf1 a) (supf1 b)
1130 ... | tri< sa<sb ¬b ¬c = ⊥-elim ( o≤> (
1131 IsMinSUP.minsup (is-minsup b≤z) asupf1 (λ {z} uzb → IsMinSUP.x≤sup (is-minsup a≤z) (subst (λ k → odef k z) (sym ua=ub) uzb)) ) sa<sb )
1132 ... | tri≈ ¬a b ¬c = b
1133 ... | tri> ¬a ¬b sb<sa = ⊥-elim ( o≤> (
1134 IsMinSUP.minsup (is-minsup a≤z) asupf1 (λ {z} uza → IsMinSUP.x≤sup (is-minsup b≤z) (subst (λ k → odef k z) ua=ub uza)) ) sb<sa )
1135
1136 union-max1 : {a b : Ordinal } → x o≤ supf1 a → b o≤ x → supf1 a o< supf1 b → UnionCF A f ay supf1 a ≡ UnionCF A f ay supf1 b
1137 union-max1 {a} {b} z≤sa b≤z sa<sb = ==→o≡ record { eq→ = z47 ; eq← = z48 } where
1138 z47 : {w : Ordinal } → odef (UnionCF A f ay supf1 a ) w → odef ( UnionCF A f ay supf1 b ) w
1139 z47 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
1140 z47 {w} ⟪ aw , ch-is-sup u u<a su=u fc ⟫ = ⟪ aw , ch-is-sup u u<b su=u fc ⟫ where
1141 u<b : u o< b
1142 u<b = ordtrans u<a (supf-inject0 supf1-mono sa<sb )
1143 z48 : {w : Ordinal } → odef (UnionCF A f ay supf1 b ) w → odef ( UnionCF A f ay supf1 a ) w
1144 z48 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
1145 z48 {w} ⟪ aw , ch-is-sup u u<b su=u fc ⟫ = ⟪ aw , ch-is-sup u u<a su=u fc ⟫ where
1146 u<a : u o< a
1147 u<a = supf-inject0 supf1-mono ( osucprev (begin
1148 osuc (supf1 u) ≡⟨ cong osuc su=u ⟩
1149 osuc u ≤⟨ osucc (ordtrans<-≤ u<b b≤z ) ⟩
1150 x ≤⟨ z≤sa ⟩
1151 supf1 a ∎ )) where open o≤-Reasoning O
1152
1153
1113 zo≤sz : {z : Ordinal} → z o≤ x → z o≤ supf1 z 1154 zo≤sz : {z : Ordinal} → z o≤ x → z o≤ supf1 z
1114 zo≤sz {z} z≤x with osuc-≡< z≤x 1155 zo≤sz {z} z≤x with osuc-≡< z≤x
1115 ... | case2 z<x = subst (λ k → z o≤ k) (sym (sf1=sf0 (zc-b<x _ z<x ))) (ZChain.zo≤sz zc (zc-b<x _ z<x )) 1156 ... | case2 z<x = subst (λ k → z o≤ k) (sym (sf1=sf0 (zc-b<x _ z<x ))) (ZChain.zo≤sz zc (zc-b<x _ z<x ))
1116 ... | case1 refl with osuc-≡< (supf1-mono (o<→≤ (px<x))) -- px o≤ supf1 px o≤ supf1 x ≡ sp1 → x o≤ sp1 1157 ... | case1 refl with osuc-≡< (supf1-mono (o<→≤ (px<x))) -- px o≤ supf1 px o≤ supf1 x ≡ sp1 → x o≤ sp1
1117 ... | case2 lt = begin 1158 ... | case2 lt = begin
1138 sp1 ∎ where open ≡-Reasoning 1179 sp1 ∎ where open ≡-Reasoning
1139 zc40 : f (supf0 px) ≤ supf0 px 1180 zc40 : f (supf0 px) ≤ supf0 px
1140 zc40 = subst (λ k → f (supf0 px) ≤ k ) (sym zc39) 1181 zc40 = subst (λ k → f (supf0 px) ≤ k ) (sym zc39)
1141 ( MinSUP.x≤sup sup1 (case2 ⟪ fsuc _ (init (ZChain.asupf zc) refl) , subst (λ k → k o< x) (sym zc37) px<x ⟫ )) 1182 ( MinSUP.x≤sup sup1 (case2 ⟪ fsuc _ (init (ZChain.asupf zc) refl) , subst (λ k → k o< x) (sym zc37) px<x ⟫ ))
1142 1183
1184 order : {a b : Ordinal} {w : Ordinal} →
1185 b o≤ x → supf1 a o< supf1 b → FClosure A f (supf1 a) w → w ≤ supf1 b
1186 order {a} {b} {w} b≤x sa<sb fc = z20 where
1187 a<b : a o< b
1188 a<b = supf-inject0 supf1-mono sa<sb
1189 a≤px : a o≤ px
1190 a≤px with trio< a px
1191 ... | tri< a ¬b ¬c = o<→≤ a
1192 ... | tri≈ ¬a b ¬c = o≤-refl0 b
1193 ... | tri> ¬a ¬b c = ⊥-elim ( ¬p<x<op ⟪ c , subst (λ k → a o< k) (sym (Oprev.oprev=x op))
1194 ( ordtrans<-≤ a<b b≤x) ⟫ ) -- px o< a o< b o≤ x
1195 z20 : w ≤ supf1 b
1196 z20 with trio< b px
1197 ... | tri< b<px ¬b ¬c = ZChain.order zc (o<→≤ b<px) (subst (λ k → k o< supf0 b) (sf1=sf0 (o<→≤ (ordtrans a<b b<px))) sa<sb)
1198 (fcup fc (o<→≤ (ordtrans a<b b<px)))
1199 ... | tri≈ ¬a b=px ¬c = IsMinSUP.x≤sup (ZChain.is-minsup zc (o≤-refl0 b=px)) z26 where
1200 a≤x : a o≤ x
1201 a≤x = o<→≤ (ordtrans ( subst (λ k → a o< k ) b=px a<b ) px<x )
1202 z26 : odef ( UnionCF A f ay supf0 b ) w
1203 z26 with x<y∨y≤x (supf1 a) b
1204 ... | case2 b≤sa = z27 where
1205 z27 : odef (UnionCF A f ay supf0 b) w
1206 z27 with osuc-≡< b≤sa
1207 ... | case2 b<sa = ⊥-elim ( o<¬≡ ( supfeq1 a≤x b≤x
1208 ( union-max1 x≤sa b≤x (subst (λ k → supf1 a o< k) (sym (sf1=sf0 (o≤-refl0 b=px))) sa<sb) ))
1209 (ordtrans<-≤ sa<sb (o≤-refl0 (sym (sf1=sf0 (o≤-refl0 b=px))) ))) where
1210 x≤sa : x o≤ supf1 a
1211 x≤sa = subst (λ k → k o≤ supf1 a ) (trans (cong osuc b=px) (Oprev.oprev=x op)) (osucc b<sa )
1212 ... | case1 b=sa = ⊥-elim (o<¬≡ sa=sb sa<sb) where
1213 sa=sb : supf1 a ≡ supf0 b
1214 sa=sb = begin
1215 supf1 a ≡⟨ sf1=sf0 a≤px ⟩
1216 supf0 a ≡⟨ sym (ZChain.supf-idem zc a≤px (o≤-refl0 (sym (trans (sym b=px) (trans b=sa (sf1=sf0 a≤px) ))))) ⟩
1217 supf0 (supf0 a) ≡⟨ cong supf0 (sym (sf1=sf0 a≤px )) ⟩
1218 supf0 (supf1 a) ≡⟨ cong supf0 (sym b=sa) ⟩
1219 supf0 b ∎ where open ≡-Reasoning
1220 ... | case1 sa<b with cfcs a<b b≤x sa<b fc
1221 ... | ⟪ ua , ch-init fc ⟫ = ⟪ ua , ch-init fc ⟫
1222 ... | ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = ⟪ ua , ch-is-sup u u<x (trans (sym (sf1=sf0 u≤px)) su=u) (fcup fc u≤px) ⟫ where
1223 u≤px : u o≤ px
1224 u≤px = o<→≤ ( subst (λ k → u o< k ) b=px u<x )
1225 ... | tri> ¬a ¬b px<b with x<y∨y≤x (supf1 a) b
1226 ... | case1 sa<b = MinSUP.x≤sup sup1 (zc11 ( chain-mono f mf ay supf1 supf1-mono b≤x (cfcs a<b b≤x sa<b fc)))
1227 ... | case2 b≤sa = ⊥-elim ( o<¬≡ z27 sa<sb ) where -- x=b x o≤ sa UnionCF a ≡ UnionCF b → supf1 a ≡ supfb b → ⊥
1228 b=x : b ≡ x
1229 b=x with trio< b x
1230 ... | tri< a ¬b ¬c = ⊥-elim ( ¬p<x<op ⟪ px<b , zc-b<x _ a ⟫ ) -- px o< b o< x
1231 ... | tri≈ ¬a b ¬c = b
1232 ... | tri> ¬a ¬b c = ⊥-elim ( o≤> b≤x c ) -- x o< b ≤ x
1233 a≤x : a o≤ x
1234 a≤x = o<→≤ ( subst (λ k → a o< k ) b=x a<b )
1235 sf1b=sp1 : supf1 b ≡ sp1
1236 sf1b=sp1 = sf1=sp1 (subst (λ k → px o< k) (trans (Oprev.oprev=x op) (sym b=x)) <-osuc)
1237 z27 : supf1 a ≡ sp1
1238 z27 = trans ( supfeq1 a≤x b≤x ( union-max1 (subst (λ k → k o≤ supf1 a) b=x b≤sa)
1239 b≤x (subst (λ k → supf1 a o< k ) (sym sf1b=sp1) sa<sb ) ) ) sf1b=sp1
1240
1143 ... | no lim with trio< x o∅ 1241 ... | no lim with trio< x o∅
1144 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a ) 1242 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a )
1145 ... | tri≈ ¬a x=0 ¬c = record { supf = λ _ → MinSUP.sup (ysup f mf ay) ; asupf = MinSUP.as (ysup f mf ay) 1243 ... | tri≈ ¬a x=0 ¬c = record { supf = λ _ → MinSUP.sup (ysup f mf ay) ; asupf = MinSUP.as (ysup f mf ay)
1146 ; supf-mono = λ _ → o≤-refl 1244 ; supf-mono = λ _ → o≤-refl ; order = λ _ s<s → ⊥-elim ( o<¬≡ refl s<s )
1147 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = λ a<b b≤0 → ⊥-elim ( ¬x<0 (subst (λ k → _ o< k ) x=0 (ordtrans<-≤ a<b b≤0))) } where 1245 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = λ a<b b≤0 → ⊥-elim ( ¬x<0 (subst (λ k → _ o< k ) x=0 (ordtrans<-≤ a<b b≤0))) } where
1148 mf : ≤-monotonic-f A f 1246 mf : ≤-monotonic-f A f
1149 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 1247 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
1150 mf00 : * x < * (f x) 1248 mf00 : * x < * (f x)
1151 mf00 = proj1 ( mf< x ax ) 1249 mf00 = proj1 ( mf< x ax )
1152 ym = MinSUP.sup (ysup f mf ay) 1250 ym = MinSUP.sup (ysup f mf ay)
1153 1251
1154 zo≤sz : {z : Ordinal} → z o≤ x → z o≤ MinSUP.sup (ysup f mf ay) 1252 zo≤sz : {z : Ordinal} → z o≤ x → z o≤ MinSUP.sup (ysup f mf ay)
1155 zo≤sz {z} z≤x with osuc-≡< z≤x 1253 zo≤sz {z} z≤x with osuc-≡< z≤x
1156 ... | case1 refl = subst (λ k → k o≤ _) (sym x=0) o∅≤z 1254 ... | case1 refl = subst (λ k → k o≤ _) (sym x=0) o∅≤z
1157 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) ) 1255 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) )
1158 1256
1159 is-minsup : {z : Ordinal} → z o≤ x → 1257 is-minsup : {z : Ordinal} → z o≤ x →
1160 IsMinSUP A (UnionCF A f ay (λ _ → MinSUP.sup (ysup f mf ay)) z) (MinSUP.sup (ysup f mf ay)) 1258 IsMinSUP A (UnionCF A f ay (λ _ → MinSUP.sup (ysup f mf ay)) z) (MinSUP.sup (ysup f mf ay))
1161 is-minsup {z} z≤x with osuc-≡< z≤x 1259 is-minsup {z} z≤x with osuc-≡< z≤x
1167 → ym o≤ s 1265 → ym o≤ s
1168 is01 {s} as sup = MinSUP.minsup (ysup f mf ay) as is02 where 1266 is01 {s} as sup = MinSUP.minsup (ysup f mf ay) as is02 where
1169 is02 : {w : Ordinal } → odef (uchain f mf ay) w → (w ≡ s) ∨ (w << s) 1267 is02 : {w : Ordinal } → odef (uchain f mf ay) w → (w ≡ s) ∨ (w << s)
1170 is02 fc = sup ⟪ A∋fc _ f mf fc , ch-init fc ⟫ 1268 is02 fc = sup ⟪ A∋fc _ f mf fc , ch-init fc ⟫
1171 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) ) 1269 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) )
1172 ... | tri> ¬a ¬b 0<x = record { supf = supf1 ; asupf = asupf ; supf-mono = supf-mono ; order = order 1270 ... | tri> ¬a ¬b 0<x = record { supf = supf1 ; asupf = asupf ; supf-mono = supf-mono ; order = order
1173 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where 1271 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where
1174 1272
1175 mf : ≤-monotonic-f A f 1273 mf : ≤-monotonic-f A f
1176 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 1274 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
1177 mf00 : * x < * (f x) 1275 mf00 : * x < * (f x)
1552 z50 = o≤-refl0 z49 1650 z50 = o≤-refl0 z49
1553 z48 : odef pchainU (f spu) 1651 z48 : odef pchainU (f spu)
1554 z48 = ⟪ proj2 (mf _ (MinSUP.as usup) ) , ic-isup _ (subst (λ k → k o< x) refl spu<x) z50 1652 z48 = ⟪ proj2 (mf _ (MinSUP.as usup) ) , ic-isup _ (subst (λ k → k o< x) refl spu<x) z50
1555 (fsuc _ (init (ZChain.asupf (pzc (ob<x lim spu<x))) z49)) ⟫ 1653 (fsuc _ (init (ZChain.asupf (pzc (ob<x lim spu<x))) z49)) ⟫
1556 1654
1655 supfeq1 : {a b : Ordinal } → a o≤ x → b o≤ x → UnionCF A f ay supf1 a ≡ UnionCF A f ay supf1 b → supf1 a ≡ supf1 b
1656 supfeq1 {a} {b} a≤z b≤z ua=ub with trio< (supf1 a) (supf1 b)
1657 ... | tri< sa<sb ¬b ¬c = ⊥-elim ( o≤> (
1658 IsMinSUP.minsup (is-minsup b≤z) asupf (λ {z} uzb → IsMinSUP.x≤sup (is-minsup a≤z) (subst (λ k → odef k z) (sym ua=ub) uzb)) ) sa<sb )
1659 ... | tri≈ ¬a b ¬c = b
1660 ... | tri> ¬a ¬b sb<sa = ⊥-elim ( o≤> (
1661 IsMinSUP.minsup (is-minsup a≤z) asupf (λ {z} uza → IsMinSUP.x≤sup (is-minsup b≤z) (subst (λ k → odef k z) ua=ub uza)) ) sb<sa )
1662
1663 union-max1 : {a b : Ordinal } → x o≤ supf1 a → b o≤ x → supf1 a o< supf1 b → UnionCF A f ay supf1 a ≡ UnionCF A f ay supf1 b
1664 union-max1 {a} {b} z≤sa b≤z sa<sb = ==→o≡ record { eq→ = z47 ; eq← = z48 } where
1665 z47 : {w : Ordinal } → odef (UnionCF A f ay supf1 a ) w → odef ( UnionCF A f ay supf1 b ) w
1666 z47 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
1667 z47 {w} ⟪ aw , ch-is-sup u u<a su=u fc ⟫ = ⟪ aw , ch-is-sup u u<b su=u fc ⟫ where
1668 u<b : u o< b
1669 u<b = ordtrans u<a (supf-inject0 supf-mono sa<sb )
1670 z48 : {w : Ordinal } → odef (UnionCF A f ay supf1 b ) w → odef ( UnionCF A f ay supf1 a ) w
1671 z48 {w} ⟪ aw , ch-init fc ⟫ = ⟪ aw , ch-init fc ⟫
1672 z48 {w} ⟪ aw , ch-is-sup u u<b su=u fc ⟫ = ⟪ aw , ch-is-sup u u<a su=u fc ⟫ where
1673 u<a : u o< a
1674 u<a = supf-inject0 supf-mono ( osucprev (begin
1675 osuc (supf1 u) ≡⟨ cong osuc su=u ⟩
1676 osuc u ≤⟨ osucc (ordtrans<-≤ u<b b≤z ) ⟩
1677 x ≤⟨ z≤sa ⟩
1678 supf1 a ∎ )) where open o≤-Reasoning O
1679
1680 order : {a b w : Ordinal } → b o≤ x → supf1 a o< supf1 b → FClosure A f (supf1 a) w → w ≤ supf1 b
1681 order {a} {b} {w} b≤x sa<sb fc with osuc-≡< b≤x
1682 ... | case2 b<x = subst (λ k → w ≤ k ) (sym (trans (sf1=sf b<x) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )))) (
1683 ZChain.order (pzc b<x) o≤-refl
1684 (subst₂ (λ j k → j o< k ) (trans (sf1=sf a<x) (zeq _ _ (osucc a<b) (o<→≤ <-osuc)))
1685 (trans (sf1=sf b<x) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl))) sa<sb)
1686 (subst (λ k → FClosure A f k w) (trans (sf1=sf a<x) (zeq _ _ (osucc a<b) (o<→≤ <-osuc)) ) fc ) ) where
1687 a<b : a o< b
1688 a<b = supf-inject0 supf-mono sa<sb
1689 a<x : a o< x
1690 a<x = ordtrans<-≤ a<b b≤x
1691 ... | case1 refl = subst (λ k → w ≤ k ) (sym (sf1=spu refl)) ( zc40 (subst₂ (λ j k → j o< k) (sf1=sf a<x) (sf1=spu refl) sa<sb)
1692 (subst (λ k → FClosure A f k w) (sf1=sf a<x) fc )) where
1693 a<x : a o< x
1694 a<x = supf-inject0 supf-mono sa<sb
1695 zc40 : ZChain.supf (pzc (ob<x lim a<x )) a o< spu → FClosure A f (ZChain.supf (pzc (ob<x lim a<x )) a) w → w ≤ spu
1696 zc40 sa<sp fc with x<y∨y≤x (supfz a<x) x
1697 ... | case1 sa<x = z29 where
1698 z28 : odef (UnionCF A f ay supf1 b) w
1699 z28 = cfcs a<x o≤-refl (subst (λ k → k o< x) (sym (sf1=sf a<x)) sa<x) (subst (λ k → FClosure A f k w ) (sym (sf1=sf a<x)) fc )
1700 z29 : w ≤ spu
1701 z29 with z28
1702 ... | ⟪ aw , ch-init fc ⟫ = MinSUP.x≤sup usup ⟪ aw , ic-init fc ⟫
1703 ... | ⟪ aw , ch-is-sup u u<b su=u fc ⟫ = MinSUP.x≤sup usup ⟪ aw , ic-isup u u<b z30
1704 (subst (λ k → FClosure A f k w) (sf1=sf u<b) fc) ⟫ where
1705 z30 : supfz u<b o≤ u
1706 z30 = o≤-refl0 ( trans (sym (sf1=sf u<b)) su=u )
1707 ... | case2 x≤sa = ⊥-elim ( o<¬≡ z27 sa<sb ) where
1708 z27 : supf1 a ≡ supf1 b
1709 z27 = begin
1710 supf1 a ≡⟨ ( supfeq1 (o<→≤ a<x) o≤-refl ( union-max1 (subst (λ k → x o≤ k ) (sym (sf1=sf a<x)) x≤sa ) b≤x sa<sb) ) ⟩
1711 supf1 x ∎ where open ≡-Reasoning
1712
1557 --- 1713 ---
1558 --- the maximum chain has fix point of any ≤-monotonic function 1714 --- the maximum chain has fix point of any ≤-monotonic function
1559 --- 1715 ---
1560 1716
1561 SZ : ( f : Ordinal → Ordinal ) → (mf< : <-monotonic-f A f ) → {y : Ordinal} (ay : odef A y) → (x : Ordinal) → ZChain A f mf< ay x 1717 SZ : ( f : Ordinal → Ordinal ) → (mf< : <-monotonic-f A f ) → {y : Ordinal} (ay : odef A y) → (x : Ordinal) → ZChain A f mf< ay x