diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-06 12:25:26 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2023-06-06 12:25:26 +0100 |
commit | bf07a9fe3ee4ff06fe186e33221f7f91871b9217 (patch) | |
tree | ac9597b4ad38a354aec3d6edc8b712179bd23b9c /src/Total/Term.idr | |
parent | d5f8497dbb6de72d9664f48d6acbc9772de77be3 (diff) |
Write an encoding for data types.
Diffstat (limited to 'src/Total/Term.idr')
-rw-r--r-- | src/Total/Term.idr | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Total/Term.idr b/src/Total/Term.idr index 1530981..d4da92a 100644 --- a/src/Total/Term.idr +++ b/src/Total/Term.idr @@ -322,6 +322,15 @@ baseComp thin (sub :< t) = cong2 (:<) (baseComp thin sub) (substBase t thin) -- Substitution export +substId : (t : Term ctx ty) -> subst t (Base Id) = t +substId (Var i) = Refl +substId (Abs t) = cong Abs $ trans (sym $ substCong t Base) (substId t) +substId (App t u) = cong2 App (substId t) (substId u) +substId Zero = Refl +substId (Suc t) = cong Suc (substId t) +substId (Rec t u v) = cong3 Rec (substId t) (substId u) (substId v) + +export substHomo : (t : Term ctx ty) -> (sub1 : Terms ctx' ctx) -> |