comparison src/zorn.agda @ 1089:b627e3ea7266

try to hide spu from source
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Dec 2022 17:23:54 +0900
parents 7ec55b1bdfc2
children 2cf182f0f583
comparison
equal deleted inserted replaced
1086:9e8cb06f0aff 1089:b627e3ea7266
799 -- 799 --
800 800
801 ind : ( f : Ordinal → Ordinal ) → (mf< : <-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal) 801 ind : ( f : Ordinal → Ordinal ) → (mf< : <-monotonic-f A f ) {y : Ordinal} (ay : odef A y) → (x : Ordinal)
802 → ((z : Ordinal) → z o< x → ZChain A f mf< ay z) → ZChain A f mf< ay x 802 → ((z : Ordinal) → z o< x → ZChain A f mf< ay z) → ZChain A f mf< ay x
803 ind f mf< {y} ay x prev with Oprev-p x 803 ind f mf< {y} ay x prev with Oprev-p x
804 ... | yes op = zc41 where 804 ... | yes op = zc41 sup1 where
805 -- 805 --
806 -- we have previous ordinal to use induction 806 -- we have previous ordinal to use induction
807 -- 807 --
808 px = Oprev.oprev op 808 px = Oprev.oprev op
809 zc : ZChain A f mf< ay (Oprev.oprev op) 809 zc : ZChain A f mf< ay (Oprev.oprev op)
877 pcha (case1 lt) = proj1 lt 877 pcha (case1 lt) = proj1 lt
878 pcha (case2 fc) = A∋fc _ f mf (proj1 fc) 878 pcha (case2 fc) = A∋fc _ f mf (proj1 fc)
879 879
880 sup1 : MinSUP A pchainpx 880 sup1 : MinSUP A pchainpx
881 sup1 = minsupP pchainpx pcha ptotal 881 sup1 = minsupP pchainpx pcha ptotal
882 sp1 = MinSUP.sup sup1
883 882
884 -- 883 --
885 -- supf0 px o≤ sp1 884 -- supf0 px o≤ sp1
886 -- 885 --
887 886
888 sfpx≤sp1 : supf0 px o< x → supf0 px ≤ sp1 887 zc41 : MinSUP A pchainpx → ZChain A f mf< ay x
889 sfpx≤sp1 spx<x = MinSUP.x≤sup sup1 (case2 ⟪ init (ZChain.asupf zc {px}) refl , spx<x ⟫ ) 888 zc41 sup1 = record { supf = supf1 ; asupf = asupf1 ; supf-mono = supf1-mono ; order = order
890
891 m13 : supf0 px o< x → supf0 px o≤ sp1
892 m13 spx<x = IsMinSUP.minsup (ZChain.is-minsup zc o≤-refl ) (MinSUP.as sup1) m14 where
893 m14 : {z : Ordinal} → odef (UnionCF A f ay (ZChain.supf zc) px) z → (z ≡ sp1) ∨ (z << sp1)
894 m14 {z} uz = MinSUP.x≤sup sup1 (case1 uz)
895
896 zc41 : ZChain A f mf< ay x
897 zc41 = record { supf = supf1 ; asupf = asupf1 ; supf-mono = supf1-mono ; order = order
898 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where 889 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where
890
891 sp1 = MinSUP.sup sup1
899 892
900 supf1 : Ordinal → Ordinal 893 supf1 : Ordinal → Ordinal
901 supf1 z with trio< z px 894 supf1 z with trio< z px
902 ... | tri< a ¬b ¬c = supf0 z 895 ... | tri< a ¬b ¬c = supf0 z
903 ... | tri≈ ¬a b ¬c = supf0 z 896 ... | tri≈ ¬a b ¬c = supf0 z
1233 1226
1234 ... | no lim with trio< x o∅ 1227 ... | no lim with trio< x o∅
1235 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a ) 1228 ... | tri< a ¬b ¬c = ⊥-elim ( ¬x<0 a )
1236 ... | tri≈ ¬a x=0 ¬c = record { supf = λ _ → MinSUP.sup (ysup f mf ay) ; asupf = MinSUP.as (ysup f mf ay) 1229 ... | tri≈ ¬a x=0 ¬c = record { supf = λ _ → MinSUP.sup (ysup f mf ay) ; asupf = MinSUP.as (ysup f mf ay)
1237 ; supf-mono = λ _ → o≤-refl ; order = λ _ s<s → ⊥-elim ( o<¬≡ refl s<s ) 1230 ; supf-mono = λ _ → o≤-refl ; order = λ _ s<s → ⊥-elim ( o<¬≡ refl s<s )
1238 ; 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 1231 ; 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
1232
1239 mf : ≤-monotonic-f A f 1233 mf : ≤-monotonic-f A f
1240 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 1234 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
1241 mf00 : * x < * (f x) 1235 mf00 : * x < * (f x)
1242 mf00 = proj1 ( mf< x ax ) 1236 mf00 = proj1 ( mf< x ax )
1243 ym = MinSUP.sup (ysup f mf ay) 1237 ym = MinSUP.sup (ysup f mf ay)
1258 → ym o≤ s 1252 → ym o≤ s
1259 is01 {s} as sup = MinSUP.minsup (ysup f mf ay) as is02 where 1253 is01 {s} as sup = MinSUP.minsup (ysup f mf ay) as is02 where
1260 is02 : {w : Ordinal } → odef (uchain f mf ay) w → (w ≡ s) ∨ (w << s) 1254 is02 : {w : Ordinal } → odef (uchain f mf ay) w → (w ≡ s) ∨ (w << s)
1261 is02 fc = sup ⟪ A∋fc _ f mf fc , ch-init fc ⟫ 1255 is02 fc = sup ⟪ A∋fc _ f mf fc , ch-init fc ⟫
1262 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) ) 1256 ... | case2 lt = ⊥-elim ( ¬x<0 (subst (λ k → z o< k ) x=0 lt ) )
1263 ... | tri> ¬a ¬b 0<x = record { supf = supf1 ; asupf = asupf ; supf-mono = supf-mono ; order = order 1257
1264 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where 1258 ... | tri> ¬a ¬b 0<x = zc400 usup ssup where
1265 1259
1266 mf : ≤-monotonic-f A f 1260 mf : ≤-monotonic-f A f
1267 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where 1261 mf x ax = ⟪ case2 mf00 , proj2 (mf< x ax ) ⟫ where
1268 mf00 : * x < * (f x) 1262 mf00 : * x < * (f x)
1269 mf00 = proj1 ( mf< x ax ) 1263 mf00 = proj1 ( mf< x ax )
1270 1264
1271 pzc : {z : Ordinal} → z o< x → ZChain A f mf< ay z 1265 pzc : {z : Ordinal} → z o< x → ZChain A f mf< ay z
1272 pzc {z} z<x = prev z z<x 1266 pzc {z} z<x = prev z z<x
1273 1267
1274 ysp = MinSUP.sup (ysup f mf ay) 1268 ysp = MinSUP.sup (ysup f mf ay)
1275 1269
1276 supfz : {z : Ordinal } → z o< x → Ordinal 1270 supfz : {z : Ordinal } → z o< x → Ordinal
1277 supfz {z} z<x = ZChain.supf (pzc (ob<x lim z<x)) z 1271 supfz {z} z<x = ZChain.supf (pzc (ob<x lim z<x)) z
1278 1272
1279 pchainU : HOD 1273 pchainU : HOD
1280 pchainU = UnionIC A f ay supfz 1274 pchainU = UnionIC A f ay supfz
1281 1275
1282 zeq : {xa xb z : Ordinal } 1276 zeq : {xa xb z : Ordinal }
1283 → (xa<x : xa o< x) → (xb<x : xb o< x) → xa o≤ xb → z o≤ xa 1277 → (xa<x : xa o< x) → (xb<x : xb o< x) → xa o≤ xb → z o≤ xa
1284 → ZChain.supf (pzc xa<x) z ≡ ZChain.supf (pzc xb<x) z 1278 → ZChain.supf (pzc xa<x) z ≡ ZChain.supf (pzc xb<x) z
1285 zeq {xa} {xb} {z} xa<x xb<x xa≤xb z≤xa = supf-unique A f mf< ay xa≤xb 1279 zeq {xa} {xb} {z} xa<x xb<x xa≤xb z≤xa = supf-unique A f mf< ay xa≤xb
1286 (pzc xa<x) (pzc xb<x) z≤xa 1280 (pzc xa<x) (pzc xb<x) z≤xa
1287 1281
1288 iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y 1282 iceq : {ix iy : Ordinal } → ix ≡ iy → {i<x : ix o< x } {i<y : iy o< x } → supfz i<x ≡ supfz i<y
1289 iceq refl = cong supfz o<-irr 1283 iceq refl = cong supfz o<-irr
1290 1284
1291 IChain-i : {z : Ordinal } → IChain ay supfz z → Ordinal 1285 IChain-i : {z : Ordinal } → IChain ay supfz z → Ordinal
1292 IChain-i (ic-init fc) = o∅ 1286 IChain-i (ic-init fc) = o∅
1293 IChain-i (ic-isup ia ia<x sa<x fca) = ia 1287 IChain-i (ic-isup ia ia<x sa<x fca) = ia
1294 1288
1295 pic<x : {z : Ordinal } → (ic : IChain ay supfz z ) → osuc (IChain-i ic) o< x 1289 pic<x : {z : Ordinal } → (ic : IChain ay supfz z ) → osuc (IChain-i ic) o< x
1296 pic<x {z} (ic-init fc) = ob<x lim 0<x -- 0<x ∧ lim x → osuc o∅ o< x 1290 pic<x {z} (ic-init fc) = ob<x lim 0<x -- 0<x ∧ lim x → osuc o∅ o< x
1297 pic<x {z} (ic-isup ia ia<x sa<x fca) = ob<x lim ia<x 1291 pic<x {z} (ic-isup ia ia<x sa<x fca) = ob<x lim ia<x
1298 1292
1299 pchainU⊆chain : {z : Ordinal } → (pz : odef pchainU z) → odef (ZChain.chain (pzc (pic<x (proj2 pz)))) z 1293 pchainU⊆chain : {z : Ordinal } → (pz : odef pchainU z) → odef (ZChain.chain (pzc (pic<x (proj2 pz)))) z
1300 pchainU⊆chain {z} ⟪ aw , ic-init fc ⟫ = ⟪ aw , ch-init fc ⟫ 1294 pchainU⊆chain {z} ⟪ aw , ic-init fc ⟫ = ⟪ aw , ch-init fc ⟫
1301 pchainU⊆chain {z} ⟪ aw , (ic-isup ia ia<x sa<x fca) ⟫ = ZChain.cfcs (pzc (ob<x lim ia<x) ) <-osuc o≤-refl uz03 fca where 1295 pchainU⊆chain {z} ⟪ aw , (ic-isup ia ia<x sa<x fca) ⟫ = ZChain.cfcs (pzc (ob<x lim ia<x) ) <-osuc o≤-refl uz03 fca where
1302 uz02 : FClosure A f (ZChain.supf (pzc (ob<x lim ia<x)) ia ) z 1296 uz02 : FClosure A f (ZChain.supf (pzc (ob<x lim ia<x)) ia ) z
1303 uz02 = fca 1297 uz02 = fca
1304 uz03 : ZChain.supf (pzc (ob<x lim ia<x)) ia o≤ ia 1298 uz03 : ZChain.supf (pzc (ob<x lim ia<x)) ia o≤ ia
1305 uz03 = sa<x 1299 uz03 = sa<x
1306 1300
1307 chain⊆pchainU : {z w : Ordinal } → (oz<x : osuc z o< x) → odef (ZChain.chain (pzc oz<x)) w → odef pchainU w 1301 chain⊆pchainU : {z w : Ordinal } → (oz<x : osuc z o< x) → odef (ZChain.chain (pzc oz<x)) w → odef pchainU w
1308 chain⊆pchainU {z} {w} oz<x ⟪ aw , ch-init fc ⟫ = ⟪ aw , ic-init fc ⟫ 1302 chain⊆pchainU {z} {w} oz<x ⟪ aw , ch-init fc ⟫ = ⟪ aw , ic-init fc ⟫
1309 chain⊆pchainU {z} {w} oz<x ⟪ aw , ch-is-sup u u<oz su=u fc ⟫ 1303 chain⊆pchainU {z} {w} oz<x ⟪ aw , ch-is-sup u u<oz su=u fc ⟫
1310 = ⟪ aw , ic-isup u u<x (o≤-refl0 su≡u) (subst (λ k → FClosure A f k w ) su=su fc) ⟫ where 1304 = ⟪ aw , ic-isup u u<x (o≤-refl0 su≡u) (subst (λ k → FClosure A f k w ) su=su fc) ⟫ where
1311 u<x : u o< x 1305 u<x : u o< x
1312 u<x = ordtrans u<oz oz<x 1306 u<x = ordtrans u<oz oz<x
1313 su=su : ZChain.supf (pzc oz<x) u ≡ supfz u<x 1307 su=su : ZChain.supf (pzc oz<x) u ≡ supfz u<x
1314 su=su = sym ( zeq _ _ (osucc u<oz) (o<→≤ <-osuc) ) 1308 su=su = sym ( zeq _ _ (osucc u<oz) (o<→≤ <-osuc) )
1315 su≡u : supfz u<x ≡ u 1309 su≡u : supfz u<x ≡ u
1316 su≡u = begin 1310 su≡u = begin
1317 ZChain.supf (pzc (ob<x lim u<x )) u ≡⟨ sym su=su ⟩ 1311 ZChain.supf (pzc (ob<x lim u<x )) u ≡⟨ sym su=su ⟩
1318 ZChain.supf (pzc oz<x) u ≡⟨ su=u ⟩ 1312 ZChain.supf (pzc oz<x) u ≡⟨ su=u ⟩
1319 u ∎ where open ≡-Reasoning 1313 u ∎ where open ≡-Reasoning
1320 1314
1321 chain⊆pchainU1 : {z w : Ordinal } → (z<x : z o< x) → odef (UnionCF A f ay (ZChain.supf (pzc (ob<x lim z<x))) z) w → odef pchainU w 1315 chain⊆pchainU1 : {z w : Ordinal } → (z<x : z o< x) → odef (UnionCF A f ay (ZChain.supf (pzc (ob<x lim z<x))) z) w → odef pchainU w
1322 chain⊆pchainU1 {z} {w} z<x ⟪ aw , ch-init fc ⟫ = ⟪ aw , ic-init fc ⟫ 1316 chain⊆pchainU1 {z} {w} z<x ⟪ aw , ch-init fc ⟫ = ⟪ aw , ic-init fc ⟫
1323 chain⊆pchainU1 {z} {w} z<x ⟪ aw , ch-is-sup u u<oz su=u fc ⟫ 1317 chain⊆pchainU1 {z} {w} z<x ⟪ aw , ch-is-sup u u<oz su=u fc ⟫
1324 = ⟪ aw , ic-isup u u<x (o≤-refl0 su≡u) (subst (λ k → FClosure A f k w ) su=su fc) ⟫ where 1318 = ⟪ aw , ic-isup u u<x (o≤-refl0 su≡u) (subst (λ k → FClosure A f k w ) su=su fc) ⟫ where
1325 u<x : u o< x 1319 u<x : u o< x
1326 u<x = ordtrans u<oz z<x 1320 u<x = ordtrans u<oz z<x
1327 su=su : ZChain.supf (pzc (ob<x lim z<x)) u ≡ supfz u<x 1321 su=su : ZChain.supf (pzc (ob<x lim z<x)) u ≡ supfz u<x
1328 su=su = sym ( zeq _ _ (o<→≤ (osucc u<oz)) (o<→≤ <-osuc) ) 1322 su=su = sym ( zeq _ _ (o<→≤ (osucc u<oz)) (o<→≤ <-osuc) )
1329 su≡u : supfz u<x ≡ u 1323 su≡u : supfz u<x ≡ u
1330 su≡u = begin 1324 su≡u = begin
1331 ZChain.supf (pzc (ob<x lim u<x )) u ≡⟨ sym su=su ⟩ 1325 ZChain.supf (pzc (ob<x lim u<x )) u ≡⟨ sym su=su ⟩
1332 ZChain.supf (pzc (ob<x lim z<x)) u ≡⟨ su=u ⟩ 1326 ZChain.supf (pzc (ob<x lim z<x)) u ≡⟨ su=u ⟩
1333 u ∎ where open ≡-Reasoning 1327 u ∎ where open ≡-Reasoning
1334 1328
1335 ichain-inject : {a b : Ordinal } {ia : IChain ay supfz a } {ib : IChain ay supfz b } 1329 ichain-inject : {a b : Ordinal } {ia : IChain ay supfz a } {ib : IChain ay supfz b }
1336 → ZChain.supf (pzc (pic<x ia)) (IChain-i ia) o< ZChain.supf (pzc (pic<x ib)) (IChain-i ib) 1330 → ZChain.supf (pzc (pic<x ia)) (IChain-i ia) o< ZChain.supf (pzc (pic<x ib)) (IChain-i ib)
1337 → IChain-i ia o< IChain-i ib 1331 → IChain-i ia o< IChain-i ib
1338 ichain-inject {a} {b} {ia} {ib} sa<sb = uz11 where 1332 ichain-inject {a} {b} {ia} {ib} sa<sb = uz11 where
1339 uz11 : IChain-i ia o< IChain-i ib 1333 uz11 : IChain-i ia o< IChain-i ib
1340 uz11 with trio< (IChain-i ia ) (IChain-i ib) 1334 uz11 with trio< (IChain-i ia ) (IChain-i ib)
1341 ... | tri< a ¬b ¬c = a 1335 ... | tri< a ¬b ¬c = a
1342 ... | tri≈ ¬a b ¬c = ⊥-elim ( o<¬≡ (trans (zeq _ _ (o≤-refl0 (cong osuc b)) (o<→≤ <-osuc) ) 1336 ... | tri≈ ¬a b ¬c = ⊥-elim ( o<¬≡ (trans (zeq _ _ (o≤-refl0 (cong osuc b)) (o<→≤ <-osuc) )
1343 ( cong (ZChain.supf (pzc (pic<x ib))) b )) sa<sb ) 1337 ( cong (ZChain.supf (pzc (pic<x ib))) b )) sa<sb )
1344 ... | tri> ¬a ¬b c = ⊥-elim ( o≤> ( begin 1338 ... | tri> ¬a ¬b c = ⊥-elim ( o≤> ( begin
1345 ZChain.supf (pzc (pic<x ib)) (IChain-i ib) ≡⟨ zeq _ _ (o<→≤ (osucc c)) (o<→≤ <-osuc) ⟩ 1339 ZChain.supf (pzc (pic<x ib)) (IChain-i ib) ≡⟨ zeq _ _ (o<→≤ (osucc c)) (o<→≤ <-osuc) ⟩
1346 ZChain.supf (pzc (pic<x ia)) (IChain-i ib) ≤⟨ ZChain.supf-mono (pzc (pic<x ia)) (o<→≤ c) ⟩ 1340 ZChain.supf (pzc (pic<x ia)) (IChain-i ib) ≤⟨ ZChain.supf-mono (pzc (pic<x ia)) (o<→≤ c) ⟩
1347 ZChain.supf (pzc (pic<x ia)) (IChain-i ia) ∎ ) sa<sb ) where open o≤-Reasoning O 1341 ZChain.supf (pzc (pic<x ia)) (IChain-i ia) ∎ ) sa<sb ) where open o≤-Reasoning O
1348 1342
1349 IC⊆ : {a b : Ordinal } (ia : IChain ay supfz a ) (ib : IChain ay supfz b ) 1343 IC⊆ : {a b : Ordinal } (ia : IChain ay supfz a ) (ib : IChain ay supfz b )
1350 → IChain-i ia o< IChain-i ib → odef (ZChain.chain (pzc (pic<x ib))) a 1344 → IChain-i ia o< IChain-i ib → odef (ZChain.chain (pzc (pic<x ib))) a
1351 IC⊆ {a} {b} (ic-init fc ) ib ia<ib = ⟪ A∋fc _ f mf fc , ch-init fc ⟫ 1345 IC⊆ {a} {b} (ic-init fc ) ib ia<ib = ⟪ A∋fc _ f mf fc , ch-init fc ⟫
1352 IC⊆ {a} {b} (ic-isup i i<x sa<x fc ) (ic-init fcb ) ia<ib = ⊥-elim ( ¬x<0 ia<ib ) 1346 IC⊆ {a} {b} (ic-isup i i<x sa<x fc ) (ic-init fcb ) ia<ib = ⊥-elim ( ¬x<0 ia<ib )
1353 IC⊆ {a} {b} (ic-isup i i<x sa<x fc ) (ic-isup j j<x sb<x fcb ) ia<ib 1347 IC⊆ {a} {b} (ic-isup i i<x sa<x fc ) (ic-isup j j<x sb<x fcb ) ia<ib
1354 = ZChain.cfcs (pzc (ob<x lim j<x) ) (o<→≤ ia<ib) o≤-refl (OrdTrans (ZChain.supf-mono (pzc (ob<x lim j<x)) (o<→≤ ia<ib)) sb<x) 1348 = ZChain.cfcs (pzc (ob<x lim j<x) ) (o<→≤ ia<ib) o≤-refl (OrdTrans (ZChain.supf-mono (pzc (ob<x lim j<x)) (o<→≤ ia<ib)) sb<x)
1355 (subst (λ k → FClosure A f k a) (zeq _ _ (osucc (o<→≤ ia<ib)) (o<→≤ <-osuc)) fc ) 1349 (subst (λ k → FClosure A f k a) (zeq _ _ (osucc (o<→≤ ia<ib)) (o<→≤ <-osuc)) fc )
1356 1350
1357 ptotalU : IsTotalOrderSet pchainU 1351 ptotalU : IsTotalOrderSet pchainU
1358 ptotalU {a} {b} ia ib with trio< (IChain-i (proj2 ia)) (IChain-i (proj2 ib)) 1352 ptotalU {a} {b} ia ib with trio< (IChain-i (proj2 ia)) (IChain-i (proj2 ib))
1359 ... | tri< ia<ib ¬b ¬c = ZChain.f-total (pzc (pic<x (proj2 ib))) (IC⊆ (proj2 ia) (proj2 ib) ia<ib) (pchainU⊆chain ib) 1353 ... | tri< ia<ib ¬b ¬c = ZChain.f-total (pzc (pic<x (proj2 ib))) (IC⊆ (proj2 ia) (proj2 ib) ia<ib) (pchainU⊆chain ib)
1360 ... | tri≈ ¬a ia=ib ¬c = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso ( pcmp (proj2 ia) (proj2 ib) ia=ib ) where 1354 ... | tri≈ ¬a ia=ib ¬c = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso ( pcmp (proj2 ia) (proj2 ib) ia=ib ) where
1361 pcmp : (ia : IChain ay supfz (& a)) → (ib : IChain ay supfz (& b)) → IChain-i ia ≡ IChain-i ib 1355 pcmp : (ia : IChain ay supfz (& a)) → (ib : IChain ay supfz (& b)) → IChain-i ia ≡ IChain-i ib
1362 → Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 1356 → Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
1363 pcmp (ic-init fca) (ic-init fcb) eq = fcn-cmp _ f mf fca fcb 1357 pcmp (ic-init fca) (ic-init fcb) eq = fcn-cmp _ f mf fca fcb
1364 pcmp (ic-init fca) (ic-isup i i<x s<x fcb) eq with ZChain.fcy<sup (pzc i<x) o≤-refl fca 1358 pcmp (ic-init fca) (ic-isup i i<x s<x fcb) eq with ZChain.fcy<sup (pzc i<x) o≤-refl fca
1365 ... | case1 eq1 = ct22 where 1359 ... | case1 eq1 = ct22 where
1366 ct22 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 1360 ct22 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
1367 ct22 with subst (λ k → k ≤ & b) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fcb ) 1361 ct22 with subst (λ k → k ≤ & b) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fcb )
1368 ... | case1 eq2 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 1362 ... | case1 eq2 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
1369 ct00 : * (& a) ≡ * (& b) 1363 ct00 : * (& a) ≡ * (& b)
1370 ct00 = cong (*) (trans eq1 eq2) 1364 ct00 = cong (*) (trans eq1 eq2)
1371 ... | case2 lt = tri< fc11 (λ eq → <-irr (case1 (sym eq)) fc11) (λ lt → <-irr (case2 fc11) lt) where
1372 fc11 : * (& a) < * (& b)
1373 fc11 = subst (λ k → k < * (& b) ) (cong (*) (sym eq1)) lt
1374 ... | case2 lt = tri< fc11 (λ eq → <-irr (case1 (sym eq)) fc11) (λ lt → <-irr (case2 fc11) lt) where 1365 ... | case2 lt = tri< fc11 (λ eq → <-irr (case1 (sym eq)) fc11) (λ lt → <-irr (case2 fc11) lt) where
1375 fc11 : * (& a) < * (& b) 1366 fc11 : * (& a) < * (& b)
1376 fc11 = ftrans<-≤ lt (subst (λ k → k ≤ & b) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fcb ) ) 1367 fc11 = subst (λ k → k < * (& b) ) (cong (*) (sym eq1)) lt
1377 pcmp (ic-isup i i<x s<x fca) (ic-init fcb) eq with ZChain.fcy<sup (pzc i<x) o≤-refl fcb 1368 ... | case2 lt = tri< fc11 (λ eq → <-irr (case1 (sym eq)) fc11) (λ lt → <-irr (case2 fc11) lt) where
1378 ... | case1 eq1 = ct22 where 1369 fc11 : * (& a) < * (& b)
1379 ct22 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) ) 1370 fc11 = ftrans<-≤ lt (subst (λ k → k ≤ & b) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fcb ) )
1380 ct22 with subst (λ k → k ≤ & a) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fca ) 1371 pcmp (ic-isup i i<x s<x fca) (ic-init fcb) eq with ZChain.fcy<sup (pzc i<x) o≤-refl fcb
1381 ... | case1 eq2 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where 1372 ... | case1 eq1 = ct22 where
1382 ct00 : * (& a) ≡ * (& b) 1373 ct22 : Tri (* (& a) < * (& b)) (* (& a) ≡ * (& b)) (* (& b) < * (& a) )
1383 ct00 = cong (*) (sym (trans eq1 eq2)) 1374 ct22 with subst (λ k → k ≤ & a) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fca )
1384 ... | case2 lt = tri> (λ lt → <-irr (case2 fc11) lt) (λ eq → <-irr (case1 eq) fc11) fc11 where 1375 ... | case1 eq2 = tri≈ (λ lt → ⊥-elim (<-irr (case1 (sym ct00)) lt)) ct00 (λ lt → ⊥-elim (<-irr (case1 ct00) lt)) where
1385 fc11 : * (& b) < * (& a) 1376 ct00 : * (& a) ≡ * (& b)
1386 fc11 = subst (λ k → k < * (& a) ) (cong (*) (sym eq1)) lt 1377 ct00 = cong (*) (sym (trans eq1 eq2))
1387 ... | case2 lt = tri> (λ lt → <-irr (case2 fc12) lt) (λ eq → <-irr (case1 eq) fc12) fc12 where 1378 ... | case2 lt = tri> (λ lt → <-irr (case2 fc11) lt) (λ eq → <-irr (case1 eq) fc11) fc11 where
1388 fc12 : * (& b) < * (& a) 1379 fc11 : * (& b) < * (& a)
1389 fc12 = ftrans<-≤ lt (subst (λ k → k ≤ & a) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fca ) ) 1380 fc11 = subst (λ k → k < * (& a) ) (cong (*) (sym eq1)) lt
1390 pcmp (ic-isup i i<x s<x fca) (ic-isup i i<y s<y fcb) refl = fcn-cmp _ f mf fca (subst (λ k → FClosure A f k (& b)) pc01 fcb ) where 1381 ... | case2 lt = tri> (λ lt → <-irr (case2 fc12) lt) (λ eq → <-irr (case1 eq) fc12) fc12 where
1391 pc01 : supfz i<y ≡ supfz i<x 1382 fc12 : * (& b) < * (& a)
1392 pc01 = cong supfz o<-irr 1383 fc12 = ftrans<-≤ lt (subst (λ k → k ≤ & a) (sym (zeq _ _ (o<→≤ <-osuc) o≤-refl )) (s≤fc _ f mf fca ) )
1393 ... | tri> ¬a ¬b ib<ia = ZChain.f-total (pzc (pic<x (proj2 ia))) (pchainU⊆chain ia) (IC⊆ (proj2 ib) (proj2 ia) ib<ia) 1384 pcmp (ic-isup i i<x s<x fca) (ic-isup i i<y s<y fcb) refl = fcn-cmp _ f mf fca (subst (λ k → FClosure A f k (& b)) pc01 fcb ) where
1394 1385 pc01 : supfz i<y ≡ supfz i<x
1395 1386 pc01 = cong supfz o<-irr
1396 usup : MinSUP A pchainU 1387 ... | tri> ¬a ¬b ib<ia = ZChain.f-total (pzc (pic<x (proj2 ia))) (pchainU⊆chain ia) (IC⊆ (proj2 ib) (proj2 ia) ib<ia)
1397 usup = minsupP pchainU (λ ic → proj1 ic ) ptotalU 1388
1389
1390 usup : MinSUP A pchainU
1391 usup = minsupP pchainU (λ ic → proj1 ic ) ptotalU
1392 spu0 = MinSUP.sup usup
1393
1394
1395 pchainS : HOD
1396 pchainS = record { od = record { def = λ z → (odef A z ∧ IChain ay supfz z )
1397 ∨ (FClosure A f spu0 z ∧ (spu0 o< x)) } ; odmax = & A ; <odmax = zc00 } where
1398 zc00 : {z : Ordinal } → (odef A z ∧ IChain ay supfz z ) ∨ (FClosure A f spu0 z ∧ (spu0 o< x) )→ z o< & A
1399 zc00 {z} (case1 lt) = z07 lt
1400 zc00 {z} (case2 fc) = z09 ( A∋fc spu0 f mf (proj1 fc) )
1401
1402 zc02 : { a b : Ordinal } → odef A a ∧ IChain ay supfz a → FClosure A f spu0 b ∧ ( spu0 o< x) → a ≤ b
1403 zc02 {a} {b} ca fb = zc05 (proj1 fb) where
1404 zc05 : {b : Ordinal } → FClosure A f spu0 b → a ≤ b
1405 zc05 (fsuc b1 fb ) with proj1 ( mf b1 (A∋fc spu0 f mf fb ))
1406 ... | case1 eq = subst (λ k → a ≤ k ) eq (zc05 fb)
1407 ... | case2 lt = ≤-ftrans (zc05 fb) (case2 lt)
1408 zc05 (init b1 refl) = MinSUP.x≤sup usup ca
1409
1410 ptotalS : IsTotalOrderSet pchainS
1411 ptotalS (case1 a) (case1 b) = ptotalU a b
1412 ptotalS {a0} {b0} (case1 a) (case2 b) with zc02 a b
1413 ... | case1 eq = tri≈ (<-irr (case1 (sym eq1))) eq1 (<-irr (case1 eq1)) where
1414 eq1 : a0 ≡ b0
1415 eq1 = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq )
1416 ... | case2 lt = tri< lt1 (λ eq → <-irr (case1 (sym eq)) lt1) (<-irr (case2 lt1)) where
1417 lt1 : a0 < b0
1418 lt1 = subst₂ (λ j k → j < k ) *iso *iso lt
1419 ptotalS {b0} {a0} (case2 b) (case1 a) with zc02 a b
1420 ... | case1 eq = tri≈ (<-irr (case1 eq1)) (sym eq1) (<-irr (case1 (sym eq1))) where
1421 eq1 : a0 ≡ b0
1422 eq1 = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq )
1423 ... | case2 lt = tri> (<-irr (case2 lt1)) (λ eq → <-irr (case1 eq) lt1) lt1 where
1424 lt1 : a0 < b0
1425 lt1 = subst₂ (λ j k → j < k ) *iso *iso lt
1426 ptotalS (case2 a) (case2 b) = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp spu0 f mf (proj1 a) (proj1 b))
1427
1428 S⊆A : pchainS ⊆' A
1429 S⊆A (case1 lt) = proj1 lt
1430 S⊆A (case2 fc) = A∋fc _ f mf (proj1 fc)
1431
1432 ssup : MinSUP A pchainS
1433 ssup = minsupP pchainS S⊆A ptotalS
1434
1435 zc400 : MinSUP A pchainU → MinSUP A pchainS → ZChain A f mf< ay x
1436 zc400 usup ssup = record { supf = supf1 ; asupf = asupf ; supf-mono = supf-mono ; order = order
1437 ; zo≤sz = zo≤sz ; is-minsup = is-minsup ; cfcs = cfcs } where
1438
1398 spu = MinSUP.sup usup 1439 spu = MinSUP.sup usup
1399
1400
1401 pchainS : HOD
1402 pchainS = record { od = record { def = λ z → (odef A z ∧ IChain ay supfz z )
1403 ∨ (FClosure A f spu z ∧ (spu o< x)) } ; odmax = & A ; <odmax = zc00 } where
1404 zc00 : {z : Ordinal } → (odef A z ∧ IChain ay supfz z ) ∨ (FClosure A f spu z ∧ (spu o< x) )→ z o< & A
1405 zc00 {z} (case1 lt) = z07 lt
1406 zc00 {z} (case2 fc) = z09 ( A∋fc spu f mf (proj1 fc) )
1407
1408 zc02 : { a b : Ordinal } → odef A a ∧ IChain ay supfz a → FClosure A f spu b ∧ ( spu o< x) → a ≤ b
1409 zc02 {a} {b} ca fb = zc05 (proj1 fb) where
1410 zc05 : {b : Ordinal } → FClosure A f spu b → a ≤ b
1411 zc05 (fsuc b1 fb ) with proj1 ( mf b1 (A∋fc spu f mf fb ))
1412 ... | case1 eq = subst (λ k → a ≤ k ) eq (zc05 fb)
1413 ... | case2 lt = ≤-ftrans (zc05 fb) (case2 lt)
1414 zc05 (init b1 refl) = MinSUP.x≤sup usup ca
1415
1416 ptotalS : IsTotalOrderSet pchainS
1417 ptotalS (case1 a) (case1 b) = ptotalU a b
1418 ptotalS {a0} {b0} (case1 a) (case2 b) with zc02 a b
1419 ... | case1 eq = tri≈ (<-irr (case1 (sym eq1))) eq1 (<-irr (case1 eq1)) where
1420 eq1 : a0 ≡ b0
1421 eq1 = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq )
1422 ... | case2 lt = tri< lt1 (λ eq → <-irr (case1 (sym eq)) lt1) (<-irr (case2 lt1)) where
1423 lt1 : a0 < b0
1424 lt1 = subst₂ (λ j k → j < k ) *iso *iso lt
1425 ptotalS {b0} {a0} (case2 b) (case1 a) with zc02 a b
1426 ... | case1 eq = tri≈ (<-irr (case1 eq1)) (sym eq1) (<-irr (case1 (sym eq1))) where
1427 eq1 : a0 ≡ b0
1428 eq1 = subst₂ (λ j k → j ≡ k ) *iso *iso (cong (*) eq )
1429 ... | case2 lt = tri> (<-irr (case2 lt1)) (λ eq → <-irr (case1 eq) lt1) lt1 where
1430 lt1 : a0 < b0
1431 lt1 = subst₂ (λ j k → j < k ) *iso *iso lt
1432 ptotalS (case2 a) (case2 b) = subst₂ (λ j k → Tri (j < k) (j ≡ k) (k < j)) *iso *iso (fcn-cmp spu f mf (proj1 a) (proj1 b))
1433
1434 S⊆A : pchainS ⊆' A
1435 S⊆A (case1 lt) = proj1 lt
1436 S⊆A (case2 fc) = A∋fc _ f mf (proj1 fc)
1437
1438 ssup : MinSUP A pchainS
1439 ssup = minsupP pchainS S⊆A ptotalS
1440
1441 sps = MinSUP.sup ssup 1440 sps = MinSUP.sup ssup
1442 1441
1443 supf1 : Ordinal → Ordinal 1442 supf1 : Ordinal → Ordinal
1444 supf1 z with trio< z x 1443 supf1 z with trio< z x
1445 ... | tri< a ¬b ¬c = ZChain.supf (pzc (ob<x lim a)) z -- each sup o< x 1444 ... | tri< a ¬b ¬c = ZChain.supf (pzc (ob<x lim a)) z -- each sup o< x