From 1e5837c12480d1561361a2f6cb5296895f91dec3 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Wed, 24 Apr 2024 13:43:07 -0500 Subject: Add more merge and unmerge properties --- FinMerge/Properties.agda | 259 +++++++++++++++++++++++++++-------------------- 1 file changed, 148 insertions(+), 111 deletions(-) (limited to 'FinMerge') diff --git a/FinMerge/Properties.agda b/FinMerge/Properties.agda index c250abb..5f92905 100644 --- a/FinMerge/Properties.agda +++ b/FinMerge/Properties.agda @@ -2,25 +2,30 @@ module FinMerge.Properties where open import Data.Empty using (⊥-elim) -open import Data.Fin using (Fin; fromℕ<; toℕ; #_; lower₁) +open import Data.Fin using (Fin; fromℕ<; toℕ; #_; lower₁; _↑ˡ_; cast) open import Data.Fin.Properties using (¬Fin0) open import Data.Nat using (ℕ; _+_; _≤_; _<_; z) open import Util using (_<_<_; _<_≤_; toℕ<; Ordering; less; equal; greater; compare) -open import FinMerge using (merge; unmerge; pluck; glue-once; glue-unglue-once; glue-iter) +open import FinMerge using (merge; unmerge; pluck; glue-once; glue-unglue-once; glue-iter; unpluck) private variable m n : ℕ +s≡s⁻¹ : {j k : ℕ} → ℕ.suc j ≡ ℕ.suc k → j ≡ k +s≡s⁻¹ {ℕ.zero} {ℕ.zero} _ = refl +s≡s⁻¹ {ℕ.suc j} {ℕ.suc .j} refl = refl + not-n : {x : Fin (ℕ.suc n)} → toℕ x < m ≤ n → n ≢ toℕ x not-n (x : {i j k : Fin (ℕ.suc n)} - → ((i - : {i j : Fin (ℕ.suc n)} - → {k : Fin n} - → ((i (i {n} {i} {j} {Fin.suc k} i j≤n j + : {j : Fin (ℕ.suc m)} {k : Fin m} (j≤m : toℕ j ≤ m) (j {ℕ.suc m} {Fin.zero} {_} z≤n (s≤s j {ℕ.suc m} {Fin.suc j} {Fin.suc k} (s≤s j≤m) (s≤s j j≤m j - : {i j : Fin (ℕ.suc n)} - → {k : Fin n} - → ((i {ℕ.suc n} {Fin.zero} {Fin.suc Fin.zero} {Fin.suc k} (s≤s z≤n , s≤s z≤n) (s≤s j {ℕ.suc n} {Fin.zero} {Fin.suc (Fin.suc j)} {Fin.suc k} (s≤s z≤n , s≤s j≤n) (s≤s j (s≤s z≤n , j≤n) j {ℕ.suc n} {Fin.suc i} {Fin.suc j} {Fin.suc k} (s≤s i (i i - : {i j k : Fin (ℕ.suc n)} - → (i {n} {i} {j} {Fin.suc k} i {n} {i} {j} {k} i j≤n j i i + : {j : Fin (ℕ.suc m)} + → {k : Fin m} + → (j≤m : toℕ j ≤ m) + → (j {ℕ.suc m} {Fin.zero} {Fin.suc k} z≤n (s≤s j {ℕ.suc m} {Fin.suc j} {Fin.suc k} (s≤s j≤m) (s≤s j j≤m j i _ _ j i