From 8f714dbe4291994571bd98474b8f8455e8c75571 Mon Sep 17 00:00:00 2001 From: jamesmckinna Date: Fri, 25 Jul 2025 09:34:41 +0100 Subject: [PATCH 1/5] refactor: following #2746 --- src/Data/Fin/Properties.agda | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index 0f87eef534..a1365729a7 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1035,20 +1035,16 @@ pigeonhole : m ℕ.< n → (f : Fin n → Fin m) → ∃₂ λ i j → i < j × pigeonhole z Date: Sat, 26 Jul 2025 11:19:37 +0100 Subject: [PATCH 2/5] refactor: deploy the `flip contradiction` workaround --- src/Data/Fin/Properties.agda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index a1365729a7..0f596ea58e 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1063,7 +1063,7 @@ injective⇒existsPivot : ∀ {f : Fin n → Fin m} → Injective _≡_ _≡_ f injective⇒existsPivot {f = f} f-injective i with any? (λ j → j ≤? i ×-dec i ≤? f j) ... | yes result = result -... | no ¬result = contradiction (injective⇒≤ f∘inject!-injective) ℕ.1+n≰n +... | no ¬result = flip contradiction (<⇒notInjective (ℕ.n<1+n _)) f∘inject!-injective where fj Date: Sat, 26 Jul 2025 12:47:01 +0100 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20prefer=20`<=E2=87=92notInjectiv?= =?UTF-8?q?e`=20over=20`injective=E2=87=92=E2=89=A4`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/Fin/Properties.agda | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index 0f596ea58e..639d85bebc 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1047,8 +1047,8 @@ injective⇒≤ : ∀ {f : Fin m → Fin n} → Injective _≡_ _≡_ f → m injective⇒≤ = ℕ.≮⇒≥ ∘ flip <⇒notInjective ℕ→Fin-notInjective : ∀ (f : ℕ → Fin n) → ¬ (Injective _≡_ _≡_ f) -ℕ→Fin-notInjective f inj = ℕ.<-irrefl refl - (injective⇒≤ (Comp.injective _≡_ _≡_ _≡_ toℕ-injective inj)) +ℕ→Fin-notInjective f inj = + <⇒notInjective (ℕ.n<1+n _) (Comp.injective _≡_ _≡_ _≡_ toℕ-injective inj) -- Cantor-Schröder-Bernstein for finite sets From cffce87595d830839371241dd4660bc8e3d7a308 Mon Sep 17 00:00:00 2001 From: jamesmckinna Date: Sat, 26 Jul 2025 12:50:16 +0100 Subject: [PATCH 4/5] fix: whitespace --- src/Data/Fin/Properties.agda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index 639d85bebc..fec02528a9 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1047,7 +1047,7 @@ injective⇒≤ : ∀ {f : Fin m → Fin n} → Injective _≡_ _≡_ f → m injective⇒≤ = ℕ.≮⇒≥ ∘ flip <⇒notInjective ℕ→Fin-notInjective : ∀ (f : ℕ → Fin n) → ¬ (Injective _≡_ _≡_ f) -ℕ→Fin-notInjective f inj = +ℕ→Fin-notInjective f inj = <⇒notInjective (ℕ.n<1+n _) (Comp.injective _≡_ _≡_ _≡_ toℕ-injective inj) -- Cantor-Schröder-Bernstein for finite sets From 92477cf9a6dfb4e912ef97c9bfc4b13b249b39ab Mon Sep 17 00:00:00 2001 From: jamesmckinna Date: Sat, 2 Aug 2025 12:06:26 +0100 Subject: [PATCH 5/5] fix: DRY with `private` specialisation --- src/Data/Fin/Properties.agda | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index fec02528a9..46f0ae80d2 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1043,12 +1043,18 @@ pigeonhole (s