Skip to content

Instantly share code, notes, and snippets.

@gallais
Created October 8, 2015 13:59
Show Gist options
  • Save gallais/3c6c00eb1b5a85439102 to your computer and use it in GitHub Desktop.
Save gallais/3c6c00eb1b5a85439102 to your computer and use it in GitHub Desktop.
Elaborating With
module With where
open import Data.Nat using (ℕ ; _+_)
open import Relation.Binary.PropositionalEquality
module UsingWith where
plus-n-0 : (n : ℕ) → n + 0 ≡ n
plus-n-0 ℕ.zero = refl
plus-n-0 (ℕ.suc n) with n + 0 | plus-n-0 n
plus-n-0 (ℕ.suc n) | .n | refl = refl
module ElabWith where
mutual
plus-n-0 : (n : ℕ) → n + 0 ≡ n
plus-n-0 ℕ.zero = refl
plus-n-0 (ℕ.suc n) = plus-n-0-with n (n + 0) (plus-n-0 n)
plus-n-0-with : (n k : ℕ) → k ≡ n → ℕ.suc k ≡ ℕ.suc n
plus-n-0-with _ _ refl = refl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment