{-# OPTIONS --without-K --safe #-}
module Relation.Binary.Reasoning.MultiSetoid where
open import Level using (_⊔_)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality as P using (_≡_)
module _ {c ℓ} (S : Setoid c ℓ) where
open Setoid S
data IsRelatedTo (x y : _) : Set (c ⊔ ℓ) where
relTo : (x∼y : x ≈ y) → IsRelatedTo x y
infix 1 begin⟨_⟩_
begin⟨_⟩_ : ∀ {x y} → IsRelatedTo x y → x ≈ y
begin⟨_⟩_ (relTo eq) = eq
module _ {c ℓ} {S : Setoid c ℓ} where
open Setoid S
infixr 2 _≈⟨_⟩_ _≈˘⟨_⟩_ _≡⟨_⟩_ _≡˘⟨_⟩_ _≡⟨⟩_
infix 3 _∎
_≈⟨_⟩_ : ∀ x {y z} → x ≈ y → IsRelatedTo S y z → IsRelatedTo S x z
_ ≈⟨ x∼y ⟩ relTo y∼z = relTo (trans x∼y y∼z)
_≈˘⟨_⟩_ : ∀ x {y z} → y ≈ x → IsRelatedTo S y z → IsRelatedTo S x z
x ≈˘⟨ x≈y ⟩ y∼z = x ≈⟨ sym x≈y ⟩ y∼z
_≡⟨_⟩_ : ∀ x {y z} → x ≡ y → IsRelatedTo S y z → IsRelatedTo S x z
_ ≡⟨ P.refl ⟩ x∼z = x∼z
_≡˘⟨_⟩_ : ∀ x {y z} → y ≡ x → IsRelatedTo S y z → IsRelatedTo S x z
_ ≡˘⟨ P.refl ⟩ x∼z = x∼z
_≡⟨⟩_ : ∀ x {y} → IsRelatedTo S x y → IsRelatedTo S x y
_ ≡⟨⟩ x∼y = _ ≡⟨ P.refl ⟩ x∼y
_∎ : ∀ x → IsRelatedTo S x x
_∎ _ = relTo refl