changeset 1318:579f1bf9122c

include all A less than n
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 10 Jun 2023 20:50:18 +0900
parents 08cd04cc33fe
children c7623ec8f0d3
files src/bijection.agda
diffstat 1 files changed, 9 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/src/bijection.agda	Sat Jun 10 16:22:47 2023 +0900
+++ b/src/bijection.agda	Sat Jun 10 20:50:18 2023 +0900
@@ -589,84 +589,29 @@
        field
            ac : ℕ
            n<ca : n < count-A ac
-           full : ac < count-A n → n ≡ ac 
-
-    record maxACN (n : ℕ) : Set where
-       field
-           acn : ℕ
-           cn<acn : (i : ℕ) → i ≤ n → fun→ cn (g (f (fun← an i))) ≤ acn
+           all-a : (i : ℕ) → i ≤ n → fun→ cn (g (f (fun← an i))) ≤ ac
 
     lem02 : (n : ℕ) → maxAC n
     lem02 n = lem03 n where 
-        maxac : (i : ℕ) → maxACN i
-        maxac zero = record { acn = fun→ cn (g (f (fun← an zero))) ; cn<acn = ? }
-        maxac (suc i) with <-cmp (fun→ cn (g (f (fun← an (suc i))))) (maxACN.acn (maxac i))
-        ... | tri< a ¬b ¬c = record { acn = maxACN.acn (maxac i) ; cn<acn = ? }
-        ... | tri≈ ¬a b ¬c = record { acn = maxACN.acn (maxac i) ; cn<acn = ? }
-        ... | tri> ¬a ¬b c = record { acn = fun→ cn (g (f (fun← an (suc i)))) ; cn<acn = ? }
         lem03 : (i : ℕ) → maxAC i
         lem03 i = lem10 i where
-            lem11 : (i : ℕ) → i ≤ n → fun→ cn (g (f (fun← an i))) ≤ maxACN.acn (maxac n)
-            lem11 i i≤n = maxACN.cn<acn (maxac n) i i≤n
             lem10 : (j : ℕ) → maxAC j
             lem10 zero = lem12 _ refl  where
                 lem12 : (i : ℕ) → i ≡ fun→ cn (g (f (fun← an zero))) → maxAC zero
                 lem12 zero i=z with is-A (fun← cn  zero) | inspect ( count-A ) zero
-                ... | yes isa | record { eq = eq1 } = record { ac = zero ; n<ca = subst (λ k → 0 < k) (sym eq1) (s≤s z≤n) ; full = λ _ → refl }
+                ... | yes isa | record { eq = eq1 } = record { ac = zero ; n<ca = subst (λ k → 0 < k) (sym eq1) (s≤s z≤n) ; all-a = ? }
                 ... | no nisa | record { eq = eq1 } = ⊥-elim ( nisa record { a = fun← an 0 ; fa=c = trans (sym (fiso←  cn _)) (sym (cong (fun← cn) i=z))  } ) 
                 lem12 (suc i) i=z with is-A (fun← cn  (suc i)) | inspect ( count-A ) (suc i)
-                ... | yes isa | record { eq = eq1 } = record { ac = suc i ; n<ca = subst (λ k → 0 < k) (sym eq1) 0<s ; full = ? }
+                ... | yes isa | record { eq = eq1 } = record { ac = suc i ; n<ca = subst (λ k → 0 < k) (sym eq1) 0<s ; all-a = ? }
                 ... | no nisa | record { eq = eq1 } = ⊥-elim ( nisa record { a = fun← an zero ; fa=c = trans (sym (fiso←  cn _)) (sym (cong (fun← cn) i=z))  } ) 
-            lem10 (suc j) with <-cmp (suc j) (count-A (maxAC.ac (lem10 j)))
-            ... | tri< a ¬b ¬c = record { ac = maxAC.ac (lem10 j) ; n<ca = a ; full = ? } -- if suc j < count-A (maxAC.ac lem14) , we can reuse lem10 j
-            ... | tri> ¬a ¬b (s≤s c) = ⊥-elim ( nat-≤> c (maxAC.n<ca (lem10 j)))
-            ... | tri≈ ¬a sj=ca ¬c = record { ac = fun→ cn (g (f (fun← an (suc j)))) ; n<ca = lem31 ; full = ? } where
+            lem10 (suc j) = ? where
                 -- 
-                -- then suc j ≡ count-A (maxAC.ac (lem10 j))
-                --   it means count-A is full
-                --      the new one must be above
+                --   maxAC n contains at least n elements of A
                 --
-                lem40 : (j : ℕ) → maxAC.ac (lem10 j) < count-A j → j ≡ maxAC.ac (lem10 j)
-                lem40 j j<ca = maxAC.full (lem10 j) j<ca
-                lem31 :  suc j < count-A (fun→ cn (g (f (fun← an (suc j))))) 
-                lem31 with <∨≤  j (fun→ cn (g (f (fun← an (suc j)))))
-                ... | case1 lt = lem12 _ lt ≤-refl  where
-                     lem13 : j < fun→ cn (g (f (fun← an (suc j))))
-                     lem13 = lt
-                     -- suc j is current count of A
-                     -- it increase at fun→ cn (g (f (fun← an (suc j))))
-                     -- otherwise ≤
-                     lem12 : (i : ℕ) → j < i  → i ≤ fun→ cn (g (f (fun← an (suc j)))) → suc j < count-A i
-                     lem12 (suc i) (s≤s sj<i) i≤fj with ≤-∨ sj<i
-                     ... | case1 refl = lem16 where -- subst (λ k → k < count-A (suc i)) (sym eq) lem16 where
-                         lem17 : i < count-A i
-                         lem17 = subst (λ k → i  < k ) ? a<sa
-                         lem16 : suc i < count-A (suc i)
-                         lem16 = ?
-                     ... | case2 lt = ≤-trans lem14 lem15  where
-                         lem14 : suc j < count-A i
-                         lem14 = lem12 i lt (≤-trans refl-≤s i≤fj)
-                         lem15 : count-A i ≤ count-A (suc i)
-                         lem15 = count-A-≤cong refl-≤s 
-                ... | case2 le = ? where
-                     -- count-A<i : (i : ℕ) → count-A i ≤ suc i
-                     lem33 : (i : ℕ) → i ≡ fun→ cn (g (f (fun← an (suc j)))) →  ¬ (i ≤ maxAC.ac (lem10 j)) 
-                     lem33 zero i=f i≤m = ?
-                     lem33 (suc i) si=f= i≤m = ?
-                     lem34 : maxAC.ac (lem10 j) ≤ fun→ cn (g (f (fun← an (suc j))))
-                     lem34 = ?
-                     lem32 : suc j ≤ count-A (fun→ cn (g (f (fun← an (suc j))))) 
-                     lem32 with <∨≤  (count-A (fun→ cn (g (f (fun← an (suc j))))) ) (suc j)
-                     ... | case2 le = le
-                     ... | case1 lt = ?
-                lem30 : maxAC.ac (lem10 j) < fun→ cn (g (f (fun← an (suc j))))
-                lem30 = ?
-                lem20 : suc j ≡ count-A (maxAC.ac (lem10 j))
-                lem20 = sj=ca
-                lem14 : maxAC j
-                lem14 = lem10 j 
-                lem17 : j < count-A (maxAC.ac lem14)
-                lem17 = maxAC.n<ca lem14
+                lem31 : maxAC (suc j)
+                lem31 with <∨≤  (maxAC.ac (lem10 j))  (fun→ cn (g (f (fun← an (suc j)))))
+                ... | case1 lt = record { ac = (fun→ cn (g (f (fun← an (suc j))))) ; n<ca = ? ; all-a = ? }
+                ... | case2 le = record { ac = (maxAC.ac (lem10 j)) ; n<ca = ? ; all-a = ? }
 
     lem01 : (n i : ℕ) → n < count-B i → B
     lem01 zero zero lt with is-B (fun← cn zero)