IID-New-Proof-Setup.agda 746 B

123456789101112131415161718192021222324252627
  1. module IID-New-Proof-Setup where
  2. open import LF
  3. open import Identity
  4. open import IID
  5. open import IIDr
  6. open import DefinitionalEquality
  7. OPg : Set -> Set1
  8. OPg I = OP I I
  9. -- Encoding indexed inductive types as non-indexed types.
  10. ε : {I : Set}(γ : OPg I) -> OPr I
  11. ε (ι i) j = σ (i == j) (\_ -> ι ★)
  12. ε (σ A γ) j = σ A (\a -> ε (γ a) j)
  13. ε (δ H i γ) j = δ H i (ε γ j)
  14. -- Adds a reflexivity proof.
  15. g→rArgs : {I : Set}(γ : OPg I)(U : I -> Set)
  16. (a : Args γ U) ->
  17. rArgs (ε γ) U (index γ U a)
  18. g→rArgs (ι e) U arg = (refl , ★)
  19. g→rArgs (σ A γ) U arg = (π₀ arg , g→rArgs (γ (π₀ arg)) U (π₁ arg))
  20. g→rArgs (δ H i γ) U arg = (π₀ arg , g→rArgs γ U (π₁ arg))