Skip to content
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

Pulling back an equivalence relation along a function #876

Merged
merged 3 commits into from
Aug 5, 2022
Merged
Changes from all 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
38 changes: 37 additions & 1 deletion Cubical/Relation/Binary/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,40 @@
module Cubical.Relation.Binary.Properties where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Relation.Binary.Base

private
variable
ℓ : Level
A B : Type ℓ


-- Pulling back a relation along a function.
-- This can for example be used when restricting an equivalence relation to a subset:
-- _~'_ = on fst _~_

module _
(f : A → B)
(R : Rel B B ℓ)
where

open BinaryRelation

pulledbackRel : Rel A A ℓ
pulledbackRel x y = R (f x) (f y)

isReflPulledbackRel : isRefl R → isRefl pulledbackRel
isReflPulledbackRel isReflR a = isReflR (f a)

isSymPulledbackRel : isSym R → isSym pulledbackRel
isSymPulledbackRel isSymR a a' = isSymR (f a) (f a')

isTransPulledbackRel : isTrans R → isTrans pulledbackRel
isTransPulledbackRel isTransR a a' a'' = isTransR (f a) (f a') (f a'')

open isEquivRel

isEquivRelPulledbackRel : isEquivRel R → isEquivRel pulledbackRel
reflexive (isEquivRelPulledbackRel isEquivRelR) = isReflPulledbackRel (reflexive isEquivRelR)
symmetric (isEquivRelPulledbackRel isEquivRelR) = isSymPulledbackRel (symmetric isEquivRelR)
transitive (isEquivRelPulledbackRel isEquivRelR) = isTransPulledbackRel (transitive isEquivRelR)