| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Dependent product combinators for propositional equality |
| 5 |
-- preserving functions |
| 6 |
------------------------------------------------------------------------ |
| 7 |
|
| 8 |
{-# OPTIONS --with-K --safe #-} |
| 9 |
|
| 10 |
module Data.Product.Function.Dependent.Propositional.WithK where |
| 11 |
|
| 12 |
open import Data.Product.Base using (Σ; _,_) |
| 13 |
open import Data.Product.Function.Dependent.Setoid using (injection) |
| 14 |
open import Data.Product.Relation.Binary.Pointwise.Dependent.WithK |
| 15 |
using (Pointwise-≡↔≡) |
| 16 |
open import Function.Base using (_$_) |
| 17 |
open import Function.Bundles using (Injection; _↣_) |
| 18 |
open import Function.Properties.Injection using (↣-trans) |
| 19 |
open import Function.Properties.Inverse as Inverse using (Inverse⇒Injection) |
| 20 |
open import Relation.Binary.Indexed.Heterogeneous.Construct.At using (_atₛ_) |
| 21 |
open import Relation.Binary.HeterogeneousEquality as H using (_≅_; ≡↔≅) |
| 22 |
open import Level using (Level) |
| 23 |
|
| 24 |
private |
| 25 |
variable |
| 26 |
i a : Level |
| 27 |
I J : Set i |
| 28 |
A B : I → Set a |
| 29 |
|
| 30 |
------------------------------------------------------------------------ |
| 31 |
-- Combinator for Injection |
| 32 |
|
| 33 |
module _ where |
| 34 |
open Injection |
| 35 |
|
| 36 |
Σ-↣ : (I↣J : I ↣ J) → |
| 37 |
(∀ {i} → A i ↣ B (to I↣J i)) → |
| 38 |
Σ I A ↣ Σ J B |
| 39 |
Σ-↣ {A = A} {B = B} I↣J A↣B = |
| 40 |
↣-trans (Inverse⇒Injection (Inverse.sym Pointwise-≡↔≡)) $ |
| 41 |
↣-trans (injection I↣J Aᵢ↣Bᵢ) $ |
| 42 |
Inverse⇒Injection Pointwise-≡↔≡ |
| 43 |
where |
| 44 |
Aᵢ↣Bᵢ : (∀ {i} → Injection (H.indexedSetoid A atₛ i) (H.indexedSetoid B atₛ (Injection.to I↣J i))) |
| 45 |
Aᵢ↣Bᵢ = |
| 46 |
↣-trans (Inverse⇒Injection (Inverse.sym (H.≡↔≅ A))) $ |
| 47 |
↣-trans A↣B $ |
| 48 |
Inverse⇒Injection (H.≡↔≅ B) |