Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Bug-fixes
the record constructors `_,_` incorrectly had no declared fixity. They have been given
the fixity `infixr 4 _,_`, consistent with that of `Data.Product.Base`.

* In `Data.Product.Function.Dependent.Setoid`, `left-inverse` defined a
`RightInverse`.
This has been deprecated in favor or `rightInverse`, and a corrected (and
correctly-named) function `leftInverse` has been added.

Non-backwards compatible changes
--------------------------------

Expand All @@ -31,6 +36,8 @@ Minor improvements
* Moved the concept `Irrelevant` of irrelevance (h-proposition) from `Relation.Nullary`
to its own dedicated module `Relation.Nullary.Irrelevant`.

* Added `Σ-↪` in `Data.Product.Function.Dependent.Propositional`.

Deprecated modules
------------------

Expand Down Expand Up @@ -134,6 +141,11 @@ Deprecated names
product-↭ ↦ Data.Nat.ListAction.Properties.product-↭
```

* In `Data.Product.Function.Dependent.Setoid`:
```agda
left-inverse ↦ rightInverse
```

New modules
-----------

Expand Down
9 changes: 9 additions & 0 deletions src/Data/Product/Function/Dependent/Propositional.agda
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ open import Function.Bundles
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_)
open import Relation.Binary.PropositionalEquality.Properties as ≡
using (module ≡-Reasoning)
open import Function.Construct.Symmetry using (↩-sym; ↪-sym)

private
variable
Expand Down Expand Up @@ -238,6 +239,14 @@ module _ where
------------------------------------------------------------------------
-- Right inverses

module _ where
open RightInverse

-- the dual to Σ-↩, taking advantage of the proof above by threading
-- relevant symmetry proofs through it.
Σ-↪ : (I↪J : I ↪ J) → (∀ {j} → A (from I↪J j) ↪ B j) → Σ I A ↪ Σ J B
Σ-↪ I↪J A↪B = ↩-sym (Σ-↩ (↪-sym I↪J) (↪-sym A↪B))

------------------------------------------------------------------------
-- Inverses

Expand Down
36 changes: 32 additions & 4 deletions src/Data/Product/Function/Dependent/Setoid.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
------------------------------------------------------------------------
-----------------------------------------------------------------------
-- The Agda standard library
--
-- Dependent product combinators for setoid equality preserving
Expand All @@ -20,6 +20,7 @@ open import Function.Properties.Injection using (mkInjection)
open import Function.Properties.Surjection using (mkSurjection; ↠⇒⇔)
open import Function.Properties.Equivalence using (mkEquivalence; ⇔⇒⟶; ⇔⇒⟵)
open import Function.Properties.RightInverse using (mkRightInverse)
import Function.Construct.Symmetry as Sym
open import Relation.Binary.Core using (_=[_]⇒_)
open import Relation.Binary.Bundles as B
open import Relation.Binary.Indexed.Heterogeneous
Expand Down Expand Up @@ -179,17 +180,17 @@ module _ where
surj = strictlySurjective⇒surjective (I ×ₛ A) (J ×ₛ B) (Func.cong func) strictlySurj

------------------------------------------------------------------------
-- LeftInverse
-- RightInverse

module _ where
open RightInverse
open Setoid

left-inverse :
rightInverse :
(I↪J : I ↪ J) →
(∀ {j} → RightInverse (A atₛ (from I↪J j)) (B atₛ j)) →
RightInverse (I ×ₛ A) (J ×ₛ B)
left-inverse {I = I} {J = J} {A = A} {B = B} I↪J A↪B =
rightInverse {I = I} {J = J} {A = A} {B = B} I↪J A↪B =
mkRightInverse equiv invʳ
where
equiv : Equivalence (I ×ₛ A) (J ×ₛ B)
Expand All @@ -201,6 +202,19 @@ module _ where
invʳ : Inverseʳ (_≈_ (I ×ₛ A)) (_≈_ (J ×ₛ B)) (Equivalence.to equiv) (Equivalence.from equiv)
invʳ = strictlyInverseʳ⇒inverseʳ (I ×ₛ A) (J ×ₛ B) (Equivalence.from-cong equiv) strictlyInvʳ

------------------------------------------------------------------------
-- LeftInverse

module _ where
open LeftInverse
open Setoid

leftInverse :
(I↩J : I ↩ J) →
(∀ {i} → LeftInverse (A atₛ i) (B atₛ (to I↩J i))) →
LeftInverse (I ×ₛ A) (J ×ₛ B)
leftInverse {I = I} {J = J} {A = A} {B = B} I↩J A↩B =
Sym.leftInverse (rightInverse (Sym.rightInverse I↩J) (Sym.rightInverse A↩B))

------------------------------------------------------------------------
-- Inverses
Expand Down Expand Up @@ -252,3 +266,17 @@ module _ where
invʳ : Inverseʳ (_≈_ (I ×ₛ A)) (_≈_ (J ×ₛ B)) to′ from′
invʳ = strictlyInverseʳ⇒inverseʳ (I ×ₛ A) (J ×ₛ B) from′-cong strictlyInvʳ


------------------------------------------------------------------------
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.

-- Version 2.3

left-inverse = rightInverse
{-# WARNING_ON_USAGE left-inverse
"Warning: left-inverse was deprecated in v2.3.
Please use rightInverse or leftInverse instead."
#-}