Skip to content

Commit 84dd2f8

Browse files
authored
add ¬First⇒All lemma to Data.List.Relation.Unary.First.Properties (agda#2507)
* add `¬First⇒All` lemma to `Data.List.Relation.Unary.First.Properties` * Make the list argument implicit
1 parent 7fd48d0 commit 84dd2f8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,9 @@ Additions to existing modules
417417
does-≐ : P ≐ Q → (P? : Decidable P) → (Q? : Decidable Q) → does ∘ P? ≗ does ∘ Q?
418418
does-≡ : (P? P?′ : Decidable P) → does ∘ P? ≗ does ∘ P?′
419419
```
420+
421+
* In `Data.List.Relation.Unary.First.Properties`:
422+
```agda
423+
¬First⇒All : ∁ Q ⊆ P → ∁ (First P Q) ⊆ All P
424+
```
425+

src/Data/List/Relation/Unary/First/Properties.agda

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
5959
First⇒¬All q⇒¬p [ qx ] (px ∷ pxs) = q⇒¬p qx px
6060
First⇒¬All q⇒¬p (_ ∷ pqxs) (_ ∷ pxs) = First⇒¬All q⇒¬p pqxs pxs
6161

62+
¬First⇒All : ∁ Q ⊆ P ∁ (First P Q) ⊆ All P
63+
¬First⇒All ¬q⇒p {[]} _ = []
64+
¬First⇒All ¬q⇒p {x ∷ xs} ¬pqxxs =
65+
let px = ¬q⇒p (¬pqxxs ∘ [_]) in
66+
px ∷ ¬First⇒All ¬q⇒p (¬pqxxs ∘ (px ∷_))
67+
6268
------------------------------------------------------------------------
6369
-- Irrelevance
6470

0 commit comments

Comments
 (0)