# HG changeset patch # User Shinji KONO # Date 1687158105 -32400 # Node ID e3d3749e80bd3955e3be638546dfca5ea53837e2 # Parent 88356bb882d48c92c39c0b9ac2bf9eb58b3864f5 ... diff -r 88356bb882d4 -r e3d3749e80bd src/bijection.agda --- a/src/bijection.agda Mon Jun 19 12:40:47 2023 +0900 +++ b/src/bijection.agda Mon Jun 19 16:01:45 2023 +0900 @@ -484,13 +484,8 @@ -- Bernstein is non constructive, so we cannot use this without some assumption -- but in case of ℕ, we can construct it directly. -open import Data.Product -open import Relation.Nary using (⌊_⌋) -open import Relation.Nullary.Decidable hiding (⌊_⌋) -open import Data.Unit.Base using (⊤ ; tt) -open import Data.List.Fresh hiding ([_]) -open import Data.List.Fresh.Relation.Unary.Any -open import Data.List.Fresh.Relation.Unary.All +open import Data.List hiding ([_]) +open import Data.List.Relation.Unary.Any record InjectiveF (A B : Set) : Set where field @@ -545,40 +540,6 @@ ... | yes isb = suc (count-A n) ... | no nisb = count-A n - count-A-mono : {i j : ℕ} → i ≤ j → count-A i ≤ count-A j - count-A-mono {i} {j} i≤j with ≤-∨ i≤j - ... | case1 refl = ≤-refl - ... | case2 i (≤-trans lem36 lem39) a ¬a ¬b c₁ = 0 - c1 (suc n) i with <-cmp (fun→ cn (g (f (fun← an (suc n))))) i - ... | tri< a ¬b ¬c = suc (c1 n i) - ... | tri≈ ¬a b ¬c = suc (c1 n i) - ... | tri> ¬a ¬b c₁ = c1 n i - - c1-mono : {n i j : ℕ} → i ≤ j → (c1 n i ≡ c1 n j) ∨ (c1 n i < c1 n j) - c1-mono {zero} {i} {j} le with <-cmp (fun→ cn (g (f (fun← an zero)))) i | <-cmp (fun→ cn (g (f (fun← an zero)))) j - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ = case1 refl - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ = case1 refl - ... | tri< a ¬b ¬c | tri> ¬a ¬b₁ c₁ = ⊥-elim ( nat-≤> le (<-trans c₁ a) ) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ = case1 refl - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ = case1 refl - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) le) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c = case2 ≤-refl - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = case2 ≤-refl - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = case1 refl - c1-mono {suc n} {zero} {zero} z≤n = case1 refl - c1-mono {suc n} {zero} {suc j} z≤n with <-cmp (fun→ cn (g (f (fun← an (suc n))))) zero | <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc j) - | c1-mono {n} {zero} {suc j} z≤n - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | case2 le = case2 ( s≤s le ) - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | case2 le = case2 ( s≤s le ) - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ | _ = ⊥-elim ( nat-≡< (sym b) (≤-trans (s≤s z≤n) c₁) ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | case1 eq = case2 ( subst (λ k → suc (c1 n zero) ≤ k ) (cong suc eq) ≤-refl ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | case2 le = case2 (≤-trans le refl-≤s ) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | case1 eq = case2 ( subst (λ k → suc (c1 n zero) ≤ k ) (cong suc eq) ≤-refl ) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | case2 le = case2 (≤-trans le refl-≤s ) - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ | case1 eq = case1 eq - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ | case2 le = case2 le - c1-mono {suc n} {suc i} {suc j} (s≤s le) with <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc i) | <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc j) - | c1-mono {n} {suc i} {suc j} (s≤s le) - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ | case2 le = case2 (s≤s le) - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ | case2 le = case2 (s≤s le) - ... | tri< a ¬b ¬c | tri> ¬a ¬b₁ c₁ | u = ⊥-elim ( nat-≤> (s≤s le) (<-transˡ c₁ (≤-trans refl-≤s a ) )) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | case2 le = case2 (s≤s le) - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | case1 eq = case1 (cong suc eq) - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | case2 le = case2 (s≤s le) - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ | u = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) (s≤s le)) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | case1 eq = case2 ( subst (λ k → suc (c1 n (suc i)) ≤ k ) (cong suc eq) ≤-refl ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | case2 le = case2 (≤-trans le refl-≤s ) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | case1 eq = case2 ( subst (λ k → suc (c1 n (suc i)) ≤ k ) (cong suc eq) ≤-refl ) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | case2 le = case2 (≤-trans le refl-≤s ) - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ | u = u - - c1-max : (n i : ℕ) → c n < i → c1 n i ≡ suc n - c1-max zero i cn ¬a ¬b c₁ = ⊥-elim (c100 cn (s≤s c₁) (<-transʳ f ¬a ¬b c₁ = ⊥-elim ( nat-<> c₁ m ¬a ¬b an ¬a ¬b₁ c₁ = ⊥-elim ( nat-≤> refl-≤s (<-trans c₁ a) ) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ = refl - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ = refl - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) a≤sa ) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c = ⊥-elim ( nat-≤> a (s≤s c₁)) - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = refl - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = ⊥-elim ( nat-≡< c126 n a (<-trans a ¬a ¬b c₁ | tri< a ¬b₁ ¬c = refl - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = refl - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = ⊥-elim ( ¬b₁ c125 ) - c1+1 (suc n) i isa with <-cmp (suc n) (fun→ an (Is.a isa)) - ... | tri< n ¬a ¬b c₁ | s = ⊥-elim ( nat-≤> c₁ (<-trans (<-trans a ¬a ¬b₁ c₁ = ⊥-elim ( nat-≤> a≤sa (<-transˡ c₁ (≤-trans refl-≤s a ) )) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ = cong suc c110 - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ = cong suc c110 - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) a≤sa ) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< (s≤s a) ¬b₁ ¬c = ⊥-elim (nat-≡< refl (<-transˡ c₁ a)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = ⊥-elim (nat-≡< c130 n ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = c110 - ... | tri≈ ¬a n=an ¬c = c115 where - c111 : c1 n i ≡ c1 n (suc i) - c111 with <-cmp n (fun→ an (Is.a isa)) | c1+1 n i isa - ... | tri< a ¬b ¬c | s = s - ... | tri≈ ¬a b ¬c | s = ⊥-elim ( nat-≡< b (subst (λ k → n < k ) n=an a ¬a ¬b c₁ | s = ⊥-elim ( nat-≡< (sym n=an) (<-trans c₁ a ¬a ¬b c₁ | tri< (s≤s a) ¬b₁ ¬c = ⊥-elim (nat-≡< refl (<-transˡ c₁ a)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = cong suc c111 - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = ⊥-elim ( nat-≡< (sym c129) c₂ ) - ... | tri> ¬a ¬b an an ¬a ¬b c₁ | s = s - open ≡-Reasoning - c115 : suc (c1 (suc n) i) ≡ c1 (suc n) (suc i) - c115 with <-cmp (ani (suc n)) i | <-cmp (ani (suc n)) (suc i) - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ = cong suc c112 - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ = cong suc c112 - ... | tri< a ¬b ¬c | tri> ¬a ¬b₁ c₁ = ⊥-elim ( nat-≤> a≤sa (<-transˡ c₁ (≤-trans refl-≤s a ) )) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ = cong suc c112 - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ = cong suc c112 - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) a≤sa ) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< (s≤s a) ¬b₁ ¬c = ⊥-elim (nat-≡< refl (<-transˡ c₁ a)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = ⊥-elim ( nat-≡< (sym c130) an ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = c112 + remove-n : (n : ℕ) → List A → List A + remove-n n [] = [] + remove-n n (h ∷ t ) with <-cmp n (fun→ an h) + ... | tri< a ¬b ¬c = t + ... | tri≈ ¬a b ¬c = h ∷ remove-n n t + ... | tri> ¬a ¬b c₁ = h ∷ remove-n n t - c1+0 : {n i : ℕ} → ¬ Is A C (λ x → g (f x)) (fun← cn (suc i)) → c1 n i ≡ c1 n (suc i) - c1+0 {zero} {i} nisa with <-cmp (fun→ cn (g (f (fun← an zero)))) i | <-cmp (fun→ cn (g (f (fun← an zero)))) (suc i) - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ = refl - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ = refl - ... | tri< a ¬b ¬c | tri> ¬a ¬b₁ c₁ = ⊥-elim ( nat-≤> a≤sa (<-trans c₁ a) ) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ = refl - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ = refl - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) a≤sa) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c = ⊥-elim ( nat-≤> a (s≤s c₁)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c = ⊥-elim ( nisa record { a = fun← an 0 ; fa=c = c00 } ) where - open ≡-Reasoning - c00 : g (f (fun← an 0)) ≡ fun← cn (suc i) - c00 = begin - g (f (fun← an 0)) ≡⟨ sym (fiso← cn _) ⟩ - fun← cn (fun→ cn (g (f (fun← an 0)))) ≡⟨ cong (fun← cn) b ⟩ - fun← cn (suc i) ∎ - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ = refl - c1+0 {suc n} {zero} nisa with <-cmp (fun→ cn (g (f (fun← an (suc n))))) zero | <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc zero) - | c1+0 {n} {zero} nisa - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | eq = (cong suc eq) - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | eq = (cong suc eq) - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ | _ = ⊥-elim ( nat-≡< (sym b) (≤-trans (s≤s z≤n) c₁) ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | eq = ⊥-elim ( nat-≤> a (s≤s c₁)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | eq = ⊥-elim ( nisa record { a = fun← an (suc n) ; fa=c = c00 } ) where - open ≡-Reasoning - c00 : g (f (fun← an (suc n))) ≡ fun← cn 1 - c00 = begin - g (f (fun← an (suc n))) ≡⟨ sym (fiso← cn _) ⟩ - fun← cn (fun→ cn (g (f (fun← an (suc n))))) ≡⟨ cong (fun← cn) b ⟩ - fun← cn 1 ∎ - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ | eq = eq - c1+0 {suc n} {suc i} nisa with <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc i) | <-cmp (fun→ cn (g (f (fun← an (suc n))))) (suc (suc i)) - | c1+0 {n} {suc i} nisa - ... | tri< a ¬b ¬c | tri< a₁ ¬b₁ ¬c₁ | eq = cong suc eq - ... | tri< a ¬b ¬c | tri≈ ¬a b ¬c₁ | eq = cong suc eq - ... | tri< a ¬b ¬c | tri> ¬a ¬b₁ c₁ | u = ⊥-elim ( nat-≤> a≤sa (<-transˡ c₁ (≤-trans refl-≤s a ) )) - ... | tri≈ ¬a b ¬c | tri< a ¬b ¬c₁ | eq = cong suc eq - ... | tri≈ ¬a b ¬c | tri≈ ¬a₁ b₁ ¬c₁ | eq = cong suc eq - ... | tri≈ ¬a b ¬c | tri> ¬a₁ ¬b c₁ | u = ⊥-elim ( nat-≤> (subst (λ k → k ≤ _) (sym b) a≤sa) c₁ ) - ... | tri> ¬a ¬b c₁ | tri< a ¬b₁ ¬c | eq = ⊥-elim ( nat-≤> a (s≤s c₁)) - ... | tri> ¬a ¬b c₁ | tri≈ ¬a₁ b ¬c | eq = ⊥-elim ( nisa record { a = fun← an (suc n) ; fa=c = c00 } ) where - open ≡-Reasoning - c00 : g (f (fun← an (suc n))) ≡ fun← cn (suc (suc i)) - c00 = begin - g (f (fun← an (suc n))) ≡⟨ sym (fiso← cn _) ⟩ - fun← cn (fun→ cn (g (f (fun← an (suc n))))) ≡⟨ cong (fun← cn) b ⟩ - fun← cn (suc (suc i)) ∎ - ... | tri> ¬a ¬b c₁ | tri> ¬a₁ ¬b₁ c₂ | u = u + NL-1 : (n : ℕ) → NL (suc n) → NL n + NL-1 n nl = record { nlist = remove-n n (NL.nlist nl) ; anyn = ? } where + nl03 : (i : ℕ) → i ≤ n → Any (_≡_ (fun← an i)) (remove-n n (NL.nlist nl)) + nl03 i i≤n = nl04 _ (NL.anyn nl i ? ) where + nl04 : (x : List A) → Any (_≡_ (fun← an i)) x → Any (_≡_ (fun← an i)) (remove-n n x) + nl04 (h ∷ t) (here px) with <-cmp n (fun→ an h) + ... | tri< a ¬b ¬c = ? + ... | tri≈ ¬a b ¬c = here px + ... | tri> ¬a ¬b c₁ = here px + nl04 (h ∷ t) (there a) with <-cmp n (fun→ an h) + ... | tri< a ¬b ¬c = ? + ... | tri≈ ¬a b ¬c = there (nl04 t a) + ... | tri> ¬a ¬b c₁ = there (nl04 t a) - c1 ¬a ¬b c₁ = ≤-refl - ... | yes isa | tri≈ ¬a b ¬c = ≤-refl - ... | yes isa | tri> ¬a ¬b c₁ = a≤sa - c1 ¬a ¬b c₁ = lem01 n ≤-refl where - lem01 : (i : ℕ) → i ≤ n → c1 i 0 ≤ 0 - lem01 0 i≤n with <-cmp (fun→ cn (g (f (fun← an 0)))) zero - ... | tri> ¬a ¬b c₁ = ≤-refl - ... | tri≈ ¬a bi ¬c = ⊥-elim ( nisa record { a = fun← an 0 ; fa=c = trans (sym (fiso← cn _)) (cong (fun← cn) bi) } ) - lem01 (suc i) i≤n with <-cmp (fun→ cn (g (f (fun← an (suc i))))) zero - ... | tri≈ ¬a bi ¬c = ⊥-elim ( nisa record { a = fun← an (suc i) ; fa=c = trans (sym (fiso← cn _)) (cong (fun← cn) bi) } ) - lem01 (suc i) (s≤s i≤n) | tri> ¬a ¬b c₁ = lem01 i (≤-trans i≤n a≤sa) - ... | yes isa | tri≈ ¬a b ¬c = lem01 n ≤-refl where - lem01 : (i : ℕ) → i ≤ n → suc (c1 i 0) ≤ 1 - lem01 0 i≤n with <-cmp (fun→ cn (g (f (fun← an 0)))) zero - ... | tri> ¬a ¬b c₁ = ≤-refl - ... | tri≈ ¬a bi ¬c = ⊥-elim (nat-≡< (inject-cgf (trans bi (sym b)) ) (<-transʳ i≤n a ¬a ¬b c₁ = lem01 i (≤-trans i≤n a≤sa) - ... | yes isa | tri> ¬a ¬b c₁ = lem01 n ≤-refl where - lem01 : (i : ℕ) → i ≤ n → c1 i 0 ≤ 1 - lem01 0 i≤n with <-cmp (fun→ cn (g (f (fun← an 0)))) zero - ... | tri> ¬a ¬b c₁ = a≤sa - ... | tri≈ ¬a bi ¬c = ≤-refl - lem01 (suc i) i≤n with <-cmp (fun→ cn (g (f (fun← an (suc i))))) zero - ... | tri≈ ¬a bi ¬c = lem02 i ≤-refl where - lem02 : (j : ℕ) → j ≤ i → suc (c1 j 0) ≤ 1 - lem02 zero j≤i with <-cmp (fun→ cn (g (f (fun← an 0)))) zero - ... | tri≈ ¬a bi2 ¬c = ⊥-elim (nat-≡< (sym (inject-cgf (trans bi (sym bi2)) )) (<-transʳ z≤n a ¬a ¬b c₁ = ≤-refl - lem02 (suc j) j≤i with <-cmp (fun→ cn (g (f (fun← an (suc j))))) zero - ... | tri≈ ¬a bi2 ¬c = ⊥-elim (nat-≡< (sym (inject-cgf (trans bi (sym bi2)) )) (<-transʳ j≤i a ¬a ¬b c₁ = lem02 j (≤-trans j≤i a≤sa) - lem01 (suc i) (s≤s i≤n) | tri> ¬a ¬b c₁ = lem01 i (≤-trans i≤n a≤sa) - c1 ¬a ¬b c₁ = z≤n - ... | yes isa | tri< a ¬b ¬c = s≤s z≤n - ... | yes isa | tri≈ ¬a b ¬c = s≤s z≤n - ... | yes isa | tri> ¬a ¬b c₁ = z≤n - c1 ¬a ¬b c₁ = subst ( λ k → k ≤ count-A i) (c1+0 {n} {i} nisa) (c1 ¬a ¬b c₁ | eq = begin - c1 n (suc i) ≡⟨ sym eq ⟩ - suc ( c1 n i) ≤⟨ s≤s (c1 ¬a ¬b c₁ = ? - lem13 (suc j) j≤n with <-cmp (fun→ cn (g (f (fun← an (suc j))))) (suc i) - ... | tri< a ¬b ¬c = lem16 where - lem16 : suc (suc (c1 j (suc i))) ≤ suc (count-A i) - lem16 = ? - lme14 : suc (c1 j (suc i)) ≤ suc (count-A i) - lme14 = lem13 j ? - ... | tri≈ ¬a b ¬c = ? -- cong suc (lem13 j ?) - ... | tri> ¬a ¬b c₁ = ? - ... | tri≈ ¬a b ¬c = lem13 where -- count-A contains (suc i) here - lem15 : c1 n i ≡ c1 n (suc i) - lem15 with <-cmp n (fun→ an (Is.a isa)) | c1+1 n i isa - ... | tri< a ¬b ¬c | eq = eq - ... | tri≈ ¬a bi ¬c | eq = ⊥-elim ( nat-≡< (sym ( inject-cgf ( trans b lem16 ))) a ¬a ¬b c₁ | eq = ⊥-elim ( nat-≡< refl lem17 ) where - lem18 : fun→ cn (g (f (fun← an (suc n)))) ≡ fun→ cn (g (f (fun← an (fun→ an (Is.a isa))))) - lem18 = begin - fun→ cn (g (f (fun← an (suc n)))) ≡⟨ b ⟩ - suc i ≡⟨ sym ( fiso→ cn _) ⟩ - fun→ cn (fun← cn (suc i)) ≡⟨ sym (cong (fun→ cn) (Is.fa=c isa)) ⟩ - fun→ cn (g (f (Is.a isa))) ≡⟨ cong (λ k → fun→ cn (g (f k))) (sym (fiso← an _)) ⟩ - fun→ cn (g (f (fun← an (fun→ an (Is.a isa))))) ∎ where open ≡-Reasoning - lem17 : suc n ≤ n - lem17 = begin - suc n <⟨ s≤s a ¬a ¬b c₁ = lem12 -- count-A is one degree larger now + n ¬a ¬b c₁ = ? + nl02 n (h ∷ ta) (there a) with <-cmp n (fun→ an h) + ... | tri< a ¬b ¬c = ≤-refl + ... | tri≈ ¬a b ¬c = s≤s (nl02 n ta a) + ... | tri> ¬a ¬b c₁ = s≤s (nl02 n ta a) + record maxAC (n : ℕ) : Set where field ac : ℕ n ¬a ¬b an