Progress towards UFDs (#88)

This commit is contained in:
Patrick Stevens
2019-12-08 11:18:39 +00:00
committed by GitHub
parent 99c38495ce
commit 33098e94b0
20 changed files with 462 additions and 253 deletions

22
Lists/Length.agda Normal file
View File

@@ -0,0 +1,22 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Functions
open import Numbers.Naturals.Semiring -- for length
open import Numbers.Naturals.Order
open import Semirings.Definition
open import Lists.Definition
open import Lists.Fold.Fold
module Lists.Length where
length : {a : _} {A : Set a} (l : List A)
length [] = zero
length (x :: l) = succ (length l)
length' : {a : _} {A : Set a} (l : List A)
length' = fold (λ _ succ) 0
length=length' : {a : _} {A : Set a} (l : List A) length l length' l
length=length' [] = refl
length=length' (x :: l) = applyEquality succ (length=length' l)