Mercurial > hg > Papers > 2021 > soto-prosym
view Paper/src/Reasoning.agda.replaced @ 0:c59202657321
init
author | soto <soto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 02 Nov 2021 06:55:58 +0900 |
parents | |
children | 339fb67b4375 |
line wrap: on
line source
open import Relation.Binary.PropositionalEquality open import nat open import nat_add open @$\equiv$@-Reasoning module nat_add_sym_reasoning where addToRight : (n m : Nat) @$\rightarrow$@ S (n + m) @$\equiv$@ n + (S m) addToRight O m = refl addToRight (S n) m = cong S (addToRight n m) addSym : (n m : Nat) @$\rightarrow$@ n + m @$\equiv$@ m + n addSym O O = refl addSym O (S m) = cong S (addSym O m) addSym (S n) O = cong S (addSym n O) addSym (S n) (S m) = begin (S n) + (S m) @$\equiv$@@$\langle$@ refl @$\rangle$@ S (n + S m) @$\equiv$@@$\langle$@ cong S (addSym n (S m)) @$\rangle$@ S ((S m) + n) @$\equiv$@@$\langle$@ addToRight (S m) n @$\rangle$@ S (m + S n) @$\equiv$@@$\langle$@ refl @$\rangle$@ (S m) + (S n) @$\blacksquare$@