-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnat_mul_mon.agda
69 lines (51 loc) · 1.72 KB
/
nat_mul_mon.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{-# OPTIONS --prop #-}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; cong; refl; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎; step-≡)
open import Level using (Level; _⊔_; suc; 0ℓ)
private
variable
a b l : Level
A : Set a
B : Set b
REL : Set a -> Set b -> (l : Level) -> Set (a ⊔ b ⊔ suc l)
REL A B l = A → B → Set l
Rel : Set a → (l : Level) → Set (a ⊔ suc l)
Rel A l = REL A A l
data ℕ : Set where
Z : ℕ
S : ℕ → ℕ
data _≥_ : Rel ℕ 0ℓ where
n≥z : {n : ℕ} → n ≥ Z
s≥s : {m n : ℕ} → (m≥n : m ≥ n) → S m ≥ S n
_+_ : ℕ → ℕ → ℕ
_+_ Z a = a
_+_ (S a) b = S (a + b)
_*_ : ℕ → ℕ → ℕ
_*_ Z a = Z
_*_ (S a) b = b + (a * b)
Z*a=Z : (a : ℕ) → Z * a ≡ Z
Z*a=Z Z = refl
Z*a=Z (S a) = Z*a=Z a
a*Z=Z : (a : ℕ) → a * Z ≡ Z
a*Z=Z Z = refl
a*Z=Z (S a) = a*Z=Z a
-- data Bot : Prop where
-- record Top : Prop where
-- constructor tt
-- _≥_ : ℕ → ℕ → Prop
-- S x ≥ S y = x ≥ y
-- Z ≥ S _ = Bot
-- _ ≥ Z = Top
-- mul-is-monotonic : {a b c : ℕ} -> a ≥ b -> (a * c) ≥ (b * c)
-- mul-is-monotonic {Z} {Z} {c} p = tt
-- mul-is-monotonic {S a} {Z} {Z} p rewrite a*Z=Z a = tt
-- mul-is-monotonic {S a} {Z} {S c} p rewrite Z*a=Z (S c)= tt
-- mul-is-monotonic {S a} {S b} {Z} p rewrite a*Z=Z (S a) rewrite a*Z=Z (S b)= tt
-- mul-is-monotonic {S a} {S b} {S c} p = mul-is-monotonic a b c p
-- mul-is-monotonic {a} {b} {Z} p rewrite a*Z=Z a rewrite a*Z=Z b = tt
-- mul-is-monotonic {a} {Z} {S c} p = {!!}
-- mul-is-monotonic {a} {S b} {S c} p = {!!}
-- mul-is-monotonic {a} {b} {S c} p = {!mul-is-monotonic a b c p!}
mul-is-monotonic : {a b c : ℕ} -> a ≥ b -> (a * c) ≥ (b * c)
mul-is-monotonic p = {!!}