diff --git a/code/gcbpv.agda b/code/gcbpv.agda index 92cf7c579268c6523fc05e781ae946807c57b502..44280d02101f499e9abde2fd1618888e05b03dda 100644 --- a/code/gcbpv.agda +++ b/code/gcbpv.agda @@ -59,9 +59,14 @@ vtrans Atop Abot p ⟨ Bot ⟩v = Abot ⟨ Bot ⟩v data CType where _⇀_ : forall {I} -> VType I -> CType I -> CType I F : forall {I} -> VType I -> CType I + ctrans : forall (Btop : CType onevar) (Bbot : CType onevar) -> + Btop ⟨ Bot ⟩c ≡ Bbot ⟨ Top ⟩c -> + CType onevar (A ⇀ B) ⟨ i ⟩c = (A ⟨ i ⟩v) ⇀ (B ⟨ i ⟩c) F A ⟨ i ⟩c = F (A ⟨ i ⟩v) +ctrans Btop Bbot p ⟨ Top ⟩c = Btop ⟨ Top ⟩c +ctrans Btop Bbot p ⟨ Bot ⟩c = Bbot ⟨ Bot ⟩c vrefl : VType (cdot _) -> VType onevar crefl : CType (cdot _) -> CType onevar @@ -72,3 +77,31 @@ vrefl (U B) = U (crefl B) crefl (A ⇀ B) = vrefl A ⇀ crefl B crefl (F A) = F (vrefl A) +vreflretract : forall A i -> vrefl A ⟨ i ⟩v ≡ A +creflretract : forall B i -> crefl B ⟨ i ⟩c ≡ B + +vreflretract (VUnit .(ctx None ⊥-elim)) i = refl +vreflretract (A × Aâ‚) i = congâ‚‚ _×_ (vreflretract A i) (vreflretract Aâ‚ i) +vreflretract (U B) i = cong U (creflretract B i) + +creflretract (A ⇀ B) i = congâ‚‚ _⇀_ (vreflretract A i) (creflretract B i) +creflretract (F A) i = cong F (vreflretract A i) + +-- | For a more traditional presentation of ordering +data VLt (A A' : VType (cdot _)) : Set where + lt : forall (Aord : VType onevar) -> Aord ⟨ Top ⟩v ≡ A -> Aord ⟨ Bot ⟩v ≡ A' -> VLt A A' +data CLt (B B' : CType (cdot _)) : Set where + lt : forall (Bord : CType onevar) -> Bord ⟨ Top ⟩c ≡ B -> Bord ⟨ Bot ⟩c ≡ B' -> CLt B B' + +-- | Some sanity checking +vltrefl : forall A -> VLt A A +vltrefl A = lt (vrefl A) (vreflretract A Top) ((vreflretract A Bot)) + +vlttrans : forall A1 A2 A3 -> VLt A1 A2 -> VLt A2 A3 -> VLt A1 A3 +vlttrans A1 A2 A3 (lt A12 x xâ‚) (lt A23 xâ‚‚ x₃) = lt (vtrans A12 A23 (trans xâ‚ (sym xâ‚‚))) x x₃ + +cltrefl : forall B -> CLt B B +cltrefl B = lt (crefl B) (creflretract B Top) ((creflretract B Bot)) + +clttrans : forall B1 B2 B3 -> CLt B1 B2 -> CLt B2 B3 -> CLt B1 B3 +clttrans B1 B2 B3 (lt B12 x xâ‚) (lt B23 xâ‚‚ x₃) = lt (ctrans B12 B23 (trans xâ‚ (sym xâ‚‚))) x x₃