comparison src/zorn.agda @ 1042:912ca4abe806

pxhainx conditon is requied?
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 04 Dec 2022 09:15:12 +0900
parents f12a9b4066a0
children fd26e0c4e648
comparison
equal deleted inserted replaced
1041:f12a9b4066a0 1042:912ca4abe806
21 open import Relation.Nullary 21 open import Relation.Nullary
22 open import Data.Empty 22 open import Data.Empty
23 import BAlgbra 23 import BAlgbra
24 24
25 open import Data.Nat hiding ( _<_ ; _≤_ ) 25 open import Data.Nat hiding ( _<_ ; _≤_ )
26 open import Data.Nat.Properties 26 open import Data.Nat.Properties
27 open import nat 27 open import nat
28 28
29 29
30 open inOrdinal O 30 open inOrdinal O
31 open OD O 31 open OD O
74 ftrans≤-< {x} {y} {z} (case1 eq) y<z = subst (λ k → k < * z) (sym (cong (*) eq)) y<z 74 ftrans≤-< {x} {y} {z} (case1 eq) y<z = subst (λ k → k < * z) (sym (cong (*) eq)) y<z
75 ftrans≤-< {x} {y} {z} (case2 lt) y<z = IsStrictPartialOrder.trans PO lt y<z 75 ftrans≤-< {x} {y} {z} (case2 lt) y<z = IsStrictPartialOrder.trans PO lt y<z
76 76
77 ftrans<-≤ : {x y z : Ordinal } → x << y → y ≤ z → x << z 77 ftrans<-≤ : {x y z : Ordinal } → x << y → y ≤ z → x << z
78 ftrans<-≤ {x} {y} {z} x<y (case1 eq) = subst (λ k → * x < k ) ((cong (*) eq)) x<y 78 ftrans<-≤ {x} {y} {z} x<y (case1 eq) = subst (λ k → * x < k ) ((cong (*) eq)) x<y
79 ftrans<-≤ {x} {y} {z} x<y (case2 lt) = IsStrictPartialOrder.trans PO x<y lt 79 ftrans<-≤ {x} {y} {z} x<y (case2 lt) = IsStrictPartialOrder.trans PO x<y lt
80 80
81 <-irr : {a b : HOD} → (a ≡ b ) ∨ (a < b ) → b < a → ⊥ 81 <-irr : {a b : HOD} → (a ≡ b ) ∨ (a < b ) → b < a → ⊥
82 <-irr {a} {b} (case1 a=b) b<a = IsStrictPartialOrder.irrefl PO (sym a=b) b<a 82 <-irr {a} {b} (case1 a=b) b<a = IsStrictPartialOrder.irrefl PO (sym a=b) b<a
83 <-irr {a} {b} (case2 a<b) b<a = IsStrictPartialOrder.irrefl PO refl 83 <-irr {a} {b} (case2 a<b) b<a = IsStrictPartialOrder.irrefl PO refl
84 (IsStrictPartialOrder.trans PO b<a a<b) 84 (IsStrictPartialOrder.trans PO b<a a<b)
166 fc04 = fc00 i j (cong pred i=j) cx1 cy (cong pred i=x1) (cong pred j=y) 166 fc04 = fc00 i j (cong pred i=j) cx1 cy (cong pred i=x1) (cong pred j=y)
167 ... | case2 x<fx | case1 y=fy = subst (λ k → * (f x) ≡ * k ) y=fy (fc03 y cy j=y) where 167 ... | case2 x<fx | case1 y=fy = subst (λ k → * (f x) ≡ * k ) y=fy (fc03 y cy j=y) where
168 fc03 : (y1 : Ordinal) → (cy1 : FClosure A f s y1 ) → suc j ≡ fcn s mf cy1 → * (f x) ≡ * y1 168 fc03 : (y1 : Ordinal) → (cy1 : FClosure A f s y1 ) → suc j ≡ fcn s mf cy1 → * (f x) ≡ * y1
169 fc03 y1 (init x₁ x₂) x = ⊥-elim (fc06 x₂ x) 169 fc03 y1 (init x₁ x₂) x = ⊥-elim (fc06 x₂ x)
170 fc03 .(f y1) (fsuc y1 cy1) j=y1 with proj1 (mf y1 (A∋fc s f mf cy1 ) ) 170 fc03 .(f y1) (fsuc y1 cy1) j=y1 with proj1 (mf y1 (A∋fc s f mf cy1 ) )
171 ... | case1 eq = trans ( fc03 y1 cy1 j=y1 ) (cong (*) eq) 171 ... | case1 eq = trans ( fc03 y1 cy1 j=y1 ) (cong (*) eq)
172 ... | case2 lt = subst₂ (λ j k → * (f j) ≡ * (f k )) &iso &iso ( cong (λ k → * ( f (& k ))) fc05) where 172 ... | case2 lt = subst₂ (λ j k → * (f j) ≡ * (f k )) &iso &iso ( cong (λ k → * ( f (& k ))) fc05) where
173 fc05 : * x ≡ * y1 173 fc05 : * x ≡ * y1
174 fc05 = fc00 i j (cong pred i=j) cx cy1 (cong pred i=x) (cong pred j=y1) 174 fc05 = fc00 i j (cong pred i=j) cx cy1 (cong pred i=x) (cong pred j=y1)
175 ... | case2 x₁ | case2 x₂ = subst₂ (λ j k → * (f j) ≡ * (f k) ) &iso &iso (cong (λ k → * (f (& k))) (fc00 i j (cong pred i=j) cx cy (cong pred i=x) (cong pred j=y))) 175 ... | case2 x₁ | case2 x₂ = subst₂ (λ j k → * (f j) ≡ * (f k) ) &iso &iso (cong (λ k → * (f (& k))) (fc00 i j (cong pred i=j) cx cy (cong pred i=x) (cong pred j=y)))
176 176
256 -- 256 --
257 -- if sup z1 ≡ sup z2, the chain is stopped at sup z1, then f (sup z1) ≡ sup z1 257 -- if sup z1 ≡ sup z2, the chain is stopped at sup z1, then f (sup z1) ≡ sup z1
258 -- this means sup z1 is the Maximal, so f is <-monotonic if we have no Maximal. 258 -- this means sup z1 is the Maximal, so f is <-monotonic if we have no Maximal.
259 -- 259 --
260 260
261 fc-stop : ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) { a b : Ordinal } 261 fc-stop : ( A : HOD ) ( f : Ordinal → Ordinal ) (mf : ≤-monotonic-f A f) { a b : Ordinal }
262 → (aa : odef A a ) →( {y : Ordinal} → FClosure A f a y → (y ≡ b ) ∨ (y << b )) → a ≡ b → f a ≡ a 262 → (aa : odef A a ) →( {y : Ordinal} → FClosure A f a y → (y ≡ b ) ∨ (y << b )) → a ≡ b → f a ≡ a
263 fc-stop A f mf {a} {b} aa x≤sup a=b with x≤sup (fsuc a (init aa refl )) 263 fc-stop A f mf {a} {b} aa x≤sup a=b with x≤sup (fsuc a (init aa refl ))
264 ... | case1 eq = trans eq (sym a=b) 264 ... | case1 eq = trans eq (sym a=b)
265 ... | case2 lt = ⊥-elim (<-irr (case1 (cong (λ k → * (f k) ) (sym a=b))) (ftrans<-≤ lt fc00 ) ) where 265 ... | case2 lt = ⊥-elim (<-irr (case1 (cong (λ k → * (f k) ) (sym a=b))) (ftrans<-≤ lt fc00 ) ) where
266 fc00 : b ≤ (f b) 266 fc00 : b ≤ (f b)
267 fc00 = proj1 (mf _ (subst (λ k → odef A k) a=b aa )) 267 fc00 = proj1 (mf _ (subst (λ k → odef A k) a=b aa ))
268 268
269 ∈∧P→o< : {A : HOD } {y : Ordinal} → {P : Set n} → odef A y ∧ P → y o< & A 269 ∈∧P→o< : {A : HOD } {y : Ordinal} → {P : Set n} → odef A y ∧ P → y o< & A
270 ∈∧P→o< {A } {y} p = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) (proj1 p ))) 270 ∈∧P→o< {A } {y} p = subst (λ k → k o< & A) &iso ( c<→o< (subst (λ k → odef A k ) (sym &iso ) (proj1 p )))
271 271
272 -- Union of supf z and FClosure A f y 272 -- Union of supf z and FClosure A f y
273 273
274 data UChain { A : HOD } { f : Ordinal → Ordinal } {supf : Ordinal → Ordinal} {y : Ordinal } (ay : odef A y ) 274 data UChain { A : HOD } { f : Ordinal → Ordinal } {supf : Ordinal → Ordinal} {y : Ordinal } (ay : odef A y )
275 (x : Ordinal) : (z : Ordinal) → Set n where 275 (x : Ordinal) : (z : Ordinal) → Set n where
276 ch-init : {z : Ordinal } (fc : FClosure A f y z) → UChain ay x z 276 ch-init : {z : Ordinal } (fc : FClosure A f y z) → UChain ay x z
277 ch-is-sup : (u : Ordinal) {z : Ordinal } (u<x : u o< x) (supu=u : supf u ≡ u) ( fc : FClosure A f (supf u) z ) → UChain ay x z 277 ch-is-sup : (u : Ordinal) {z : Ordinal } (u<x : u o< x) (supu=u : supf u ≡ u) ( fc : FClosure A f (supf u) z ) → UChain ay x z
278 278
279 UnionCF : ( A : HOD ) ( f : Ordinal → Ordinal ) {y : Ordinal } (ay : odef A y ) ( supf : Ordinal → Ordinal ) ( x : Ordinal ) → HOD 279 UnionCF : ( A : HOD ) ( f : Ordinal → Ordinal ) {y : Ordinal } (ay : odef A y ) ( supf : Ordinal → Ordinal ) ( x : Ordinal ) → HOD
280 UnionCF A f ay supf x 280 UnionCF A f ay supf x
281 = record { od = record { def = λ z → odef A z ∧ UChain {A} {f} {supf} ay x z } ; 281 = record { od = record { def = λ z → odef A z ∧ UChain {A} {f} {supf} ay x z } ;
282 odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy } 282 odmax = & A ; <odmax = λ {y} sy → ∈∧P→o< sy }
283 283
284 284
285 supf-inject0 : {x y : Ordinal } {supf : Ordinal → Ordinal } → (supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y ) 285 supf-inject0 : {x y : Ordinal } {supf : Ordinal → Ordinal } → (supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y )
286 → supf x o< supf y → x o< y 286 → supf x o< supf y → x o< y
322 322
323 323
324 chain-mono : {A : HOD} ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal ) 324 chain-mono : {A : HOD} ( f : Ordinal → Ordinal ) → (mf : ≤-monotonic-f A f ) {y : Ordinal} (ay : odef A y) (supf : Ordinal → Ordinal )
325 (supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y ) {a b c : Ordinal} → a o≤ b 325 (supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y ) {a b c : Ordinal} → a o≤ b
326 → odef (UnionCF A f ay supf a) c → odef (UnionCF A f ay supf b) c 326 → odef (UnionCF A f ay supf a) c → odef (UnionCF A f ay supf b) c
327 chain-mono f mf ay supf supf-mono {a} {b} {c} a≤b ⟪ ua , ch-init fc ⟫ = ⟪ ua , ch-init fc ⟫ 327 chain-mono f mf ay supf supf-mono {a} {b} {c} a≤b ⟪ ua , ch-init fc ⟫ = ⟪ ua , ch-init fc ⟫
328 chain-mono f mf ay supf supf-mono {a} {b} {c} a≤b ⟪ ua , ch-is-sup u u<x supu=u fc ⟫ = ⟪ ua , ch-is-sup u (ordtrans<-≤ u<x a≤b) supu=u fc ⟫ 328 chain-mono f mf ay supf supf-mono {a} {b} {c} a≤b ⟪ ua , ch-is-sup u u<x supu=u fc ⟫ = ⟪ ua , ch-is-sup u (ordtrans<-≤ u<x a≤b) supu=u fc ⟫
329 329
330 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f) 330 record ZChain ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f)
331 {y : Ordinal} (ay : odef A y) ( z : Ordinal ) : Set (Level.suc n) where 331 {y : Ordinal} (ay : odef A y) ( z : Ordinal ) : Set (Level.suc n) where
332 field 332 field
333 supf : Ordinal → Ordinal 333 supf : Ordinal → Ordinal
338 338
339 asupf : {x : Ordinal } → odef A (supf x) 339 asupf : {x : Ordinal } → odef A (supf x)
340 supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y 340 supf-mono : {x y : Ordinal } → x o≤ y → supf x o≤ supf y
341 supfmax : {x : Ordinal } → z o< x → supf x ≡ supf z 341 supfmax : {x : Ordinal } → z o< x → supf x ≡ supf z
342 342
343 is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → IsMinSUP A (UnionCF A f ay supf x) (supf x) 343 is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → IsMinSUP A (UnionCF A f ay supf x) (supf x)
344 sup=u : {b : Ordinal} → (ab : odef A b) → b o≤ z 344 sup=u : {b : Ordinal} → (ab : odef A b) → b o≤ z
345 → IsSUP A (UnionCF A f ay supf b) b ∧ (¬ HasPrev A (UnionCF A f ay supf b) f b ) → supf b ≡ b 345 → IsSUP A (UnionCF A f ay supf b) b ∧ (¬ HasPrev A (UnionCF A f ay supf b) f b ) → supf b ≡ b
346 346
347 chain : HOD 347 chain : HOD
348 chain = UnionCF A f ay supf z 348 chain = UnionCF A f ay supf z
350 chain⊆A = λ lt → proj1 lt 350 chain⊆A = λ lt → proj1 lt
351 351
352 chain∋init : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) y 352 chain∋init : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) y
353 chain∋init {x} x≤z = ⟪ ay , ch-init (init ay refl) ⟫ 353 chain∋init {x} x≤z = ⟪ ay , ch-init (init ay refl) ⟫
354 354
355 mf : ≤-monotonic-f A f 355 mf : ≤-monotonic-f A f
356 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 356 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
357 mf00 : * x < * (f x) 357 mf00 : * x < * (f x)
358 mf00 = proj1 ( mf< x ax ) 358 mf00 = proj1 ( mf< x ax )
359 359
360 f-next : {a z : Ordinal} → odef (UnionCF A f ay supf z) a → odef (UnionCF A f ay supf z) (f a) 360 f-next : {a z : Ordinal} → odef (UnionCF A f ay supf z) a → odef (UnionCF A f ay supf z) (f a)
361 f-next {a} ⟪ ua , ch-init fc ⟫ = ⟪ proj2 ( mf _ ua) , ch-init (fsuc _ fc) ⟫ 361 f-next {a} ⟪ ua , ch-init fc ⟫ = ⟪ proj2 ( mf _ ua) , ch-init (fsuc _ fc) ⟫
362 f-next {a} ⟪ ua , ch-is-sup u su<x su=u fc ⟫ = ⟪ proj2 ( mf _ ua) , ch-is-sup u su<x su=u (fsuc _ fc) ⟫ 362 f-next {a} ⟪ ua , ch-is-sup u su<x su=u fc ⟫ = ⟪ proj2 ( mf _ ua) , ch-is-sup u su<x su=u (fsuc _ fc) ⟫
363 363
364 supf-inject : {x y : Ordinal } → supf x o< supf y → x o< y 364 supf-inject : {x y : Ordinal } → supf x o< supf y → x o< y
365 supf-inject {x} {y} sx<sy with trio< x y 365 supf-inject {x} {y} sx<sy with trio< x y
366 ... | tri< a ¬b ¬c = a 366 ... | tri< a ¬b ¬c = a
367 ... | tri≈ ¬a refl ¬c = ⊥-elim ( o<¬≡ (cong supf refl) sx<sy ) 367 ... | tri≈ ¬a refl ¬c = ⊥-elim ( o<¬≡ (cong supf refl) sx<sy )
380 380
381 supf-is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → supf x ≡ MinSUP.sup (minsup x≤z) 381 supf-is-minsup : {x : Ordinal } → (x≤z : x o≤ z) → supf x ≡ MinSUP.sup (minsup x≤z)
382 supf-is-minsup _ = refl 382 supf-is-minsup _ = refl
383 383
384 -- different from order because y o< supf 384 -- different from order because y o< supf
385 fcy<sup : {u w : Ordinal } → u o≤ z → FClosure A f y w → (w ≡ supf u ) ∨ ( w << supf u ) 385 fcy<sup : {u w : Ordinal } → u o≤ z → FClosure A f y w → (w ≡ supf u ) ∨ ( w << supf u )
386 fcy<sup {u} {w} u≤z fc with MinSUP.x≤sup (minsup u≤z) ⟪ subst (λ k → odef A k ) (sym &iso) (A∋fc {A} y f mf fc) 386 fcy<sup {u} {w} u≤z fc with MinSUP.x≤sup (minsup u≤z) ⟪ subst (λ k → odef A k ) (sym &iso) (A∋fc {A} y f mf fc)
387 , ch-init (subst (λ k → FClosure A f y k) (sym &iso) fc ) ⟫ 387 , ch-init (subst (λ k → FClosure A f y k) (sym &iso) fc ) ⟫
388 ... | case1 eq = case1 (subst (λ k → k ≡ supf u ) &iso (trans eq (sym (supf-is-minsup u≤z ) ) )) 388 ... | case1 eq = case1 (subst (λ k → k ≡ supf u ) &iso (trans eq (sym (supf-is-minsup u≤z ) ) ))
389 ... | case2 lt = case2 (subst₂ (λ j k → j << k ) &iso (sym (supf-is-minsup u≤z )) lt ) 389 ... | case2 lt = case2 (subst₂ (λ j k → j << k ) &iso (sym (supf-is-minsup u≤z )) lt )
390 390
391 initial : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) x → y ≤ x 391 initial : {x : Ordinal } → x o≤ z → odef (UnionCF A f ay supf x) x → y ≤ x
392 initial {x} x≤z ⟪ aa , ch-init fc ⟫ = s≤fc y f mf fc 392 initial {x} x≤z ⟪ aa , ch-init fc ⟫ = s≤fc y f mf fc
393 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) 393 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)
394 394
395 f-total : IsTotalOrderSet chain 395 f-total : IsTotalOrderSet chain
396 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ = 396 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ =
397 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso fc-total where 397 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso fc-total where
398 fc-total : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 398 fc-total : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
399 fc-total with trio< ua ub 399 fc-total with trio< ua ub
400 ... | tri< a₁ ¬b ¬c with ≤-ftrans (order (o<→≤ sub<x) a₁ fca ) (s≤fc (supf ub) f mf fcb ) 400 ... | tri< a₁ ¬b ¬c with ≤-ftrans (order (o<→≤ sub<x) a₁ fca ) (s≤fc (supf ub) f mf fcb )
401 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 401 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
402 ct00 : * (& a) ≡ * (& b) 402 ct00 : * (& a) ≡ * (& b)
403 ct00 = cong (*) eq1 403 ct00 = cong (*) eq1
404 ... | case2 a<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b ) lt) 404 ... | case2 a<b = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b ) lt)
405 fc-total | tri≈ _ refl _ = fcn-cmp _ f mf fca fcb 405 fc-total | tri≈ _ refl _ = fcn-cmp _ f mf fca fcb
406 fc-total | tri> ¬a ¬b c with ≤-ftrans (order (o<→≤ sua<x) c fcb ) (s≤fc (supf ua) f mf fca ) 406 fc-total | tri> ¬a ¬b c with ≤-ftrans (order (o<→≤ sua<x) c fcb ) (s≤fc (supf ua) f mf fca )
407 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 407 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
408 ct00 : * (& a) ≡ * (& b) 408 ct00 : * (& a) ≡ * (& b)
409 ct00 = cong (*) (sym eq1) 409 ct00 = cong (*) (sym eq1)
410 ... | case2 b<a = tri> (λ lt → <-irr (case2 b<a ) lt) (λ eq → <-irr (case1 eq) b<a ) b<a 410 ... | case2 b<a = tri> (λ lt → <-irr (case2 b<a ) lt) (λ eq → <-irr (case1 eq) b<a ) b<a
411 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ = ft00 where 411 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-is-sup ub sub<x sub=ub fcb ⟫ = ft00 where
412 ft01 : (& a) ≤ (& b) → Tri ( a < b) ( a ≡ b) ( b < a ) 412 ft01 : (& a) ≤ (& b) → Tri ( a < b) ( a ≡ b) ( b < a )
413 ft01 (case1 eq) = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym a=b)) lt)) a=b (λ lt → ⊥-elim (<-irr (case1 a=b) lt)) where 413 ft01 (case1 eq) = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym a=b)) lt)) a=b (λ lt → ⊥-elim (<-irr (case1 a=b) lt)) where
414 a=b : a ≡ b 414 a=b : a ≡ b
415 a=b = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq) 415 a=b = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq)
416 ft01 (case2 lt) = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b ) lt) where 416 ft01 (case2 lt) = tri< a<b (λ eq → <-irr (case1 (sym eq)) a<b ) (λ lt → <-irr (case2 a<b ) lt) where
417 a<b : a < b 417 a<b : a < b
418 a<b = subst₂ (λ j k → j < k ) *iso *iso lt 418 a<b = subst₂ (λ j k → j < k ) *iso *iso lt
419 ft00 : Tri ( a < b) ( a ≡ b) ( b < a ) 419 ft00 : Tri ( a < b) ( a ≡ b) ( b < a )
420 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sub<x) fca) (s≤fc {A} _ f mf fcb)) 420 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sub<x) fca) (s≤fc {A} _ f mf fcb))
421 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-init fcb ⟫ = ft00 where 421 f-total {a} {b} ⟪ uaa , ch-is-sup ua sua<x sua=ua fca ⟫ ⟪ uab , ch-init fcb ⟫ = ft00 where
422 ft01 : (& b) ≤ (& a) → Tri ( a < b) ( a ≡ b) ( b < a ) 422 ft01 : (& b) ≤ (& a) → Tri ( a < b) ( a ≡ b) ( b < a )
423 ft01 (case1 eq) = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym a=b)) lt)) a=b (λ lt → ⊥-elim (<-irr (case1 a=b) lt)) where 423 ft01 (case1 eq) = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym a=b)) lt)) a=b (λ lt → ⊥-elim (<-irr (case1 a=b) lt)) where
424 a=b : a ≡ b 424 a=b : a ≡ b
425 a=b = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) (sym eq)) 425 a=b = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) (sym eq))
426 ft01 (case2 lt) = tri> (λ lt → <-irr (case2 b<a ) lt) (λ eq → <-irr (case1 eq) b<a ) b<a where 426 ft01 (case2 lt) = tri> (λ lt → <-irr (case2 b<a ) lt) (λ eq → <-irr (case1 eq) b<a ) b<a where
427 b<a : b < a 427 b<a : b < a
428 b<a = subst₂ (λ j k → j < k ) *iso *iso lt 428 b<a = subst₂ (λ j k → j < k ) *iso *iso lt
429 ft00 : Tri ( a < b) ( a ≡ b) ( b < a ) 429 ft00 : Tri ( a < b) ( a ≡ b) ( b < a )
430 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sua<x) fcb) (s≤fc {A} _ f mf fca)) 430 ft00 = ft01 (≤-ftrans (fcy<sup (o<→≤ sua<x) fcb) (s≤fc {A} _ f mf fca))
431 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-init fcb ⟫ = 431 f-total {a} {b} ⟪ uaa , ch-init fca ⟫ ⟪ uab , ch-init fcb ⟫ =
432 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp y f mf fca fcb ) 432 subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp y f mf fca fcb )
433 433
434 IsMinSUP→NotHasPrev : {x sp : Ordinal } → odef A sp 434 IsMinSUP→NotHasPrev : {x sp : Ordinal } → odef A sp
435 → ({y : Ordinal} → odef (UnionCF A f ay supf x) y → (y ≡ sp ) ∨ (y << sp )) 435 → ({y : Ordinal} → odef (UnionCF A f ay supf x) y → (y ≡ sp ) ∨ (y << sp ))
436 → ( {a : Ordinal } → odef A a → a << f a ) 436 → ( {a : Ordinal } → odef A a → a << f a )
442 im00 : f (f pr) ≤ sp 442 im00 : f (f pr) ≤ sp
443 im00 = is-sup ( f-next (f-next (HasPrev.ay hp))) 443 im00 = is-sup ( f-next (f-next (HasPrev.ay hp)))
444 fsp≤sp : f sp ≤ sp 444 fsp≤sp : f sp ≤ sp
445 fsp≤sp = subst (λ k → f k ≤ sp ) (sym (HasPrev.x=fy hp)) im00 445 fsp≤sp = subst (λ k → f k ≤ sp ) (sym (HasPrev.x=fy hp)) im00
446 446
447 supf-¬hp : {x : Ordinal } → x o≤ z 447 supf-¬hp : {x : Ordinal } → x o≤ z
448 → ( {a : Ordinal } → odef A a → a << f a ) 448 → ( {a : Ordinal } → odef A a → a << f a )
449 → ¬ ( HasPrev A (UnionCF A f ay supf x) f (supf x) ) 449 → ¬ ( HasPrev A (UnionCF A f ay supf x) f (supf x) )
450 supf-¬hp {x} x≤z <-mono hp = IsMinSUP→NotHasPrev asupf (λ {w} uw → 450 supf-¬hp {x} x≤z <-mono hp = IsMinSUP→NotHasPrev asupf (λ {w} uw →
451 (subst (λ k → w ≤ k) (sym (supf-is-minsup x≤z)) ( MinSUP.x≤sup (minsup x≤z) uw) )) <-mono hp 451 (subst (λ k → w ≤ k) (sym (supf-is-minsup x≤z)) ( MinSUP.x≤sup (minsup x≤z) uw) )) <-mono hp
452 452
453 supf-idem : {b : Ordinal } → b o≤ z → supf b o≤ z → supf (supf b) ≡ supf b 453 supf-idem : {b : Ordinal } → b o≤ z → supf b o≤ z → supf (supf b) ≡ supf b
454 supf-idem {b} b≤z sfb≤x = z52 where 454 supf-idem {b} b≤z sfb≤x = z52 where
455 z54 : {w : Ordinal} → odef (UnionCF A f ay supf (supf b)) w → (w ≡ supf b) ∨ (w << supf b) 455 z54 : {w : Ordinal} → odef (UnionCF A f ay supf (supf b)) w → (w ≡ supf b) ∨ (w << supf b)
456 z54 {w} ⟪ aw , ch-init fc ⟫ = fcy<sup b≤z fc 456 z54 {w} ⟪ aw , ch-init fc ⟫ = fcy<sup b≤z fc
457 z54 {w} ⟪ aw , ch-is-sup u u<x su=u fc ⟫ = order b≤z su<b fc where 457 z54 {w} ⟪ aw , ch-is-sup u u<x su=u fc ⟫ = order b≤z su<b fc where
458 su<b : u o< b 458 su<b : u o< b
459 su<b = supf-inject (subst (λ k → k o< supf b ) (sym (su=u)) u<x ) 459 su<b = supf-inject (subst (λ k → k o< supf b ) (sym (su=u)) u<x )
460 z52 : supf (supf b) ≡ supf b 460 z52 : supf (supf b) ≡ supf b
461 z52 = sup=u asupf sfb≤x ⟪ record { ax = asupf ; x≤sup = z54 } , IsMinSUP→NotHasPrev asupf z54 ( λ ax → proj1 (mf< _ ax)) ⟫ 461 z52 = sup=u asupf sfb≤x ⟪ record { ax = asupf ; x≤sup = z54 } , IsMinSUP→NotHasPrev asupf z54 ( λ ax → proj1 (mf< _ ax)) ⟫
462 462
463 -- cp : (mf< : <-monotonic-f A f) {b : Ordinal } → b o≤ z → supf b o≤ z → ChainP A f supf (supf b) 463 -- cp : (mf< : <-monotonic-f A f) {b : Ordinal } → b o≤ z → supf b o≤ z → ChainP A f supf (supf b)
464 -- the condition of cfcs is satisfied, this is obvious 464 -- the condition of cfcs is satisfied, this is obvious
465 465
466 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f) 466 record ZChain1 ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f)
477 as : A ∋ maximal 477 as : A ∋ maximal
478 ¬maximal<x : {x : HOD} → A ∋ x → ¬ maximal < x -- A is Partial, use negative 478 ¬maximal<x : {x : HOD} → A ∋ x → ¬ maximal < x -- A is Partial, use negative
479 479
480 record IChain (A : HOD) ( f : Ordinal → Ordinal ) {x : Ordinal } (supfz : {z : Ordinal } → z o< x → Ordinal) (z : Ordinal ) : Set n where 480 record IChain (A : HOD) ( f : Ordinal → Ordinal ) {x : Ordinal } (supfz : {z : Ordinal } → z o< x → Ordinal) (z : Ordinal ) : Set n where
481 field 481 field
482 i : Ordinal 482 i : Ordinal
483 i<x : i o< x 483 i<x : i o< x
484 fc : FClosure A f (supfz i<x) z 484 fc : FClosure A f (supfz i<x) z
485 485
486 -- 486 --
487 -- supf in TransFinite indution may differ each other, but it is the same because of the minimul sup 487 -- supf in TransFinite indution may differ each other, but it is the same because of the minimul sup
488 -- 488 --
489 supf-unique : ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f) 489 supf-unique : ( A : HOD ) ( f : Ordinal → Ordinal ) (mf< : <-monotonic-f A f)
490 {y xa xb : Ordinal} → (ay : odef A y) → (xa o≤ xb ) → (za : ZChain A f mf< ay xa ) (zb : ZChain A f mf< ay xb ) 490 {y xa xb : Ordinal} → (ay : odef A y) → (xa o≤ xb ) → (za : ZChain A f mf< ay xa ) (zb : ZChain A f mf< ay xb )
491 → {z : Ordinal } → z o≤ xa → ZChain.supf za z ≡ ZChain.supf zb z 491 → {z : Ordinal } → z o≤ xa → ZChain.supf za z ≡ ZChain.supf zb z
492 supf-unique A f mf< {y} {xa} {xb} ay xa≤xb za zb {z} z≤xa = TransFinite0 {λ z → z o≤ xa → ZChain.supf za z ≡ ZChain.supf zb z } ind z z≤xa where 492 supf-unique A f mf< {y} {xa} {xb} ay xa≤xb za zb {z} z≤xa = TransFinite0 {λ z → z o≤ xa → ZChain.supf za z ≡ ZChain.supf zb z } ind z z≤xa where
493 supfa = ZChain.supf za 493 supfa = ZChain.supf za
494 supfb = ZChain.supf zb 494 supfb = ZChain.supf zb
495 ind : (x : Ordinal) → ((w : Ordinal) → w o< x → w o≤ xa → supfa w ≡ supfb w) → x o≤ xa → supfa x ≡ supfb x 495 ind : (x : Ordinal) → ((w : Ordinal) → w o< x → w o≤ xa → supfa w ≡ supfb w) → x o≤ xa → supfa x ≡ supfb x
496 ind x prev x≤xa = sxa=sxb where 496 ind x prev x≤xa = sxa=sxb where
497 ma = ZChain.minsup za x≤xa 497 ma = ZChain.minsup za x≤xa
498 mb = ZChain.minsup zb (OrdTrans x≤xa xa≤xb ) 498 mb = ZChain.minsup zb (OrdTrans x≤xa xa≤xb )
499 spa = MinSUP.sup ma 499 spa = MinSUP.sup ma
500 spb = MinSUP.sup mb 500 spb = MinSUP.sup mb
501 sax=spa : supfa x ≡ spa 501 sax=spa : supfa x ≡ spa
502 sax=spa = ZChain.supf-is-minsup za x≤xa 502 sax=spa = ZChain.supf-is-minsup za x≤xa
503 sbx=spb : supfb x ≡ spb 503 sbx=spb : supfb x ≡ spb
504 sbx=spb = ZChain.supf-is-minsup zb (OrdTrans x≤xa xa≤xb ) 504 sbx=spb = ZChain.supf-is-minsup zb (OrdTrans x≤xa xa≤xb )
505 sxa=sxb : supfa x ≡ supfb x 505 sxa=sxb : supfa x ≡ supfb x
506 sxa=sxb with trio< (supfa x) (supfb x) 506 sxa=sxb with trio< (supfa x) (supfb x)
507 ... | tri≈ ¬a b ¬c = b 507 ... | tri≈ ¬a b ¬c = b
508 ... | tri< a ¬b ¬c = ⊥-elim ( o≤> ( 508 ... | tri< a ¬b ¬c = ⊥-elim ( o≤> (
509 begin 509 begin
510 supfb x ≡⟨ sbx=spb ⟩ 510 supfb x ≡⟨ sbx=spb ⟩
511 spb ≤⟨ MinSUP.minsup mb (MinSUP.as ma) (λ {z} uzb → MinSUP.x≤sup ma (z53 uzb)) ⟩ 511 spb ≤⟨ MinSUP.minsup mb (MinSUP.as ma) (λ {z} uzb → MinSUP.x≤sup ma (z53 uzb)) ⟩
512 spa ≡⟨ sym sax=spa ⟩ 512 spa ≡⟨ sym sax=spa ⟩
513 supfa x ∎ ) a ) where 513 supfa x ∎ ) a ) where
514 open o≤-Reasoning O 514 open o≤-Reasoning O
515 z53 : {z : Ordinal } → odef (UnionCF A f ay (ZChain.supf zb) x) z → odef (UnionCF A f ay (ZChain.supf za) x) z 515 z53 : {z : Ordinal } → odef (UnionCF A f ay (ZChain.supf zb) x) z → odef (UnionCF A f ay (ZChain.supf za) x) z
516 z53 ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫ 516 z53 ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫
517 z53 {z} ⟪ as , ch-is-sup u u<x su=u fc ⟫ = ⟪ as , ch-is-sup u u<x (trans ua=ub su=u) z55 ⟫ where 517 z53 {z} ⟪ as , ch-is-sup u u<x su=u fc ⟫ = ⟪ as , ch-is-sup u u<x (trans ua=ub su=u) z55 ⟫ where
518 ua=ub : supfa u ≡ supfb u 518 ua=ub : supfa u ≡ supfb u
519 ua=ub = prev u u<x (ordtrans u<x x≤xa ) 519 ua=ub = prev u u<x (ordtrans u<x x≤xa )
520 z55 : FClosure A f (ZChain.supf za u) z 520 z55 : FClosure A f (ZChain.supf za u) z
521 z55 = subst (λ k → FClosure A f k z ) (sym ua=ub) fc 521 z55 = subst (λ k → FClosure A f k z ) (sym ua=ub) fc
522 ... | tri> ¬a ¬b c = ⊥-elim ( o≤> ( 522 ... | tri> ¬a ¬b c = ⊥-elim ( o≤> (
523 begin 523 begin
524 supfa x ≡⟨ sax=spa ⟩ 524 supfa x ≡⟨ sax=spa ⟩
525 spa ≤⟨ MinSUP.minsup ma (MinSUP.as mb) (λ uza → MinSUP.x≤sup mb (z53 uza)) ⟩ 525 spa ≤⟨ MinSUP.minsup ma (MinSUP.as mb) (λ uza → MinSUP.x≤sup mb (z53 uza)) ⟩
526 spb ≡⟨ sym sbx=spb ⟩ 526 spb ≡⟨ sym sbx=spb ⟩
527 supfb x ∎ ) c ) where 527 supfb x ∎ ) c ) where
528 open o≤-Reasoning O 528 open o≤-Reasoning O
529 z53 : {z : Ordinal } → odef (UnionCF A f ay (ZChain.supf za) x) z → odef (UnionCF A f ay (ZChain.supf zb) x) z 529 z53 : {z : Ordinal } → odef (UnionCF A f ay (ZChain.supf za) x) z → odef (UnionCF A f ay (ZChain.supf zb) x) z
530 z53 ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫ 530 z53 ⟪ as , ch-init fc ⟫ = ⟪ as , ch-init fc ⟫
531 z53 {z} ⟪ as , ch-is-sup u u<x su=u fc ⟫ = ⟪ as , ch-is-sup u u<x (trans ub=ua su=u) z55 ⟫ where 531 z53 {z} ⟪ as , ch-is-sup u u<x su=u fc ⟫ = ⟪ as , ch-is-sup u u<x (trans ub=ua su=u) z55 ⟫ where
532 ub=ua : supfb u ≡ supfa u 532 ub=ua : supfb u ≡ supfa u
533 ub=ua = sym ( prev u u<x (ordtrans u<x x≤xa )) 533 ub=ua = sym ( prev u u<x (ordtrans u<x x≤xa ))
534 z55 : FClosure A f (ZChain.supf zb u) z 534 z55 : FClosure A f (ZChain.supf zb u) z
535 z55 = subst (λ k → FClosure A f k z ) (sym ub=ua) fc 535 z55 = subst (λ k → FClosure A f k z ) (sym ub=ua) fc
604 m03 not = ⊥-elim ( not s1 (z09 (SUP.ax S)) ⟪ SUP.ax S , m05 ⟫ ) where 604 m03 not = ⊥-elim ( not s1 (z09 (SUP.ax S)) ⟪ SUP.ax S , m05 ⟫ ) where
605 S : SUP A B 605 S : SUP A B
606 S = supP B B⊆A total 606 S = supP B B⊆A total
607 s1 = & (SUP.sup S) 607 s1 = & (SUP.sup S)
608 m05 : {w : Ordinal } → odef B w → (w ≡ s1 ) ∨ (w << s1 ) 608 m05 : {w : Ordinal } → odef B w → (w ≡ s1 ) ∨ (w << s1 )
609 m05 {w} bw with SUP.x≤sup S bw 609 m05 {w} bw with SUP.x≤sup S bw
610 ... | case1 eq = case1 ( subst₂ (λ j k → j ≡ k ) &iso refl (trans &iso eq)) 610 ... | case1 eq = case1 ( subst₂ (λ j k → j ≡ k ) &iso refl (trans &iso eq))
611 ... | case2 lt = case2 lt 611 ... | case2 lt = case2 lt
612 m02 : MinSUP A B 612 m02 : MinSUP A B
613 m02 = dont-or (m00 (& A)) m03 613 m02 = dont-or (m00 (& A)) m03
614 614
615 -- Uncountable ascending chain by axiom of choice 615 -- Uncountable ascending chain by axiom of choice
616 cf : ¬ Maximal A → Ordinal → Ordinal 616 cf : ¬ Maximal A → Ordinal → Ordinal
657 657
658 658
659 supf = ZChain.supf zc 659 supf = ZChain.supf zc
660 660
661 zc1 : (x : Ordinal ) → x o≤ & A → ZChain1 A f mf< ay zc x 661 zc1 : (x : Ordinal ) → x o≤ & A → ZChain1 A f mf< ay zc x
662 zc1 x x≤A with Oprev-p x 662 zc1 x x≤A with Oprev-p x
663 ... | yes op = record { is-max = is-max } where 663 ... | yes op = record { is-max = is-max } where
664 px = Oprev.oprev op 664 px = Oprev.oprev op
665 is-max : {a : Ordinal} {b : Ordinal} → odef (UnionCF A f ay supf x) a → 665 is-max : {a : Ordinal} {b : Ordinal} → odef (UnionCF A f ay supf x) a →
666 b o< x → (ab : odef A b) → 666 b o< x → (ab : odef A b) →
667 HasPrev A (UnionCF A f ay supf x) f b ∨ IsSUP A (UnionCF A f ay supf b) b → 667 HasPrev A (UnionCF A f ay supf x) f b ∨ IsSUP A (UnionCF A f ay supf b) b →
680 m10 : odef (UnionCF A f ay supf x) b 680 m10 : odef (UnionCF A f ay supf x) b
681 m10 = ZChain.cfcs zc b<x x≤A (subst (λ k → k o< x) (sym m05) b<x) (init (ZChain.asupf zc) m05) 681 m10 = ZChain.cfcs zc b<x x≤A (subst (λ k → k o< x) (sym m05) b<x) (init (ZChain.asupf zc) m05)
682 ... | case1 sb=sx = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf b) (ZChain.asupf zc)))) where 682 ... | case1 sb=sx = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf b) (ZChain.asupf zc)))) where
683 m17 : MinSUP A (UnionCF A f ay supf x) -- supf z o< supf ( supf x ) 683 m17 : MinSUP A (UnionCF A f ay supf x) -- supf z o< supf ( supf x )
684 m17 = ZChain.minsup zc x≤A 684 m17 = ZChain.minsup zc x≤A
685 m18 : supf x ≡ MinSUP.sup m17 685 m18 : supf x ≡ MinSUP.sup m17
686 m18 = ZChain.supf-is-minsup zc x≤A 686 m18 = ZChain.supf-is-minsup zc x≤A
687 m10 : f (supf b) ≡ supf b 687 m10 : f (supf b) ≡ supf b
688 m10 = fc-stop A f mf (ZChain.asupf zc) m11 sb=sx where 688 m10 = fc-stop A f mf (ZChain.asupf zc) m11 sb=sx where
689 m11 : {z : Ordinal} → FClosure A f (supf b) z → (z ≡ ZChain.supf zc x) ∨ (z << ZChain.supf zc x) 689 m11 : {z : Ordinal} → FClosure A f (supf b) z → (z ≡ ZChain.supf zc x) ∨ (z << ZChain.supf zc x)
690 m11 {z} fc = subst (λ k → (z ≡ k) ∨ (z << k)) (sym m18) ( MinSUP.x≤sup m17 m13 ) where 690 m11 {z} fc = subst (λ k → (z ≡ k) ∨ (z << k)) (sym m18) ( MinSUP.x≤sup m17 m13 ) where
720 m10 : odef (UnionCF A f ay supf x) b 720 m10 : odef (UnionCF A f ay supf x) b
721 m10 = ZChain.cfcs zc b<x x≤A (subst (λ k → k o< x) (sym m05) b<x) (init (ZChain.asupf zc) m05) 721 m10 = ZChain.cfcs zc b<x x≤A (subst (λ k → k o< x) (sym m05) b<x) (init (ZChain.asupf zc) m05)
722 ... | case1 sb=sx = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf b) (ZChain.asupf zc)))) where 722 ... | case1 sb=sx = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf b) (ZChain.asupf zc)))) where
723 m17 : MinSUP A (UnionCF A f ay supf x) -- supf z o< supf ( supf x ) 723 m17 : MinSUP A (UnionCF A f ay supf x) -- supf z o< supf ( supf x )
724 m17 = ZChain.minsup zc x≤A 724 m17 = ZChain.minsup zc x≤A
725 m18 : supf x ≡ MinSUP.sup m17 725 m18 : supf x ≡ MinSUP.sup m17
726 m18 = ZChain.supf-is-minsup zc x≤A 726 m18 = ZChain.supf-is-minsup zc x≤A
727 m10 : f (supf b) ≡ supf b 727 m10 : f (supf b) ≡ supf b
728 m10 = fc-stop A f mf (ZChain.asupf zc) m11 sb=sx where 728 m10 = fc-stop A f mf (ZChain.asupf zc) m11 sb=sx where
729 m11 : {z : Ordinal} → FClosure A f (supf b) z → (z ≡ ZChain.supf zc x) ∨ (z << ZChain.supf zc x) 729 m11 : {z : Ordinal} → FClosure A f (supf b) z → (z ≡ ZChain.supf zc x) ∨ (z << ZChain.supf zc x)
730 m11 {z} fc = subst (λ k → (z ≡ k) ∨ (z << k)) (sym m18) ( MinSUP.x≤sup m17 m13 ) where 730 m11 {z} fc = subst (λ k → (z ≡ k) ∨ (z << k)) (sym m18) ( MinSUP.x≤sup m17 m13 ) where
797 ... | tri≈ ¬a b ¬c = case1 (o≤-refl0 b) 797 ... | tri≈ ¬a b ¬c = case1 (o≤-refl0 b)
798 ... | tri> ¬a ¬b px<b with osuc-≡< b≤x 798 ... | tri> ¬a ¬b px<b with osuc-≡< b≤x
799 ... | case1 eq = case2 eq 799 ... | case1 eq = case2 eq
800 ... | case2 b<x = ⊥-elim ( ¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫ ) 800 ... | case2 b<x = ⊥-elim ( ¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫ )
801 801
802 mf : ≤-monotonic-f A f 802 mf : ≤-monotonic-f A f
803 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 803 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
804 mf00 : * x < * (f x) 804 mf00 : * x < * (f x)
805 mf00 = proj1 ( mf< x ax ) 805 mf00 = proj1 ( mf< x ax )
806 806
807 -- 807 --
918 918
919 sf≤ : { z : Ordinal } → x o≤ z → supf0 x o≤ supf1 z 919 sf≤ : { z : Ordinal } → x o≤ z → supf0 x o≤ supf1 z
920 sf≤ {z} x≤z with trio< z px 920 sf≤ {z} x≤z with trio< z px
921 ... | tri< a ¬b ¬c = ⊥-elim ( o<> (osucc a) (subst (λ k → k o≤ z) (sym (Oprev.oprev=x op)) x≤z ) ) 921 ... | tri< a ¬b ¬c = ⊥-elim ( o<> (osucc a) (subst (λ k → k o≤ z) (sym (Oprev.oprev=x op)) x≤z ) )
922 ... | tri≈ ¬a b ¬c = ⊥-elim ( o≤> x≤z (subst (λ k → k o< x ) (sym b) px<x )) 922 ... | tri≈ ¬a b ¬c = ⊥-elim ( o≤> x≤z (subst (λ k → k o< x ) (sym b) px<x ))
923 ... | tri> ¬a ¬b c = subst₂ (λ j k → j o≤ k ) (trans (sf1=sf0 o≤-refl ) (sym (ZChain.supfmax zc px<x))) (sf1=sp1 c) 923 ... | tri> ¬a ¬b c = subst₂ (λ j k → j o≤ k ) (trans (sf1=sf0 o≤-refl ) (sym (ZChain.supfmax zc px<x))) (sf1=sp1 c)
924 (supf1-mono (o<→≤ c )) 924 (supf1-mono (o<→≤ c ))
925 -- px o<z → supf x ≡ supf0 px ≡ supf1 px o≤ supf1 z 925 -- px o<z → supf x ≡ supf0 px ≡ supf1 px o≤ supf1 z
926 926
927 fcup : {u z : Ordinal } → FClosure A f (supf1 u) z → u o≤ px → FClosure A f (supf0 u) z 927 fcup : {u z : Ordinal } → FClosure A f (supf1 u) z → u o≤ px → FClosure A f (supf0 u) z
928 fcup {u} {z} fc u≤px = subst (λ k → FClosure A f k z ) (sf1=sf0 u≤px) fc 928 fcup {u} {z} fc u≤px = subst (λ k → FClosure A f k z ) (sf1=sf0 u≤px) fc
929 fcpu : {u z : Ordinal } → FClosure A f (supf0 u) z → u o≤ px → FClosure A f (supf1 u) z 929 fcpu : {u z : Ordinal } → FClosure A f (supf0 u) z → u o≤ px → FClosure A f (supf1 u) z
930 fcpu {u} {z} fc u≤px = subst (λ k → FClosure A f k z ) (sym (sf1=sf0 u≤px)) fc 930 fcpu {u} {z} fc u≤px = subst (λ k → FClosure A f k z ) (sym (sf1=sf0 u≤px)) fc
931 931
932 sfpx<x : sp1 o≤ x → supf0 px o< x 932 sfpx<x : sp1 o≤ x → supf0 px o< x
933 sfpx<x sp1≤x with trio< (supf0 px) x 933 sfpx<x sp1≤x with trio< (supf0 px) x
934 ... | tri< a ¬b ¬c = a 934 ... | tri< a ¬b ¬c = a
935 ... | tri≈ ¬a spx=x ¬c = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf0 px) (ZChain.asupf zc)))) where 935 ... | tri≈ ¬a spx=x ¬c = ⊥-elim (<-irr (case1 (cong (*) m10)) (proj1 (mf< (supf0 px) (ZChain.asupf zc)))) where
936 -- supf px ≡ x then the chain is stopped, which cannot happen when <-monotonic case 936 -- supf px ≡ x then the chain is stopped, which cannot happen when <-monotonic case
937 m12 : supf0 px ≡ sp1 937 m12 : supf0 px ≡ sp1
938 m12 with osuc-≡< m13 938 m12 with osuc-≡< m13
939 ... | case1 eq = eq 939 ... | case1 eq = eq
940 ... | case2 lt = ⊥-elim ( o≤> sp1≤x (subst (λ k → k o< sp1) spx=x lt )) 940 ... | case2 lt = ⊥-elim ( o≤> sp1≤x (subst (λ k → k o< sp1) spx=x lt ))
941 m10 : f (supf0 px) ≡ supf0 px 941 m10 : f (supf0 px) ≡ supf0 px
942 m10 = fc-stop A f mf (ZChain.asupf zc) m11 m12 where 942 m10 = fc-stop A f mf (ZChain.asupf zc) m11 m12 where
943 m11 : {z : Ordinal} → FClosure A f (supf0 px) z → (z ≡ sp1) ∨ (z << sp1) 943 m11 : {z : Ordinal} → FClosure A f (supf0 px) z → (z ≡ sp1) ∨ (z << sp1)
944 m11 {z} fc = MinSUP.x≤sup sup1 (case2 fc) 944 m11 {z} fc = MinSUP.x≤sup sup1 (case2 fc)
945 ... | tri> ¬a ¬b c = ⊥-elim ( o<¬≡ refl (ordtrans<-≤ c (OrdTrans m13 sp1≤x ))) -- x o< supf0 px o≤ sp1 ≤ x 945 ... | tri> ¬a ¬b c = ⊥-elim ( o<¬≡ refl (ordtrans<-≤ c (OrdTrans m13 sp1≤x ))) -- x o< supf0 px o≤ sp1 ≤ x
946 946
947 -- this is a kind of maximality, so we cannot prove this without <-monotonicity 947 -- this is a kind of maximality, so we cannot prove this without <-monotonicity
948 -- 948 --
949 cfcs : {a b w : Ordinal } 949 cfcs : {a b w : Ordinal }
950 → a o< b → b o≤ x → supf1 a o< b → FClosure A f (supf1 a) w → odef (UnionCF A f ay supf1 b) w 950 → a o< b → b o≤ x → supf1 a o< b → FClosure A f (supf1 a) w → odef (UnionCF A f ay supf1 b) w
951 cfcs {a} {b} {w} a<b b≤x sa<b fc with zc43 (supf0 a) px 951 cfcs {a} {b} {w} a<b b≤x sa<b fc with zc43 (supf0 a) px
952 ... | case2 px≤sa = z50 where 952 ... | case2 px≤sa = z50 where
953 a<x : a o< x 953 a<x : a o< x
954 a<x = ordtrans<-≤ a<b b≤x 954 a<x = ordtrans<-≤ a<b b≤x
961 ... | case1 px=sa = ⟪ A∋fc {A} _ f mf fc , cp ⟫ where 961 ... | case1 px=sa = ⟪ A∋fc {A} _ f mf fc , cp ⟫ where
962 sa≤px : supf0 a o≤ px 962 sa≤px : supf0 a o≤ px
963 sa≤px = subst₂ (λ j k → j o< k) px=sa (sym (Oprev.oprev=x op)) px<x 963 sa≤px = subst₂ (λ j k → j o< k) px=sa (sym (Oprev.oprev=x op)) px<x
964 spx=sa : supf0 px ≡ supf0 a 964 spx=sa : supf0 px ≡ supf0 a
965 spx=sa = begin 965 spx=sa = begin
966 supf0 px ≡⟨ cong supf0 px=sa ⟩ 966 supf0 px ≡⟨ cong supf0 px=sa ⟩
967 supf0 (supf0 a) ≡⟨ ZChain.supf-idem zc a≤px sa≤px ⟩ 967 supf0 (supf0 a) ≡⟨ ZChain.supf-idem zc a≤px sa≤px ⟩
968 supf0 a ∎ where open ≡-Reasoning 968 supf0 a ∎ where open ≡-Reasoning
969 z51 : supf0 px o< b 969 z51 : supf0 px o< b
970 z51 = subst (λ k → k o< b ) (sym ( begin supf0 px ≡⟨ spx=sa ⟩ 970 z51 = subst (λ k → k o< b ) (sym ( begin supf0 px ≡⟨ spx=sa ⟩
971 supf0 a ≡⟨ sym (sf1=sf0 a≤px) ⟩ 971 supf0 a ≡⟨ sym (sf1=sf0 a≤px) ⟩
972 supf1 a ∎ )) sa<b where open ≡-Reasoning 972 supf1 a ∎ )) sa<b where open ≡-Reasoning
973 z52 : supf1 a ≡ supf1 (supf0 px) 973 z52 : supf1 a ≡ supf1 (supf0 px)
974 z52 = begin supf1 a ≡⟨ sf1=sf0 a≤px ⟩ 974 z52 = begin supf1 a ≡⟨ sf1=sf0 a≤px ⟩
975 supf0 a ≡⟨ sym (ZChain.supf-idem zc a≤px sa≤px ) ⟩ 975 supf0 a ≡⟨ sym (ZChain.supf-idem zc a≤px sa≤px ) ⟩
976 supf0 (supf0 a) ≡⟨ sym (sf1=sf0 sa≤px) ⟩ 976 supf0 (supf0 a) ≡⟨ sym (sf1=sf0 sa≤px) ⟩
977 supf1 (supf0 a) ≡⟨ cong supf1 (sym spx=sa) ⟩ 977 supf1 (supf0 a) ≡⟨ cong supf1 (sym spx=sa) ⟩
978 supf1 (supf0 px) ∎ where open ≡-Reasoning 978 supf1 (supf0 px) ∎ where open ≡-Reasoning
979 z53 : supf1 (supf0 px) ≡ supf0 px 979 z53 : supf1 (supf0 px) ≡ supf0 px
980 z53 = begin 980 z53 = begin
981 supf1 (supf0 px) ≡⟨ cong supf1 spx=sa ⟩ 981 supf1 (supf0 px) ≡⟨ cong supf1 spx=sa ⟩
982 supf1 (supf0 a) ≡⟨ sf1=sf0 sa≤px ⟩ 982 supf1 (supf0 a) ≡⟨ sf1=sf0 sa≤px ⟩
983 supf0 (supf0 a) ≡⟨ sym ( cong supf0 px=sa ) ⟩ 983 supf0 (supf0 a) ≡⟨ sym ( cong supf0 px=sa ) ⟩
984 supf0 px ∎ where open ≡-Reasoning 984 supf0 px ∎ where open ≡-Reasoning
985 cp : UChain ay b w 985 cp : UChain ay b w
986 cp = ch-is-sup (supf0 px) z51 z53 (subst (λ k → FClosure A f k w) z52 fc) 986 cp = ch-is-sup (supf0 px) z51 z53 (subst (λ k → FClosure A f k w) z52 fc)
987 ... | case2 px<sa = ⊥-elim ( ¬p<x<op ⟪ px<sa , subst₂ (λ j k → j o< k ) (sf1=sf0 a≤px) (sym (Oprev.oprev=x op)) z53 ⟫ ) where 987 ... | case2 px<sa = ⊥-elim ( ¬p<x<op ⟪ px<sa , subst₂ (λ j k → j o< k ) (sf1=sf0 a≤px) (sym (Oprev.oprev=x op)) z53 ⟫ ) where
988 z53 : supf1 a o< x 988 z53 : supf1 a o< x
989 z53 = ordtrans<-≤ sa<b b≤x 989 z53 = ordtrans<-≤ sa<b b≤x
990 ... | case1 sa<px with trio< a px 990 ... | case1 sa<px with trio< a px
991 ... | tri< a<px ¬b ¬c = z50 where 991 ... | tri< a<px ¬b ¬c = z50 where
992 z50 : odef (UnionCF A f ay supf1 b) w 992 z50 : odef (UnionCF A f ay supf1 b) w
993 z50 with osuc-≡< b≤x 993 z50 with osuc-≡< b≤x
994 ... | case2 lt with ZChain.cfcs zc a<b (subst (λ k → b o< k) (sym (Oprev.oprev=x op)) lt) sa<b fc 994 ... | case2 lt with ZChain.cfcs zc a<b (subst (λ k → b o< k) (sym (Oprev.oprev=x op)) lt) sa<b fc
995 ... | ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫ 995 ... | ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫
996 ... | ⟪ az , ch-is-sup u u<b su=u fc ⟫ = ⟪ az , ch-is-sup u u<b (trans (sym (sf=eq u<x)) su=u) (fcpu fc u≤px ) ⟫ where 996 ... | ⟪ az , ch-is-sup u u<b su=u fc ⟫ = ⟪ az , ch-is-sup u u<b (trans (sym (sf=eq u<x)) su=u) (fcpu fc u≤px ) ⟫ where
997 u≤px : u o≤ px 997 u≤px : u o≤ px
998 u≤px = subst (λ k → u o< k) (sym (Oprev.oprev=x op)) (ordtrans<-≤ u<b b≤x ) 998 u≤px = subst (λ k → u o< k) (sym (Oprev.oprev=x op)) (ordtrans<-≤ u<b b≤x )
999 u<x : u o< x 999 u<x : u o< x
1000 u<x = ordtrans<-≤ u<b b≤x 1000 u<x = ordtrans<-≤ u<b b≤x
1001 z50 | case1 eq with ZChain.cfcs zc a<px o≤-refl sa<px fc 1001 z50 | case1 eq with ZChain.cfcs zc a<px o≤-refl sa<px fc
1002 ... | ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫ 1002 ... | ⟪ az , ch-init fc ⟫ = ⟪ az , ch-init fc ⟫
1003 ... | ⟪ az , ch-is-sup u u<px su=u fc ⟫ = ⟪ az , ch-is-sup u u<b (trans (sym (sf=eq u<x)) su=u) (fcpu fc (o<→≤ u<px)) ⟫ where -- u o< px → u o< b ? 1003 ... | ⟪ az , ch-is-sup u u<px su=u fc ⟫ = ⟪ az , ch-is-sup u u<b (trans (sym (sf=eq u<x)) su=u) (fcpu fc (o<→≤ u<px)) ⟫ where -- u o< px → u o< b ?
1004 u<b : u o< b 1004 u<b : u o< b
1005 u<b = subst (λ k → u o< k ) (trans (Oprev.oprev=x op) (sym eq) ) (ordtrans u<px <-osuc ) 1005 u<b = subst (λ k → u o< k ) (trans (Oprev.oprev=x op) (sym eq) ) (ordtrans u<px <-osuc )
1006 u<x : u o< x 1006 u<x : u o< x
1007 u<x = subst (λ k → u o< k ) (Oprev.oprev=x op) ( ordtrans u<px <-osuc ) 1007 u<x = subst (λ k → u o< k ) (Oprev.oprev=x op) ( ordtrans u<px <-osuc )
1008 ... | tri≈ ¬a a=px ¬c = csupf1 where 1008 ... | tri≈ ¬a a=px ¬c = csupf1 where
1009 -- a ≡ px , b ≡ x, sp o≤ x 1009 -- a ≡ px , b ≡ x, sp o≤ x
1010 px<b : px o< b 1010 px<b : px o< b
1011 px<b = subst₂ (λ j k → j o< k) a=px refl a<b 1011 px<b = subst₂ (λ j k → j o< k) a=px refl a<b
1012 b=x : b ≡ x 1012 b=x : b ≡ x
1013 b=x with trio< b x 1013 b=x with trio< b x
1014 ... | tri< a ¬b ¬c = ⊥-elim ( ¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) a ⟫ ) -- px o< b o< x 1014 ... | tri< a ¬b ¬c = ⊥-elim ( ¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) a ⟫ ) -- px o< b o< x
1017 z51 : FClosure A f (supf1 px) w 1017 z51 : FClosure A f (supf1 px) w
1018 z51 = subst (λ k → FClosure A f k w) (sym (trans (cong supf1 (sym a=px)) (sf1=sf0 (o≤-refl0 a=px) ))) fc 1018 z51 = subst (λ k → FClosure A f k w) (sym (trans (cong supf1 (sym a=px)) (sf1=sf0 (o≤-refl0 a=px) ))) fc
1019 z53 : odef A w 1019 z53 : odef A w
1020 z53 = A∋fc {A} _ f mf fc 1020 z53 = A∋fc {A} _ f mf fc
1021 csupf1 : odef (UnionCF A f ay supf1 b) w 1021 csupf1 : odef (UnionCF A f ay supf1 b) w
1022 csupf1 = ⟪ z53 , ch-is-sup spx (subst (λ k → spx o< k) (sym b=x) (sfpx<x ?)) z52 fc1 ⟫ where 1022 csupf1 with zc43 px (supf0 px)
1023 spx = supf0 px 1023 ... | case2 spx≤px = ⟪ z53 , ch-is-sup (supf0 px) z54 z52 fc1 ⟫ where
1024 spx≤px : supf0 px o≤ px 1024 z54 : supf0 px o< b
1025 spx≤px = zc-b<x _ (sfpx<x ?) 1025 z54 = subst (λ k → supf0 px o< k ) (trans (Oprev.oprev=x op) (sym b=x) ) spx≤px
1026 z52 : supf1 (supf0 px) ≡ supf0 px 1026 z52 : supf1 (supf0 px) ≡ supf0 px
1027 z52 = trans (sf1=sf0 (zc-b<x _ (sfpx<x ?))) ( ZChain.supf-idem zc o≤-refl (zc-b<x _ (sfpx<x ?) ) ) 1027 z52 = trans (sf1=sf0 spx≤px ) ( ZChain.supf-idem zc o≤-refl spx≤px )
1028 fc1 : FClosure A f (supf1 spx) w 1028 fc1 : FClosure A f (supf1 (supf0 px)) w
1029 fc1 = subst (λ k → FClosure A f k w ) (trans (cong supf0 a=px) (sym z52) ) fc 1029 fc1 = subst (λ k → FClosure A f k w ) (trans (cong supf0 a=px) (sym z52) ) fc
1030 ... | case1 px<spx = ⊥-elim (¬p<x<op ⟪ px<spx , z54 ⟫ ) where -- supf1 px o≤ spuf1 x → supf1 px ≡ x o< x
1031 z54 : supf0 px o≤ px
1032 z54 = subst₂ (λ j k → supf0 j o< k ) a=px (trans b=x (sym (Oprev.oprev=x op))) sa<b
1033
1030 ... | tri> ¬a ¬b c = ⊥-elim ( ¬p<x<op ⟪ c , subst (λ k → a o< k ) (sym (Oprev.oprev=x op)) ( ordtrans<-≤ a<b b≤x) ⟫ ) -- px o< a o< b o≤ x 1034 ... | tri> ¬a ¬b c = ⊥-elim ( ¬p<x<op ⟪ c , subst (λ k → a o< k ) (sym (Oprev.oprev=x op)) ( ordtrans<-≤ a<b b≤x) ⟫ ) -- px o< a o< b o≤ x
1031 1035
1032 zc11 : {z : Ordinal} → odef (UnionCF A f ay supf1 x) z → odef pchainpx z 1036 zc11 : {z : Ordinal} → odef (UnionCF A f ay supf1 x) z → odef pchainpx z
1033 zc11 {z} ⟪ az , ch-init fc ⟫ = case1 ⟪ az , ch-init fc ⟫ 1037 zc11 {z} ⟪ az , ch-init fc ⟫ = case1 ⟪ az , ch-init fc ⟫
1034 zc11 {z} ⟪ az , ch-is-sup u u<x su=u fc ⟫ = zc21 fc where 1038 zc11 {z} ⟪ az , ch-is-sup u u<x su=u fc ⟫ = zc21 fc where
1035 zc21 : {z1 : Ordinal } → FClosure A f (supf1 u) z1 → odef pchainpx z1 1039 zc21 : {z1 : Ordinal } → FClosure A f (supf1 u) z1 → odef pchainpx z1
1036 zc21 {z1} (fsuc z2 fc ) with zc21 fc 1040 zc21 {z1} (fsuc z2 fc ) with zc21 fc
1037 ... | case1 ⟪ ua1 , ch-init fc₁ ⟫ = case1 ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫ 1041 ... | case1 ⟪ ua1 , ch-init fc₁ ⟫ = case1 ⟪ proj2 ( mf _ ua1) , ch-init (fsuc _ fc₁) ⟫
1038 ... | case1 ⟪ ua1 , ch-is-sup u u<x su=u fc₁ ⟫ = case1 ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x su=u (fsuc _ fc₁) ⟫ 1042 ... | case1 ⟪ ua1 , ch-is-sup u u<x su=u fc₁ ⟫ = case1 ⟪ proj2 ( mf _ ua1) , ch-is-sup u u<x su=u (fsuc _ fc₁) ⟫
1039 ... | case2 fc = case2 (fsuc _ fc) 1043 ... | case2 fc = case2 (fsuc _ fc)
1040 zc21 (init asp refl ) with trio< (supf0 u) (supf0 px) 1044 zc21 (init asp refl ) with trio< (supf0 u) (supf0 px)
1041 ... | tri< a ¬b ¬c = case1 ⟪ asp , ch-is-sup u u<px (trans (sym (sf1=sf0 (o<→≤ u<px))) su=u )(init asp0 (sym (sf1=sf0 (o<→≤ u<px))) ) ⟫ where 1045 ... | tri< a ¬b ¬c = case1 ⟪ asp , ch-is-sup u u<px (trans (sym (sf1=sf0 (o<→≤ u<px))) su=u )(init asp0 (sym (sf1=sf0 (o<→≤ u<px))) ) ⟫ where
1042 u<px : u o< px 1046 u<px : u o< px
1043 u<px = ZChain.supf-inject zc a 1047 u<px = ZChain.supf-inject zc a
1044 asp0 : odef A (supf0 u) 1048 asp0 : odef A (supf0 u)
1045 asp0 = ZChain.asupf zc 1049 asp0 = ZChain.asupf zc
1046 ... | tri≈ ¬a b ¬c = case2 (init (subst (λ k → odef A k) b (ZChain.asupf zc) ) 1050 ... | tri≈ ¬a b ¬c = case2 (init (subst (λ k → odef A k) b (ZChain.asupf zc) )
1047 (sym (trans (sf1=sf0 (zc-b<x _ u<x)) b ))) 1051 (sym (trans (sf1=sf0 (zc-b<x _ u<x)) b )))
1048 ... | tri> ¬a ¬b c = ⊥-elim ( ¬p<x<op ⟪ ZChain.supf-inject zc c , subst (λ k → u o< k ) (sym (Oprev.oprev=x op)) u<x ⟫ ) 1052 ... | tri> ¬a ¬b c = ⊥-elim ( ¬p<x<op ⟪ ZChain.supf-inject zc c , subst (λ k → u o< k ) (sym (Oprev.oprev=x op)) u<x ⟫ )
1049 1053
1050 is-minsup : {z : Ordinal} → z o≤ x → IsMinSUP A (UnionCF A f ay supf1 z) (supf1 z) 1054 is-minsup : {z : Ordinal} → z o≤ x → IsMinSUP A (UnionCF A f ay supf1 z) (supf1 z)
1051 is-minsup {z} z≤x with osuc-≡< z≤x 1055 is-minsup {z} z≤x with osuc-≡< z≤x
1052 ... | case1 z=x = record { as = zc22 ; x≤sup = z23 ; minsup = z24 } where 1056 ... | case1 z=x = record { as = zc22 ; x≤sup = z23 ; minsup = z24 } where
1053 px<z : px o< z 1057 px<z : px o< z
1054 px<z = subst (λ k → px o< k) (sym z=x) px<x 1058 px<z = subst (λ k → px o< k) (sym z=x) px<x
1055 zc22 : odef A (supf1 z) 1059 zc22 : odef A (supf1 z)
1056 zc22 = subst (λ k → odef A k ) (sym (sf1=sp1 px<z )) ( MinSUP.as sup1 ) 1060 zc22 = subst (λ k → odef A k ) (sym (sf1=sp1 px<z )) ( MinSUP.as sup1 )
1057 z26 : supf1 px ≤ supf1 x 1061 z26 : supf1 px ≤ supf1 x
1058 z26 = subst₂ (λ j k → j ≤ k ) (sym (sf1=sf0 o≤-refl )) (sym (sf1=sp1 px<x )) sfpx≤sp1 1062 z26 = subst₂ (λ j k → j ≤ k ) (sym (sf1=sf0 o≤-refl )) (sym (sf1=sp1 px<x )) sfpx≤sp1
1059 z23 : {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ supf1 z 1063 z23 : {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ supf1 z
1060 z23 {w} uz with zc11 (subst (λ k → odef (UnionCF A f ay supf1 k) w) z=x uz ) 1064 z23 {w} uz with zc11 (subst (λ k → odef (UnionCF A f ay supf1 k) w) z=x uz )
1061 ... | case1 uz = ≤-ftrans z25 (subst₂ (λ j k → j ≤ supf1 k) (sf1=sf0 o≤-refl) (sym z=x) z26 ) where 1065 ... | case1 uz = ≤-ftrans z25 (subst₂ (λ j k → j ≤ supf1 k) (sf1=sf0 o≤-refl) (sym z=x) z26 ) where
1062 z25 : w ≤ supf0 px 1066 z25 : w ≤ supf0 px
1063 z25 = IsMinSUP.x≤sup (ZChain.is-minsup zc o≤-refl ) uz 1067 z25 = IsMinSUP.x≤sup (ZChain.is-minsup zc o≤-refl ) uz
1064 ... | case2 fc = subst (λ k → w ≤ k ) (sym (sf1=sp1 px<z)) ( MinSUP.x≤sup sup1 (case2 fc) ) 1068 ... | case2 fc = subst (λ k → w ≤ k ) (sym (sf1=sp1 px<z)) ( MinSUP.x≤sup sup1 (case2 fc) )
1065 z24 : {s : Ordinal } → odef A s → ( {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ s ) 1069 z24 : {s : Ordinal } → odef A s → ( {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ s )
1066 → supf1 z o≤ s 1070 → supf1 z o≤ s
1067 z24 {s} as sup = subst (λ k → k o≤ s ) (sym (sf1=sp1 px<z)) ( MinSUP.minsup sup1 as z25 ) where 1071 z24 {s} as sup = subst (λ k → k o≤ s ) (sym (sf1=sp1 px<z)) ( MinSUP.minsup sup1 as z25 ) where
1068 z25 : {w : Ordinal } → odef pchainpx w → w ≤ s 1072 z25 : {w : Ordinal } → odef pchainpx w → w ≤ s
1069 z25 {w} (case2 fc) = sup ⟪ A∋fc _ f mf fc , ch-is-sup (supf0 px) z28 z27 fc1 ⟫ where 1073 z25 {w} (case2 fc) = sup ⟪ A∋fc _ f mf fc , ch-is-sup (supf0 px) z28 z27 fc1 ⟫ where
1070 z28 : supf0 px o< z -- supf0 px ≡ supf1 px o≤ supf1 x o≤ 1074 -- z=x , supf0 px o< x
1075 z28 : supf0 px o< z -- supf0 px ≡ supf1 px o≤ supf1 x ≡ sp1 o≤ x ≡ z
1071 z28 = subst (λ k → supf0 px o< k) (sym z=x) (sfpx<x ?) 1076 z28 = subst (λ k → supf0 px o< k) (sym z=x) (sfpx<x ?)
1072 z29 : supf0 px o≤ px 1077 z29 : supf0 px o≤ px
1073 z29 = zc-b<x _ (sfpx<x ?) 1078 z29 = zc-b<x _ (sfpx<x ?)
1074 z27 : supf1 (supf0 px) ≡ supf0 px 1079 z27 : supf1 (supf0 px) ≡ supf0 px
1075 z27 = trans (sf1=sf0 z29) ( ZChain.supf-idem zc o≤-refl z29 ) 1080 z27 = trans (sf1=sf0 z29) ( ZChain.supf-idem zc o≤-refl z29 )
1076 fc1 : FClosure A f (supf1 (supf0 px)) w 1081 fc1 : FClosure A f (supf1 (supf0 px)) w
1077 fc1 = subst (λ k → FClosure A f k w) (sym z27) fc 1082 fc1 = subst (λ k → FClosure A f k w) (sym z27) fc
1083 -- x o≤ supf0 px o≤ supf0 z ≡ supf0 x ≡ sp1
1084 -- x o≤ supf0 px o≤ supf0 x ≡ sp1
1085 -- fc : FClosure A f (supf0 px) w -- ¬ ( supf0 px o< x ) → ¬ odef ( UnionCF A f ay supf1 z ) w
1078 z25 {w} (case1 ⟪ ua , ch-init fc ⟫) = sup ⟪ ua , ch-init fc ⟫ 1086 z25 {w} (case1 ⟪ ua , ch-init fc ⟫) = sup ⟪ ua , ch-init fc ⟫
1079 z25 {w} (case1 ⟪ ua , ch-is-sup u u<x su=u fc ⟫) = sup ⟪ ua , ch-is-sup u u<z 1087 z25 {w} (case1 ⟪ ua , ch-is-sup u u<x su=u fc ⟫) = sup ⟪ ua , ch-is-sup u u<z
1080 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where 1088 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where
1081 u≤px : u o< osuc px 1089 u≤px : u o< osuc px
1082 u≤px = ordtrans u<x <-osuc 1090 u≤px = ordtrans u<x <-osuc
1083 u<z : u o< z 1091 u<z : u o< z
1084 u<z = ordtrans u<x (subst (λ k → px o< k ) (sym z=x) px<x ) 1092 u<z = ordtrans u<x (subst (λ k → px o< k ) (sym z=x) px<x )
1085 ... | case2 z<x = record { as = zc22 ; x≤sup = z23 ; minsup = z24 } where 1093 ... | case2 z<x = record { as = zc22 ; x≤sup = z23 ; minsup = z24 } where
1086 z≤px = zc-b<x _ z<x 1094 z≤px = zc-b<x _ z<x
1087 m = ZChain.is-minsup zc z≤px 1095 m = ZChain.is-minsup zc z≤px
1088 zc22 : odef A (supf1 z) 1096 zc22 : odef A (supf1 z)
1089 zc22 = subst (λ k → odef A k ) (sym (sf1=sf0 z≤px)) ( IsMinSUP.as m ) 1097 zc22 = subst (λ k → odef A k ) (sym (sf1=sf0 z≤px)) ( IsMinSUP.as m )
1090 z23 : {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ supf1 z 1098 z23 : {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ supf1 z
1091 z23 {w} ⟪ ua , ch-init fc ⟫ = subst (λ k → w ≤ k ) (sym (sf1=sf0 z≤px)) ( ZChain.fcy<sup zc z≤px fc ) 1099 z23 {w} ⟪ ua , ch-init fc ⟫ = subst (λ k → w ≤ k ) (sym (sf1=sf0 z≤px)) ( ZChain.fcy<sup zc z≤px fc )
1092 z23 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = subst (λ k → w ≤ k ) (sym (sf1=sf0 z≤px)) 1100 z23 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = subst (λ k → w ≤ k ) (sym (sf1=sf0 z≤px))
1093 (IsMinSUP.x≤sup m ⟪ ua , ch-is-sup u u<x (trans (sym (sf1=sf0 u≤px )) su=u) (fcup fc u≤px ) ⟫ ) where 1101 (IsMinSUP.x≤sup m ⟪ ua , ch-is-sup u u<x (trans (sym (sf1=sf0 u≤px )) su=u) (fcup fc u≤px ) ⟫ ) where
1094 u≤px : u o≤ px 1102 u≤px : u o≤ px
1095 u≤px = ordtrans u<x z≤px 1103 u≤px = ordtrans u<x z≤px
1096 z24 : {s : Ordinal } → odef A s → ( {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ s ) 1104 z24 : {s : Ordinal } → odef A s → ( {w : Ordinal } → odef ( UnionCF A f ay supf1 z ) w → w ≤ s )
1097 → supf1 z o≤ s 1105 → supf1 z o≤ s
1098 z24 {s} as sup = subst (λ k → k o≤ s ) (sym (sf1=sf0 z≤px)) ( IsMinSUP.minsup m as z25 ) where 1106 z24 {s} as sup = subst (λ k → k o≤ s ) (sym (sf1=sf0 z≤px)) ( IsMinSUP.minsup m as z25 ) where
1099 z25 : {w : Ordinal } → odef ( UnionCF A f ay supf0 z ) w → w ≤ s 1107 z25 : {w : Ordinal } → odef ( UnionCF A f ay supf0 z ) w → w ≤ s
1100 z25 {w} ⟪ ua , ch-init fc ⟫ = sup ⟪ ua , ch-init fc ⟫ 1108 z25 {w} ⟪ ua , ch-init fc ⟫ = sup ⟪ ua , ch-init fc ⟫
1101 z25 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = sup ⟪ ua , ch-is-sup u u<x 1109 z25 {w} ⟪ ua , ch-is-sup u u<x su=u fc ⟫ = sup ⟪ ua , ch-is-sup u u<x
1102 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where 1110 (trans (sf1=sf0 u≤px) su=u) (fcpu fc u≤px) ⟫ where
1103 u≤px : u o≤ px 1111 u≤px : u o≤ px
1104 u≤px = ordtrans u<x z≤px 1112 u≤px = ordtrans u<x z≤px
1105 1113
1106 order : {a b : Ordinal} {w : Ordinal} → 1114 order : {a b : Ordinal} {w : Ordinal} →
1107 b o≤ x → a o< b → FClosure A f (supf1 a) w → w ≤ supf1 b 1115 b o≤ x → a o< b → FClosure A f (supf1 a) w → w ≤ supf1 b
1108 order {a} {b} {w} b≤x a<b fc with trio< b px 1116 order {a} {b} {w} b≤x a<b fc with trio< b px
1109 ... | tri< b<px ¬b ¬c = ZChain.order zc (o<→≤ b<px) a<b (fcup fc (o<→≤ (ordtrans a<b b<px) )) 1117 ... | tri< b<px ¬b ¬c = ZChain.order zc (o<→≤ b<px) a<b (fcup fc (o<→≤ (ordtrans a<b b<px) ))
1110 ... | tri≈ ¬a b=px ¬c = ZChain.order zc (o≤-refl0 b=px) a<b (fcup fc (o<→≤ (subst (λ k → a o< k) b=px a<b ))) 1118 ... | tri≈ ¬a b=px ¬c = ZChain.order zc (o≤-refl0 b=px) a<b (fcup fc (o<→≤ (subst (λ k → a o< k) b=px a<b )))
1111 ... | tri> ¬a ¬b px<b with trio< a px 1119 ... | tri> ¬a ¬b px<b with trio< a px
1112 ... | tri< a<px ¬b ¬c = ≤-ftrans (ZChain.order zc o≤-refl a<px fc) sfpx≤sp1 -- supf1 a ≡ supf0 a 1120 ... | tri< a<px ¬b ¬c = ≤-ftrans (ZChain.order zc o≤-refl a<px fc) sfpx≤sp1 -- supf1 a ≡ supf0 a
1113 ... | tri≈ ¬a a=px ¬c = MinSUP.x≤sup sup1 (case2 (subst (λ k → FClosure A f (supf0 k) w) a=px fc )) 1121 ... | tri≈ ¬a a=px ¬c = MinSUP.x≤sup sup1 (case2 (subst (λ k → FClosure A f (supf0 k) w) a=px fc ))
1114 ... | tri> ¬a ¬b px<a = ⊥-elim (¬p<x<op ⟪ px<a , zc22 ⟫ ) where -- supf1 a ≡ sp1 1122 ... | tri> ¬a ¬b px<a = ⊥-elim (¬p<x<op ⟪ px<a , zc22 ⟫ ) where -- supf1 a ≡ sp1
1115 zc22 : a o< osuc px 1123 zc22 : a o< osuc px
1116 zc22 = subst (λ k → a o< k ) (sym (Oprev.oprev=x op)) (ordtrans<-≤ a<b b≤x) 1124 zc22 = subst (λ k → a o< k ) (sym (Oprev.oprev=x op)) (ordtrans<-≤ a<b b≤x)
1117 1125
1118 sup=u : {b : Ordinal} (ab : odef A b) → 1126 sup=u : {b : Ordinal} (ab : odef A b) →
1124 zc30 : x ≡ b 1132 zc30 : x ≡ b
1125 zc30 with osuc-≡< b≤x 1133 zc30 with osuc-≡< b≤x
1126 ... | case1 eq = sym (eq) 1134 ... | case1 eq = sym (eq)
1127 ... | case2 b<x = ⊥-elim (¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫ ) 1135 ... | case2 b<x = ⊥-elim (¬p<x<op ⟪ px<b , subst (λ k → b o< k ) (sym (Oprev.oprev=x op)) b<x ⟫ )
1128 zc31 : sp1 o≤ b 1136 zc31 : sp1 o≤ b
1129 zc31 = MinSUP.minsup sup1 ab zc32 where 1137 zc31 = MinSUP.minsup sup1 ab zc32 where
1130 zc32 : {w : Ordinal } → odef pchainpx w → (w ≡ b) ∨ (w << b) 1138 zc32 : {w : Ordinal } → odef pchainpx w → (w ≡ b) ∨ (w << b)
1131 zc32 = ? 1139 zc32 = ?
1132 1140
1133 ... | no lim with trio< x o∅ 1141 ... | no lim with trio< x o∅
1134 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a ) 1142 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a )
1135 ... | tri≈ ¬a b ¬c = record { supf = ? ; sup=u = ? ; asupf = ? ; supf-mono = ? ; order = ? 1143 ... | tri≈ ¬a b ¬c = record { supf = ? ; sup=u = ? ; asupf = ? ; supf-mono = ? ; order = ?
1136 ; supfmax = ? ; is-minsup = ? ; cfcs = ? } 1144 ; supfmax = ? ; is-minsup = ? ; cfcs = ? }
1137 ... | tri> ¬a ¬b 0<x = record { supf = supf1 ; sup=u = ? ; asupf = ? ; supf-mono = supf-mono ; order = ? 1145 ... | tri> ¬a ¬b 0<x = record { supf = supf1 ; sup=u = ? ; asupf = ? ; supf-mono = supf-mono ; order = ?
1138 ; supfmax = ? ; is-minsup = ? ; cfcs = cfcs } where 1146 ; supfmax = ? ; is-minsup = ? ; cfcs = cfcs } where
1139 1147
1140 -- mf : ≤-monotonic-f A f 1148 -- mf : ≤-monotonic-f A f
1141 -- mf x ax = ? -- ⟪ case2 ( proj1 (mf< x ax)) , proj2 (mf< x ax ) ⟫ will result memory exhaust 1149 -- mf x ax = ? -- ⟪ case2 ( proj1 (mf< x ax)) , proj2 (mf< x ax ) ⟫ will result memory exhaust
1142 1150
1143 mf : ≤-monotonic-f A f 1151 mf : ≤-monotonic-f A f
1144 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 1152 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
1145 mf00 : * x < * (f x) 1153 mf00 : * x < * (f x)
1146 mf00 = proj1 ( mf< x ax ) 1154 mf00 = proj1 ( mf< x ax )
1147 1155
1148 pzc : {z : Ordinal} → z o< x → ZChain A f mf< ay z 1156 pzc : {z : Ordinal} → z o< x → ZChain A f mf< ay z
1159 zc00 {z} ic = z09 ( A∋fc (supfz (IChain.i<x ic)) f mf (IChain.fc ic) ) 1167 zc00 {z} ic = z09 ( A∋fc (supfz (IChain.i<x ic)) f mf (IChain.fc ic) )
1160 1168
1161 aic : {z : Ordinal } → IChain A f supfz z → odef A z 1169 aic : {z : Ordinal } → IChain A f supfz z → odef A z
1162 aic {z} ic = A∋fc _ f mf (IChain.fc ic ) 1170 aic {z} ic = A∋fc _ f mf (IChain.fc ic )
1163 1171
1164 zeq : {xa xb z : Ordinal } 1172 zeq : {xa xb z : Ordinal }
1165 → (xa<x : xa o< x) → (xb<x : xb o< x) → xa o≤ xb → z o≤ xa 1173 → (xa<x : xa o< x) → (xb<x : xb o< x) → xa o≤ xb → z o≤ xa
1166 → ZChain.supf (pzc xa<x) z ≡ ZChain.supf (pzc xb<x) z 1174 → ZChain.supf (pzc xa<x) z ≡ ZChain.supf (pzc xb<x) z
1167 zeq {xa} {xb} {z} xa<x xb<x xa≤xb z≤xa = supf-unique A f mf< ay xa≤xb 1175 zeq {xa} {xb} {z} xa<x xb<x xa≤xb z≤xa = supf-unique A f mf< ay xa≤xb
1168 (pzc xa<x) (pzc xb<x) z≤xa 1176 (pzc xa<x) (pzc xb<x) z≤xa
1169 1177
1170 iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y 1178 iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y
1171 iceq refl = cong supfz o<-irr 1179 iceq refl = cong supfz o<-irr
1172 1180
1173 ifc≤ : {za zb : Ordinal } ( ia : IChain A f supfz za ) ( ib : IChain A f supfz zb ) → (ia≤ib : IChain.i ia o≤ IChain.i ib ) 1181 ifc≤ : {za zb : Ordinal } ( ia : IChain A f supfz za ) ( ib : IChain A f supfz zb ) → (ia≤ib : IChain.i ia o≤ IChain.i ib )
1174 → FClosure A f (ZChain.supf (pzc (ob<x lim (IChain.i<x ib))) (IChain.i ia)) za 1182 → FClosure A f (ZChain.supf (pzc (ob<x lim (IChain.i<x ib))) (IChain.i ia)) za
1175 ifc≤ {za} {zb} ia ib ia≤ib = subst (λ k → FClosure A f k _ ) (zeq _ _ (osucc ia≤ib) (o<→≤ <-osuc) ) (IChain.fc ia) 1183 ifc≤ {za} {zb} ia ib ia≤ib = subst (λ k → FClosure A f k _ ) (zeq _ _ (osucc ia≤ib) (o<→≤ <-osuc) ) (IChain.fc ia)
1176 1184
1177 ptotalx : IsTotalOrderSet pchainx 1185 ptotalx : IsTotalOrderSet pchainx
1178 ptotalx {a} {b} ia ib = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where 1186 ptotalx {a} {b} ia ib = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where
1179 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 1187 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
1180 uz01 with trio< (IChain.i ia) (IChain.i ib) 1188 uz01 with trio< (IChain.i ia) (IChain.i ib)
1181 ... | tri< ia<ib ¬b ¬c with 1189 ... | tri< ia<ib ¬b ¬c with
1182 ≤-ftrans (ZChain.order (pzc (ob<x lim (IChain.i<x ib))) ? ia<ib (ifc≤ ia ib (o<→≤ ia<ib))) (s≤fc _ f mf (IChain.fc ib)) 1190 ≤-ftrans (ZChain.order (pzc (ob<x lim (IChain.i<x ib))) ? ia<ib (ifc≤ ia ib (o<→≤ ia<ib))) (s≤fc _ f mf (IChain.fc ib))
1183 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 1191 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
1184 ct00 : * (& a) ≡ * (& b) 1192 ct00 : * (& a) ≡ * (& b)
1185 ct00 = cong (*) eq1 1193 ct00 = cong (*) eq1
1186 ... | case2 lt = tri< lt (λ eq → <-irr (case1 (sym eq)) lt) (λ lt1 → <-irr (case2 lt) lt1) 1194 ... | case2 lt = tri< lt (λ eq → <-irr (case1 (sym eq)) lt) (λ lt1 → <-irr (case2 lt) lt1)
1187 uz01 | tri≈ ¬a ia=ib ¬c = fcn-cmp _ f mf (IChain.fc ia) (subst (λ k → FClosure A f k (& b)) (sym (iceq ia=ib)) (IChain.fc ib)) 1195 uz01 | tri≈ ¬a ia=ib ¬c = fcn-cmp _ f mf (IChain.fc ia) (subst (λ k → FClosure A f k (& b)) (sym (iceq ia=ib)) (IChain.fc ib))
1188 uz01 | tri> ¬a ¬b ib<ia with 1196 uz01 | tri> ¬a ¬b ib<ia with
1189 ≤-ftrans (ZChain.order (pzc (ob<x lim (IChain.i<x ia))) ? ib<ia (ifc≤ ib ia (o<→≤ ib<ia))) (s≤fc _ f mf (IChain.fc ia)) 1197 ≤-ftrans (ZChain.order (pzc (ob<x lim (IChain.i<x ia))) ? ib<ia (ifc≤ ib ia (o<→≤ ib<ia))) (s≤fc _ f mf (IChain.fc ia))
1190 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 1198 ... | case1 eq1 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
1191 ct00 : * (& a) ≡ * (& b) 1199 ct00 : * (& a) ≡ * (& b)
1192 ct00 = sym (cong (*) eq1) 1200 ct00 = sym (cong (*) eq1)
1196 usup = minsupP pchainx (λ ic → A∋fc _ f mf (IChain.fc ic ) ) ptotalx 1204 usup = minsupP pchainx (λ ic → A∋fc _ f mf (IChain.fc ic ) ) ptotalx
1197 spu = MinSUP.sup usup 1205 spu = MinSUP.sup usup
1198 1206
1199 supf1 : Ordinal → Ordinal 1207 supf1 : Ordinal → Ordinal
1200 supf1 z with trio< z x 1208 supf1 z with trio< z x
1201 ... | tri< a ¬b ¬c = ZChain.supf (pzc (ob<x lim a)) z 1209 ... | tri< a ¬b ¬c = ZChain.supf (pzc (ob<x lim a)) z
1202 ... | tri≈ ¬a b ¬c = spu 1210 ... | tri≈ ¬a b ¬c = spu
1203 ... | tri> ¬a ¬b c = spu 1211 ... | tri> ¬a ¬b c = spu
1204 1212
1205 pchain : HOD 1213 pchain : HOD
1206 pchain = UnionCF A f ay supf1 x 1214 pchain = UnionCF A f ay supf1 x
1210 ptotal : IsTotalOrderSet pchain 1218 ptotal : IsTotalOrderSet pchain
1211 ptotal {a} {b} ca cb = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where 1219 ptotal {a} {b} ca cb = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso uz01 where
1212 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 1220 uz01 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
1213 uz01 = ? -- chain-total A f mf ay supf1 ( (proj2 ca)) ( (proj2 cb)) 1221 uz01 = ? -- chain-total A f mf ay supf1 ( (proj2 ca)) ( (proj2 cb))
1214 1222
1215 sf1=sf : {z : Ordinal } → (a : z o< x ) → supf1 z ≡ ZChain.supf (pzc (ob<x lim a)) z 1223 sf1=sf : {z : Ordinal } → (a : z o< x ) → supf1 z ≡ ZChain.supf (pzc (ob<x lim a)) z
1216 sf1=sf {z} z<x with trio< z x 1224 sf1=sf {z} z<x with trio< z x
1217 ... | tri< a ¬b ¬c = cong ( λ k → ZChain.supf (pzc (ob<x lim k)) z) o<-irr 1225 ... | tri< a ¬b ¬c = cong ( λ k → ZChain.supf (pzc (ob<x lim k)) z) o<-irr
1218 ... | tri≈ ¬a b ¬c = ⊥-elim (¬a z<x) 1226 ... | tri≈ ¬a b ¬c = ⊥-elim (¬a z<x)
1219 ... | tri> ¬a ¬b c = ⊥-elim (¬a z<x) 1227 ... | tri> ¬a ¬b c = ⊥-elim (¬a z<x)
1220 1228
1242 is-minsup : {z : Ordinal} → z o≤ x → IsMinSUP A (UnionCF A f ay supf1 z) (supf1 z) 1250 is-minsup : {z : Ordinal} → z o≤ x → IsMinSUP A (UnionCF A f ay supf1 z) (supf1 z)
1243 is-minsup = ? 1251 is-minsup = ?
1244 1252
1245 cfcs : {a b w : Ordinal } → a o< b → b o≤ x → supf1 a o< b → FClosure A f (supf1 a) w → odef (UnionCF A f ay supf1 b) w 1253 cfcs : {a b w : Ordinal } → a o< b → b o≤ x → supf1 a o< b → FClosure A f (supf1 a) w → odef (UnionCF A f ay supf1 b) w
1246 cfcs {a} {b} {w} a<b b≤x sa<b fc with osuc-≡< b≤x 1254 cfcs {a} {b} {w} a<b b≤x sa<b fc with osuc-≡< b≤x
1247 ... | case1 b=x with trio< a x 1255 ... | case1 b=x with trio< a x
1248 ... | tri< a<x ¬b ¬c = zc40 where 1256 ... | tri< a<x ¬b ¬c = zc40 where
1249 sa = ZChain.supf (pzc (ob<x lim a<x)) a 1257 sa = ZChain.supf (pzc (ob<x lim a<x)) a
1250 m = omax a sa -- x is limit ordinal, so we have sa o< m o< x 1258 m = omax a sa -- x is limit ordinal, so we have sa o< m o< x
1251 m<x : m o< x 1259 m<x : m o< x
1252 m<x with trio< a sa | inspect (omax a) sa 1260 m<x with trio< a sa | inspect (omax a) sa
1257 osuc ( omax a sa ) ≡⟨ cong (λ k → osuc (omax a k)) (sym a=sa) ⟩ 1265 osuc ( omax a sa ) ≡⟨ cong (λ k → osuc (omax a k)) (sym a=sa) ⟩
1258 osuc ( omax a a ) ≡⟨ cong osuc (omxx _) ⟩ 1266 osuc ( omax a a ) ≡⟨ cong osuc (omxx _) ⟩
1259 osuc ( osuc a ) ≤⟨ o<→≤ (ob<x lim (ob<x lim a<x)) ⟩ 1267 osuc ( osuc a ) ≤⟨ o<→≤ (ob<x lim (ob<x lim a<x)) ⟩
1260 x ∎ ) where open o≤-Reasoning O 1268 x ∎ ) where open o≤-Reasoning O
1261 ... | tri> ¬a ¬b c | record { eq = eq } = ob<x lim a<x 1269 ... | tri> ¬a ¬b c | record { eq = eq } = ob<x lim a<x
1262 sam = ZChain.supf (pzc (ob<x lim m<x)) a 1270 sam = ZChain.supf (pzc (ob<x lim m<x)) a
1263 zc42 : osuc a o≤ osuc m 1271 zc42 : osuc a o≤ osuc m
1264 zc42 = osucc (o<→≤ ( omax-x _ _ ) ) 1272 zc42 = osucc (o<→≤ ( omax-x _ _ ) )
1265 sam<m : sam o< m 1273 sam<m : sam o< m
1266 sam<m = subst (λ k → k o< m ) (supf-unique A f mf< ay zc42 (pzc (ob<x lim a<x)) (pzc (ob<x lim m<x)) (o<→≤ <-osuc)) ( omax-y _ _ ) 1274 sam<m = subst (λ k → k o< m ) (supf-unique A f mf< ay zc42 (pzc (ob<x lim a<x)) (pzc (ob<x lim m<x)) (o<→≤ <-osuc)) ( omax-y _ _ )
1267 fcm : FClosure A f (ZChain.supf (pzc (ob<x lim m<x)) a) w 1275 fcm : FClosure A f (ZChain.supf (pzc (ob<x lim m<x)) a) w
1268 fcm = subst (λ k → FClosure A f k w ) (zeq (ob<x lim a<x) (ob<x lim m<x) zc42 (o<→≤ <-osuc) ) fc 1276 fcm = subst (λ k → FClosure A f k w ) (zeq (ob<x lim a<x) (ob<x lim m<x) zc42 (o<→≤ <-osuc) ) fc
1269 zcm : odef (UnionCF A f ay (ZChain.supf (pzc (ob<x lim m<x))) (osuc (omax a sa))) w 1277 zcm : odef (UnionCF A f ay (ZChain.supf (pzc (ob<x lim m<x))) (osuc (omax a sa))) w
1270 zcm = ZChain.cfcs (pzc (ob<x lim m<x)) (o<→≤ (omax-x _ _)) o≤-refl (o<→≤ sam<m) fcm 1278 zcm = ZChain.cfcs (pzc (ob<x lim m<x)) (o<→≤ (omax-x _ _)) o≤-refl (o<→≤ sam<m) fcm
1271 zc40 : odef (UnionCF A f ay supf1 b) w 1279 zc40 : odef (UnionCF A f ay supf1 b) w
1272 zc40 with ZChain.cfcs (pzc (ob<x lim m<x)) (o<→≤ (omax-x _ _)) o≤-refl (o<→≤ sam<m) fcm 1280 zc40 with ZChain.cfcs (pzc (ob<x lim m<x)) (o<→≤ (omax-x _ _)) o≤-refl (o<→≤ sam<m) fcm
1273 ... | ⟪ az , cp ⟫ = ⟪ az , ? ⟫ 1281 ... | ⟪ az , cp ⟫ = ⟪ az , ? ⟫
1274 ... | tri≈ ¬a b ¬c = ⊥-elim ( ¬a (ordtrans<-≤ a<b b≤x)) 1282 ... | tri≈ ¬a b ¬c = ⊥-elim ( ¬a (ordtrans<-≤ a<b b≤x))
1275 ... | tri> ¬a ¬b c = ⊥-elim ( ¬a (ordtrans<-≤ a<b b≤x)) 1283 ... | tri> ¬a ¬b c = ⊥-elim ( ¬a (ordtrans<-≤ a<b b≤x))
1276 cfcs {a} {b} {w} a<b b≤x sa<b fc | case2 b<x = zc40 where 1284 cfcs {a} {b} {w} a<b b≤x sa<b fc | case2 b<x = zc40 where
1277 supfb = ZChain.supf (pzc (ob<x lim b<x)) 1285 supfb = ZChain.supf (pzc (ob<x lim b<x))
1278 sb=sa : {a : Ordinal } → a o< b → supf1 a ≡ ZChain.supf (pzc (ob<x lim b<x)) a 1286 sb=sa : {a : Ordinal } → a o< b → supf1 a ≡ ZChain.supf (pzc (ob<x lim b<x)) a
1279 sb=sa {a} a<b = trans (sf1=sf (ordtrans<-≤ a<b b≤x)) (zeq _ _ (o<→≤ (osucc a<b)) (o<→≤ <-osuc) ) 1287 sb=sa {a} a<b = trans (sf1=sf (ordtrans<-≤ a<b b≤x)) (zeq _ _ (o<→≤ (osucc a<b)) (o<→≤ <-osuc) )
1280 fcb : FClosure A f (supfb a) w 1288 fcb : FClosure A f (supfb a) w
1281 fcb = subst (λ k → FClosure A f k w) (sb=sa a<b) fc 1289 fcb = subst (λ k → FClosure A f k w) (sb=sa a<b) fc
1282 -- supfb a o< b assures it is in Union b 1290 -- supfb a o< b assures it is in Union b
1283 zcb : odef (UnionCF A f ay supfb b) w 1291 zcb : odef (UnionCF A f ay supfb b) w
1284 zcb = ZChain.cfcs (pzc (ob<x lim b<x)) a<b (o<→≤ <-osuc) (subst (λ k → k o< b) (sb=sa a<b) sa<b) fcb 1292 zcb = ZChain.cfcs (pzc (ob<x lim b<x)) a<b (o<→≤ <-osuc) (subst (λ k → k o< b) (sb=sa a<b) sa<b) fcb
1285 zc40 : odef (UnionCF A f ay supf1 b) w 1293 zc40 : odef (UnionCF A f ay supf1 b) w
1286 zc40 with zcb 1294 zc40 with zcb
1287 ... | ⟪ az , cp ⟫ = ⟪ az , ? ⟫ 1295 ... | ⟪ az , cp ⟫ = ⟪ az , ? ⟫
1288 1296
1289 sup=u : {b : Ordinal} (ab : odef A b) → 1297 sup=u : {b : Ordinal} (ab : odef A b) →
1290 b o≤ x → IsMinSUP A (UnionCF A f ay supf1 b) b ∧ (¬ HasPrev A (UnionCF A f ay supf1 b) f b ) → supf1 b ≡ b 1298 b o≤ x → IsMinSUP A (UnionCF A f ay supf1 b) b ∧ (¬ HasPrev A (UnionCF A f ay supf1 b) f b ) → supf1 b ≡ b
1291 sup=u {b} ab b≤x is-sup with osuc-≡< b≤x 1299 sup=u {b} ab b≤x is-sup with osuc-≡< b≤x
1292 ... | case1 b=x = ? where 1300 ... | case1 b=x = ? where
1293 zc31 : spu o≤ b 1301 zc31 : spu o≤ b
1294 zc31 = MinSUP.minsup usup ab zc32 where 1302 zc31 = MinSUP.minsup usup ab zc32 where
1295 zc32 : {w : Ordinal } → odef pchainx w → (w ≡ b) ∨ (w << b) 1303 zc32 : {w : Ordinal } → odef pchainx w → (w ≡ b) ∨ (w << b)
1296 zc32 = ? 1304 zc32 = ?
1297 ... | case2 b<x = trans (sf1=sf ?) (ZChain.sup=u (pzc (ob<x lim b<x)) ab ? ? ) 1305 ... | case2 b<x = trans (sf1=sf ?) (ZChain.sup=u (pzc (ob<x lim b<x)) ab ? ? )
1298 --- 1306 ---
1299 --- the maximum chain has fix point of any ≤-monotonic function 1307 --- the maximum chain has fix point of any ≤-monotonic function
1300 --- 1308 ---