Skip to content

Commit b47bcde

Browse files
authored
Add Data.Product.Properties.map-cong₂ (#1532)
1 parent 4e2b20a commit b47bcde

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ Other minor additions
123123
```
124124
and their corresponding algebraic substructures.
125125

126+
* Added new proof to `Data.Product.Properties`:
127+
```agda
128+
map-cong : f ≗ g → h ≗ i → map f h ≗ map g i
129+
```
130+
126131
* Added new proofs in `Data.String.Properties`:
127132
```
128133
≤-isDecTotalOrder-≈ : IsDecTotalOrder _≈_ _≤_

src/Codata/M/Properties.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ open import Codata.M.Bisimilarity
1616
open import Data.Container.Core as C hiding (map)
1717
import Data.Container.Morphism as Mp
1818
open import Data.Product as Prod using (_,_)
19-
open import Data.Product.Properties
19+
open import Data.Product.Properties hiding (map-cong)
2020
open import Function
2121
import Relation.Binary.PropositionalEquality as P
2222

src/Data/Product/Properties.agda

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ open import Relation.Nullary using (Dec; yes; no)
2020

2121
private
2222
variable
23-
a b ℓ : Level
23+
a b c d : Level
2424
A : Set a
2525
B : Set b
26+
C : Set c
27+
D : Set d
2628

2729
------------------------------------------------------------------------
2830
-- Equality (dependent)
@@ -53,6 +55,9 @@ module _ {B : A → Set b} where
5355
,-injective : {a c : A} {b d : B} (a , b) ≡ (c , d) a ≡ c × b ≡ d
5456
,-injective refl = refl , refl
5557

58+
map-cong : {f g : A C} {h i : B D} f ≗ g h ≗ i map f h ≗ map g i
59+
map-cong f≗g h≗i (x , y) = cong₂ _,_ (f≗g x) (h≗i y)
60+
5661
-- The following properties are definitionally true (because of η)
5762
-- but for symmetry with ⊎ it is convenient to define and name them.
5863

0 commit comments

Comments
 (0)