diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2023-04-07 17:52:02 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2023-04-07 17:52:02 +0100 |
commit | 670ab78c2033198a33f1e24e8ce84a697cab5243 (patch) | |
tree | 6d5f04668db363526af62321e6c6958f72f616d3 | |
parent | 949af08cd4135ae3df0445e7daaf3b47ca861b4a (diff) |
Prove term weakening respects identities.
-rw-r--r-- | src/Core/Term.idr | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Core/Term.idr b/src/Core/Term.idr index 182e1ea..7e1a91c 100644 --- a/src/Core/Term.idr +++ b/src/Core/Term.idr @@ -32,6 +32,26 @@ wkn (Pi n t u) thin = Pi n (wkn t thin) (wkn u $ keep thin n) wkn (Abs n t) thin = Abs n (wkn t $ keep thin n) wkn (App t u) thin = App (wkn t thin) (wkn u thin) +-- Respects Identity + +export +wknId : (t : Term sx) -> wkn t (id sx) = t +wknId (Var i) = cong Var (wknId i) +wknId Set = Refl +wknId (Pi n t u) = + cong2 (Pi n) (wknId t) $ + Calc $ + |~ wkn u (keep (id sx) n) + ~~ wkn u (id $ sx :< n) ...(cong (wkn u) $ keepIdIsId sx n) + ~~ u ...(wknId u) +wknId (Abs n t) = + cong (Abs n) $ + Calc $ + |~ wkn t (keep (id sx) n) + ~~ wkn t (id $ sx :< n) ...(cong (wkn t) $ keepIdIsId sx n) + ~~ t ...(wknId t) +wknId (App t u) = cong2 App (wknId t) (wknId u) + -- Is Homomorphic export |