-
Notifications
You must be signed in to change notification settings - Fork 249
Very dependent map #2373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Very dependent map #2373
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a750927
add some 'very dependent' maps to Data.Product. More documentation to…
JacquesCarette dabfa9f
Merge branch 'master' into VeryDependentMap
JacquesCarette 3287bee
and document
JacquesCarette 829e819
make imports more precise
JacquesCarette 7e3da8b
minimal properties of very-dependen map and zipWith. Structured to ma…
JacquesCarette e3dffb8
whitespace
JacquesCarette 1aa3e62
Merge branch 'master' into VeryDependentMap
JacquesCarette a3fce90
implement new names and suggestions about using pattern-matching in t…
JacquesCarette baa1861
whitespace in CHANGELOG
JacquesCarette 84a4bf7
small cleanup based on latest round of comments
JacquesCarette dda6607
and fix the names in the comments too.
JacquesCarette 181ba50
Merge branch 'master' into VeryDependentMap
jamesmckinna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Properties of 'very dependent' map / zipWith over products | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Data.Product.Properties.Dependent where | ||
|
||
open import Data.Product using (Σ; _×_; _,_; map-Σ; map-Σ′; zipWith) | ||
open import Function.Base using (id; flip) | ||
open import Level using (Level) | ||
open import Relation.Binary.PropositionalEquality.Core | ||
using (_≡_; _≗_; cong₂; refl) | ||
|
||
private | ||
variable | ||
a b p q r s : Level | ||
A B C : Set a | ||
|
||
------------------------------------------------------------------------ | ||
-- map-Σ | ||
|
||
module _ {B : A → Set b} {P : A → Set p} {Q : {x : A} → P x → B x → Set q} where | ||
|
||
map-Σ-cong : {f g : (x : A) → B x} → {h k : ∀ {x} → (y : P x) → Q y (f x)} → | ||
(∀ x → f x ≡ g x) → | ||
(∀ {x} → (y : P x) → h y ≡ k y) → | ||
(v : Σ A P) → map-Σ f h v ≡ map-Σ g k v | ||
map-Σ-cong f≗g h≗k (x , y) = cong₂ _,_ (f≗g x) (h≗k y) | ||
|
||
------------------------------------------------------------------------ | ||
-- map-Σ′ | ||
|
||
module _ {B : A → Set b} {P : Set p} {Q : P → Set q} where | ||
|
||
map-Σ′-cong : {f g : (x : A) → B x} → {h k : (x : P) → Q x} → | ||
(∀ x → f x ≡ g x) → | ||
((y : P) → h y ≡ k y) → | ||
(v : A × P) → map-Σ′ f h v ≡ map-Σ′ g k v | ||
map-Σ′-cong f≗g h≗k (x , y) = cong₂ _,_ (f≗g x) (h≗k y) | ||
|
||
------------------------------------------------------------------------ | ||
-- zipWith | ||
|
||
module _ {P : A → Set p} {Q : B → Set q} {R : C → Set r} {S : (x : C) → R x → Set s} where | ||
|
||
zipWith-flip : (_∙_ : A → B → C) → (_∘_ : ∀ {x y} → P x → Q y → R (x ∙ y)) → | ||
(_*_ : (x : C) → (y : R x) → S x y) → | ||
{x : Σ A P} → {y : Σ B Q} → | ||
zipWith _∙_ _∘_ _*_ x y ≡ zipWith (flip _∙_) (flip _∘_) _*_ y x | ||
zipWith-flip _∙_ _∘_ _*_ = refl |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.