### comparison ordinal.agda @ 339:feb0fcc430a9

...
author Shinji KONO Sun, 12 Jul 2020 19:55:37 +0900 0faa7120e4b5 adc3c3a37308 811152bf2f47
comparison
equal inserted replaced
338:bca043423554 339:feb0fcc430a9
224 ; next-limit = next-limit 224 ; next-limit = next-limit
225 } 225 }
226 } where 226 } where
227 next : Ordinal {suc n} → Ordinal {suc n} 227 next : Ordinal {suc n} → Ordinal {suc n}
228 next (ordinal lv ord) = ordinal (Suc lv) (Φ (Suc lv)) 228 next (ordinal lv ord) = ordinal (Suc lv) (Φ (Suc lv))
229 next-limit : {y : Ordinal} → (y o< next y) ∧ ((x : Ordinal) → x o< next y → osuc x o< next y) 229 next-limit : {y : Ordinal} → (y o< next y) ∧ ((x : Ordinal) → x o< next y → osuc x o< next y) ∧
230 next-limit {y} = record { proj1 = case1 a<sa ; proj2 = lemma } where 230 ( (x : Ordinal) → y o< x → x o< next y → ¬ ((z : Ordinal) → ¬ (x ≡ osuc z) ))
231 next-limit {y} = record { proj1 = case1 a<sa ; proj2 = record { proj1 = lemma ; proj2 = lemma2 } } where
231 lemma : (x : Ordinal) → x o< next y → osuc x o< next y 232 lemma : (x : Ordinal) → x o< next y → osuc x o< next y
232 lemma x (case1 lt) = case1 lt 233 lemma x (case1 lt) = case1 lt
234 lemma2 : (x : Ordinal) → y o< x → x o< next y → ¬ ((z : Ordinal) → ¬ x ≡ osuc z)
235 lemma2 (ordinal Zero (Φ 0)) (case2 ()) (case1 (s≤s z≤n)) not
236 lemma2 (ordinal Zero (OSuc 0 dx)) (case2 Φ<) (case1 (s≤s z≤n)) not = not _ refl
237 lemma2 (ordinal Zero (OSuc 0 dx)) (case2 (s< x)) (case1 (s≤s z≤n)) not = not _ refl
238 lemma2 (ordinal (Suc lx) (OSuc (Suc lx) ox)) y<x (case1 (s≤s (s≤s lt))) not = not _ refl
239 lemma2 (ordinal (Suc lx) (Φ (Suc lx))) (case1 x) (case1 (s≤s (s≤s lt))) not = lemma3 x lt where
240 lemma3 : {n l : Nat} → (Suc (Suc n) ≤ Suc l) → l ≤ n → ⊥
241 lemma3 (s≤s sn≤l) (s≤s l≤n) = lemma3 sn≤l l≤n
233 not-limit : (x : Ordinal) → Dec (¬ ((y : Ordinal) → ¬ (x ≡ osuc y))) 242 not-limit : (x : Ordinal) → Dec (¬ ((y : Ordinal) → ¬ (x ≡ osuc y)))
234 not-limit (ordinal lv (Φ lv)) = no (λ not → not (λ y () )) 243 not-limit (ordinal lv (Φ lv)) = no (λ not → not (λ y () ))
235 not-limit (ordinal lv (OSuc lv ox)) = yes (λ not → not (ordinal lv ox) refl ) 244 not-limit (ordinal lv (OSuc lv ox)) = yes (λ not → not (ordinal lv ox) refl )
236 ord1 : Set (suc n) 245 ord1 : Set (suc n)
237 ord1 = Ordinal {suc n} 246 ord1 = Ordinal {suc n}