open import Graded.Modality
module Graded.Modality.Properties.Equivalence
{a} {M : Set a} (π : Semiring-with-meet M) where
open Semiring-with-meet π
open import Graded.Modality.Properties.PartialOrder π
open import Tools.Function
open import Tools.PropositionalEquality
import Tools.Reasoning.PropositionalEquality
open import Tools.Relation
private variable
p q : M
β€-decidableββ‘-decidable : Decidable _β€_ β Decidable (_β‘_ {A = M})
β€-decidableββ‘-decidable _β€?_ p q = case p β€? q of Ξ» where
(no pβ°q) β no Ξ» pβ‘q β pβ°q (β€-reflexive pβ‘q)
(yes pβ€q) β case q β€? p of Ξ» where
(no qβ°p) β no Ξ» pβ‘q β qβ°p (β€-reflexive (sym pβ‘q))
(yes qβ€p) β yes (β€-antisym pβ€q qβ€p)
β‘π : π β‘ π β p β‘ π
β‘π {p = p} πβ‘π = begin
p β‘Λβ¨ Β·-identityΛ‘ _ β©
π Β· p β‘β¨ Β·-congΚ³ πβ‘π β©
π Β· p β‘β¨ Β·-zeroΛ‘ _ β©
π β
where
open Tools.Reasoning.PropositionalEquality
β‘-trivial : π β‘ π β p β‘ q
β‘-trivial {p = p} {q = q} πβ‘π = begin
p β‘β¨ β‘π πβ‘π β©
π β‘Λβ¨ β‘π πβ‘π β©
q β
where
open Tools.Reasoning.PropositionalEquality
β’βπβ’π : p β’ q β π β’ π
β’βπβ’π pβ’q = pβ’q ββ β‘-trivial