changeset 357:ab531332d0a1

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 18 Jul 2023 17:10:30 +0900
parents bd5cd2692b49
children 168465a7b107
files automaton-in-agda/src/finiteSetUtil.agda
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/automaton-in-agda/src/finiteSetUtil.agda	Tue Jul 18 16:52:06 2023 +0900
+++ b/automaton-in-agda/src/finiteSetUtil.agda	Tue Jul 18 17:10:30 2023 +0900
@@ -643,23 +643,30 @@
 
     lem31 : (b : B) → 0 < count-B (toℕ (F←Q fa (f b)))
     lem31 b = lem32 (toℕ (F←Q fa (f b))) ≤-refl where
-        lem32 : (i : ℕ) → i ≤ toℕ (F←Q fa (f b)) → 0 < count-B i 
-        lem32 zero le with is-B (Q←F fa ( fromℕ< {0} 0<fa ))
+        lem32 : (i : ℕ) → toℕ (F←Q fa (f b)) ≤ i → 0 < count-B i 
+        lem32 zero le with ≤-∨ le
+        lem32 zero le | case2 lt = ⊥-elim ( nat-≤> lt (s≤s z≤n ))
+        lem32 zero le | case1 eq with is-B (Q←F fa ( fromℕ< {0} 0<fa ))
         ... | yes isb = ≤-refl
         ... | no nisb = ⊥-elim ( nisb record { a = b ; fa=c = lem33 } ) where
             lem33 : f b ≡ Q←F fa ( fromℕ< {0} 0<fa )
             lem33 = begin
               f b ≡⟨ sym (finiso→  fa _) ⟩
               Q←F fa ( F←Q fa (f b))  ≡⟨ sym (cong (λ k → Q←F fa k)  ( fromℕ<-toℕ _ fin<n)) ⟩
-              Q←F fa ( fromℕ< fin<n )  ≡⟨ cong (λ k → Q←F fa k) (fromℕ<-cong _ _ ? fin<n 0<fa) ⟩
+              Q←F fa ( fromℕ< fin<n )  ≡⟨ cong (λ k → Q←F fa k) (fromℕ<-cong _ _ eq fin<n 0<fa) ⟩
               Q←F fa ( fromℕ< {0} 0<fa ) ∎ where
                 open ≡-Reasoning
-        lem32 (suc n) le with <-cmp (finite fa) (suc n) | inspect count-B (suc n)
-        ... | tri< a ¬b ¬c | _ = ⊥-elim ( nat-≤> le (<-trans fin<n a) )
-        ... | tri≈ ¬a eq1 ¬c | _ = ⊥-elim ( nat-≤> le (subst (λ k → toℕ (F←Q fa (f b)) < k ) eq1 fin<n ))
-        ... | tri> ¬a ¬b c | record { eq = eq1 } with is-B (Q←F fa (fromℕ< c))   
+        lem32 (suc n) le with <-cmp (finite fa) (suc n) | inspect count-B (suc n) | ≤-∨ le
+        ... | tri< a ¬b ¬c | _ | case1 eq = lem32 n ? -- ? -- ⊥-elim ( nat-≤> le (<-trans fin<n a) )
+        ... | tri< a ¬b ¬c | _ | case2 lt = lem32 n ? -- ? -- ⊥-elim ( nat-≤> le (<-trans fin<n a) )
+        ... | tri≈ ¬a eq1 ¬c | _ | case1 eq = ? -- ⊥-elim ( nat-≤> le (subst (λ k → toℕ (F←Q fa (f b)) < k ) eq1 fin<n ))
+        ... | tri≈ ¬a eq1 ¬c | _ | case2 lt = ? -- ⊥-elim ( nat-≤> le (subst (λ k → toℕ (F←Q fa (f b)) < k ) eq1 fin<n ))
+        ... | tri> ¬a ¬b c | record { eq = eq1 } | case1 eq with is-B (Q←F fa (fromℕ< c))   
         ... | yes isb = s≤s z≤n 
-        ... | no nisb = lem32 n (≤-trans a≤sa le)
+        ... | no nisb = lem32 n ? -- (≤-trans a≤sa le)
+        lem32 (suc n) le | tri> ¬a ¬b c | record { eq = eq1 } | case2 lt with is-B (Q←F fa (fromℕ< c))   
+        ... | yes isb = s≤s z≤n 
+        ... | no nisb = lem32 n ? -- (≤-trans a≤sa le)
 
     cb<mb : (b : B) → pred (count-B (toℕ (F←Q fa (f b)))) < maxb
     cb<mb b = sx≤y→x<y ( begin