remark-agda/test/Simple.lagda.md
2024-09-12 18:38:07 -05:00

27 lines
No EOL
627 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```
module Simple where
open import Agda.Primitive
open import Relation.Binary.PropositionalEquality.Core
variable
l : Level
data : Set where
zero :
suc :
_+_ :
zero + b = b
suc a + b = suc (a + b)
+-comm : (m n : ) → m + n ≡ n + m
+-comm zero n = lemma n where
lemma : (n : ) → n ≡ n + zero
lemma zero = refl
lemma (suc n) = cong suc (lemma n)
+-comm (suc m) n = trans (cong suc (+-comm m n)) (sym (lemma n m)) where
lemma : (m n : ) → m + suc n ≡ suc (m + n)
lemma zero n = refl
lemma (suc m) n = cong suc (lemma m n)
```