module _ where open import nat open import eq open import sum open import bool open import bool-thms open import nat-thms {- Be aware that you can define helper functions (aka lemmas). Often, it is easier to prove some specific lemma on its own and then use it in a larger proof. This is very handy even when the main proof is only two or three lines, in fact. -} {- We did right distributive in class; state and prove that multiplication also distributes on the right, eg, for any three numbers, x, y, and z: z * (x + y) ≡ z * x + z * y -} -- This predicate determines if a number is a multiple of three or not m3 : ℕ -> 𝔹 m3 zero = tt m3 (suc zero) = ff m3 (suc (suc zero)) = ff m3 (suc (suc (suc n))) = m3 n {- prove that the sum of two multiples of three is also a multiple of three -} summ3 : ∀ n m -> m3 n ≡ tt -> m3 m ≡ tt -> m3 (n + m) ≡ tt summ3 = {!!} {- prove that the product of a multiple of three and any other number is also a multiple of three -} multm3 : ∀ n m -> m3 n ≡ tt -> m3 (n * m) ≡ tt multm3 = {!!} {- consider this alternative definition of less than: -} _≥2_ : nat -> nat -> bool zero ≥2 zero = tt zero ≥2 (suc m) = ff (suc n) ≥2 zero = tt (suc n) ≥2 (suc m) = n ≥2 m {- prove that it is the same as the definition in the ial, i.e. prove these two results: -} ≥2->≥ : ∀ n m -> n ≥2 m ≡ tt -> n ≥ m ≡ tt ≥2->≥ = {!!} ≥->≥2 : ∀ n m -> n ≥ m ≡ tt -> n ≥2 m ≡ tt ≥->≥2 = {!!}