IIRDr.agda 803 B

123456789101112131415161718192021222324252627282930
  1. {-# OPTIONS --no-positivity-check #-}
  2. module IIRDr where
  3. import LF
  4. import IIRD
  5. open LF
  6. open IIRD
  7. -- Agda2 has restricted IIRDs so we can define Ur/Tr directly
  8. mutual
  9. data Ur {I : Set}{D : I -> Set1}(γ : OPr I D)(i : I) : Set where
  10. intror : Hu γ (Ur γ) (Tr γ) i -> Ur {I}{D} γ i
  11. Tr : {I : Set}{D : I -> Set1}(γ : OPr I D)(i : I) -> Ur γ i -> D i
  12. Tr γ i (intror a) = Ht γ (Ur γ) (Tr γ) i a
  13. -- Elimination rule
  14. Rr : {I : Set}{D : I -> Set1}(γ : OPr I D)(F : (i : I) -> Ur γ i -> Set1)
  15. (h : (i : I)(a : Hu γ (Ur γ) (Tr γ) i) -> KIH (γ i) (Ur γ) (Tr γ) F a -> F i (intror a))
  16. (i : I)(u : Ur γ i) -> F i u
  17. Rr γ F h i (intror a) = h i a (Kmap (γ i) (Ur γ) (Tr γ) F (Rr γ F h) a)
  18. -- Helpers
  19. ι★r : {I : Set}{D : I -> Set1} -> OP I D One'
  20. ι★r = ι ★'