------------------------------------------------------------------------ -- The Agda standard library -- -- Pointwise products of binary relations ------------------------------------------------------------------------ {-# OPTIONS --cubical-compatible --safe #-} module Data.Product.Relation.Binary.Pointwise.NonDependent where open import Data.Product.Base as Product open import Data.Sum.Base using (inj₁; inj₂) open import Level using (Level; _⊔_; 0ℓ) open import Function.Base using (id) open import Function.Bundles using (Inverse) open import Relation.Nullary.Decidable using (_×-dec_) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder; Poset; StrictPartialOrder) open import Relation.Binary.Definitions open import Relation.Binary.Structures open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_) import Relation.Binary.PropositionalEquality.Properties as ≡ private variable a b ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Level A B C D : Set a R S ≈₁ ≈₂ : Rel A ℓ₁ ------------------------------------------------------------------------ -- Definition Pointwise : REL A B ℓ₁ → REL C D ℓ₂ → REL (A × C) (B × D) (ℓ₁ ⊔ ℓ₂) Pointwise R S (a , c) (b , d) = (R a b) × (S c d) ------------------------------------------------------------------------ -- Pointwise preserves many relational properties ×-reflexive : ≈₁ ⇒ R → ≈₂ ⇒ S → Pointwise ≈₁ ≈₂ ⇒ Pointwise R S ×-reflexive refl₁ refl₂ = Product.map refl₁ refl₂ ×-refl : Reflexive R → Reflexive S → Reflexive (Pointwise R S) ×-refl refl₁ refl₂ = refl₁ , refl₂ ×-irreflexive₁ : Irreflexive ≈₁ R → Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) ×-irreflexive₁ ir x≈y x