I'm trying to construct the lattice of intervals with the datatype defined as follows:
data π : Set where
β€ : π
β₯ : π
-β : β€ β π
_+β : β€ β π
I : (l : β€) β (u : β€) β {l β€ u} β π
in order to define the βπ (glb) operator over intervals in some cases I'd have to pattern match over i β€α΅ j
to define the appropriate value of the operator, although I'm not sure how I can reuse the information provided by the pattern matching in the case definition.
In particular in the case
-β x βπ (y +β) with (y β€α΅ x) | inspect (y β€α΅_) x
... | false | [ yβ€xβ‘ff ] = β₯
... | true | [ yβ€xβ‘tt ] = I y x {β€α΅ββ€ {!!}}
I have a witness that (y β€α΅ x) β‘ true
but I'm not sure on how to use it to combine it with β€α΅ββ€
in order to produce the witness of y β€ x
Use _β€?_
instead:
open import Relation.Nullary.Decidable.Core
_βπ_ : π β π β π
-β x βπ (y +β) with y β€? x
... | yes yβ€x = I y x {yβ€x}
... | no _ = β₯
To answer your question literally, you can use T-β‘
: β€α΅ββ€ (Equivalence.from T-β‘ yβ€xβ‘tt)
.