# HG changeset patch # User Shinji KONO # Date 1597900388 -32400 # Node ID 84c84695de9458017dcd8d2cbcba8b80fc8f8b41 # Parent e87ed47742b1d6e1a7722bd335c534dcb19fa680 ... diff -r e87ed47742b1 -r 84c84695de94 Symmetric.agda --- a/Symmetric.agda Thu Aug 20 12:17:08 2020 +0900 +++ b/Symmetric.agda Thu Aug 20 14:13:08 2020 +0900 @@ -4,7 +4,7 @@ open import Algebra open import Algebra.Structures open import Data.Fin hiding ( _<_ ; _≤_ ; _-_ ; _+_ ) -open import Data.Fin.Properties hiding ( <-cmp ; <-trans ; ≤-trans ) +open import Data.Fin.Properties hiding ( <-trans ; ≤-trans ) renaming ( <-cmp to <-fcmp ) open import Data.Product open import Data.Fin.Permutation open import Function hiding (id ; flip) @@ -80,6 +80,8 @@ -- An inductive construction of permutation +-- we already have refl and trans + pprep : {n : ℕ } → Permutation n n → Permutation (suc n) (suc n) pprep {n} perm = permutation p→ p← record { left-inverse-of = piso→ ; right-inverse-of = piso← } where p→ : Fin (suc n) → Fin (suc n) @@ -120,6 +122,56 @@ piso→ (suc zero) = refl piso→ (suc (suc x)) = cong (λ k → suc (suc k) ) (inverseʳ perm) +Finnm : {n m : ℕ } → Fin (n + m) ≡ Fin (m + n) +Finnm {n} {m} = cong (λ k → Fin k ) (+-comm n _ ) + +Finnmconv : {n m : ℕ } → Fin (m + n) → Fin (n + m) +Finnmconv {n} {m} x = subst (λ k → Fin k ) (+-comm m _) x + +m+n→n : {n m : ℕ } → (x : Fin (n + m)) → toℕ x < n → Fin n +m+n→n x x ¬a ¬b c = m→m+n (q ⟨$⟩ˡ (m+n→m x (≤to< c) )) + + p← : Fin (n + m) → Fin (n + m) + p← x with <-cmp (toℕ x ) n + p← x | tri< a ¬b ¬c = n→m+n (p ⟨$⟩ʳ (m+n→n x a )) + p← x | tri≈ ¬a b ¬c = m→m+n (q ⟨$⟩ʳ (m+n→m x (lem00 (sym b)))) + p← x | tri> ¬a ¬b c = m→m+n (q ⟨$⟩ʳ (m+n→m x (≤to< c)) ) + + piso← : (x : Fin (n + m) ) → p→ ( p← x ) ≡ x + piso← x with <-cmp (toℕ x ) n + piso← x | tri< a ¬b ¬c = ? + piso← x | tri≈ ¬a b ¬c = ? + piso← x | tri> ¬a ¬b c = ? + + piso→ : (x : Fin (n + m) ) → p← ( p→ x ) ≡ x + piso→ = {!!} + + -- enumeration psawpn : {n m : ℕ} → suc m < n → Permutation n n @@ -132,13 +184,13 @@ pfill1 0 _ perm = perm pfill1 (suc i) i