# HG changeset patch # User Shinji KONO # Date 1640672722 -32400 # Node ID c9802aa2a8c9540a6a5d24e0e2e56d9562dcba4d # Parent e4b910112fdfdabe1f9334b359b008b575a5730f ... diff -r e4b910112fdf -r c9802aa2a8c9 automaton-in-agda/src/fin.agda --- a/automaton-in-agda/src/fin.agda Tue Dec 28 12:38:16 2021 +0900 +++ b/automaton-in-agda/src/fin.agda Tue Dec 28 15:25:22 2021 +0900 @@ -122,6 +122,13 @@ toℕ (fromℕ< (≤-trans lt (fin≤n y)) ) ≡⟨ toℕ-fromℕ< _ ⟩ toℕ x ∎ ) where open ≡-Reasoning +f<→< : {n : ℕ } → { x y : Fin n} → x Data.Fin.< y → toℕ x < toℕ y +f<→< {_} {zero} {suc y} (s≤s lt) = s≤s z≤n +f<→< {_} {suc x} {suc y} (s≤s lt) = s≤s (f<→< {_} {x} {y} lt) + +f≡→≡ : {n : ℕ } → { x y : Fin n} → x ≡ y → toℕ x ≡ toℕ y +f≡→≡ refl = refl + open import Data.List open import Relation.Binary.Definitions @@ -159,6 +166,11 @@ lseq : list-less qs ≡ ls ls< : (length ls ≡ length qs) ∨ (suc (length ls) ≡ length qs) +fin010 : {n m : ℕ } {x : Fin n} (c : suc (toℕ x) ≤ toℕ (fromℕ< {m} an : {n : ℕ } → (qs : List (Fin n)) → (len> : length qs > n ) → FDup-in-list n qs fin-dup-in-list>n {zero} [] () fin-dup-in-list>n {zero} (() ∷ qs) lt @@ -173,18 +185,36 @@ → fin-phase2 (fin+1 i) qs ≡ true f1-phase2 (x ∷ qs) p (case1 q1) with <-fcmp (fromℕ< a a (subst (λ k → toℕ x < suc k ) (sym fin ¬a₁ ¬b c = f1-phase2 qs p (case2 q1) f1-phase2 (x ∷ qs) p (case1 q1) | tri> ¬a ¬b c with <-fcmp i (fromℕ< (≤-trans c (fin≤n (fromℕ< a ¬a₁ ¬b₂ c₁ = {!!} - ... | tri≈ ¬a₁ b ¬c | tri< a ¬b₁ ¬c₁ = {!!} + ... | tri< a ¬b₁ ¬c | tri≈ ¬a₁ b ¬c₁ = ⊥-elim ( ¬a₁ (subst₂ (λ j k → j < k) (sym fin+1-toℕ) (toℕ-fromℕ< _) a )) + ... | tri< a ¬b₁ ¬c | tri> ¬a₁ ¬b₂ c₁ = ⊥-elim ( ¬a₁ (subst₂ (λ j k → j < k) (sym fin+1-toℕ) (toℕ-fromℕ< _) a )) + ... | tri≈ ¬a₁ b ¬c | tri< a ¬b₁ ¬c₁ = ⊥-elim ( ¬a₁ (subst₂ (λ j k → j < k) fin+1-toℕ (sym (toℕ-fromℕ< _)) a )) ... | tri≈ ¬a₁ b ¬c | tri≈ ¬a₂ b₁ ¬c₁ = refl - ... | tri≈ ¬a₁ b ¬c | tri> ¬a₂ ¬b₁ c₁ = {!!} - ... | tri> ¬a₁ ¬b₁ c₁ | tri< a ¬b₂ ¬c = {!!} - ... | tri> ¬a₁ ¬b₁ c₁ | tri≈ ¬a₂ b ¬c = {!!} + ... | tri≈ ¬a₁ b ¬c | tri> ¬a₂ ¬b₁ c₁ = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) fin+1-toℕ (sym (toℕ-fromℕ< _)) c₁ )) + ... | tri> ¬a₁ ¬b₁ c₁ | tri< a ¬b₂ ¬c = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) (sym fin+1-toℕ) (toℕ-fromℕ< _) c₁ )) + ... | tri> ¬a₁ ¬b₁ c₁ | tri≈ ¬a₂ b ¬c = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) (sym fin+1-toℕ) (toℕ-fromℕ< _) c₁ )) ... | tri> ¬a₁ ¬b₁ c₁ | tri> ¬a₂ ¬b₂ c₂ = f1-phase2 qs p (case1 q1) - f1-phase2 (x ∷ qs) p (case2 q2) = {!!} + f1-phase2 (x ∷ qs) p (case2 q1) with <-fcmp (fromℕ< a a (subst (λ k → toℕ x < suc k ) (sym fin ¬a₁ ¬b c = ⊥-elim ( ¬-bool q1 refl ) + f1-phase2 (x ∷ qs) p (case2 q1) | tri> ¬a ¬b c with <-fcmp i (fromℕ< (≤-trans c (fin≤n (fromℕ< a ¬a₁ ¬b₂ c₁ = ⊥-elim ( ¬a₁ (subst₂ (λ j k → j < k) (sym fin+1-toℕ) (toℕ-fromℕ< _) a )) + ... | tri≈ ¬a₁ b ¬c | tri< a ¬b₁ ¬c₁ = ⊥-elim ( ¬a₁ (subst₂ (λ j k → j < k) fin+1-toℕ (sym (toℕ-fromℕ< _)) a )) + ... | tri≈ ¬a₁ b ¬c | tri≈ ¬a₂ b₁ ¬c₁ = refl + ... | tri≈ ¬a₁ b ¬c | tri> ¬a₂ ¬b₁ c₁ = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) fin+1-toℕ (sym (toℕ-fromℕ< _)) c₁ )) + ... | tri> ¬a₁ ¬b₁ c₁ | tri< a ¬b₂ ¬c = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) (sym fin+1-toℕ) (toℕ-fromℕ< _) c₁ )) + ... | tri> ¬a₁ ¬b₁ c₁ | tri≈ ¬a₂ b ¬c = ⊥-elim ( ¬c (subst₂ (λ j k → j > k) (sym fin+1-toℕ) (toℕ-fromℕ< _) c₁ )) + ... | tri> ¬a₁ ¬b₁ c₁ | tri> ¬a₂ ¬b₂ c₂ = f1-phase2 qs p (case2 q1 ) f1-phase1 : (qs : List (Fin (suc n)) ) → fin-phase1 i (list-less qs) ≡ true → (fin-phase1 (fromℕ< a