Package group-mult-sub: Group multiplication by repeated subtraction
Information
| name | group-mult-sub |
| version | 1.8 |
| description | Group multiplication by repeated subtraction |
| author | Joe Leslie-Hurd <joe@gilith.com> |
| license | MIT |
| requires | bool group-def group-mult-def group-mult-thm group-thm group-witness list natural natural-fibonacci |
| show | Algebra.Group Data.Bool Data.List Number.Natural |
Files
- Package tarball group-mult-sub-1.8.tgz
- Theory source file group-mult-sub.thy (included in the package tarball)
Defined Constant
- Algebra
- Group
- multSub
- Group
Theorems
⊦ ∀x n. x * n = multSub ⊤ 0 0 x 0 (Fibonacci.encode n)
⊦ ∀b n d f p. multSub b n d f p [] = if b then n - d else d - n
⊦ ∀b n d f p h t.
multSub b n d f p (h :: t) =
let s ← p - f in multSub (¬b) d (if h then n - s else n) s f t
⊦ ∀x n d f p l.
x + n = n + x ∧ x + d = d + x ⇒
multSub ⊤ n d (x * f) (~(x * p)) l =
n - d + x * Fibonacci.decode.dest f p l ∧
multSub ⊥ n d (~(x * f)) (x * p) l =
d - n + x * Fibonacci.decode.dest f p l
External Type Operators
- →
- bool
- Algebra
- Group
- group
- Group
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
External Constants
- =
- select
- Algebra
- Group
- *
- +
- -
- ~
- 0
- Group
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- ⊥
- ⊤
- List
- ::
- []
- Bool
- Number
- Natural
- +
- bit1
- zero
- Fibonacci
- Fibonacci.decode
- Fibonacci.decode.dest
- Fibonacci.encode
- Fibonacci.decode
- Natural
Assumptions
⊦ ⊤
⊦ ¬⊥ ⇔ ⊤
⊦ ¬⊤ ⇔ ⊥
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. ⊤ ∧ t ⇔ t
⊦ ∀t. t ∧ t ⇔ t
⊦ ∀x. x * 0 = 0
⊦ ∀x. 0 + x = x
⊦ ∀x. x + 0 = x
⊦ ∀n. Fibonacci.decode (Fibonacci.encode n) = n
⊦ ∀x. x * 1 = x
⊦ ∀x. x + ~x = 0
⊦ ∀x. ~x + x = 0
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ ⊤) ∨ (t ⇔ ⊥)
⊦ ∀t1 t2. (if ⊥ then t1 else t2) = t2
⊦ ∀t1 t2. (if ⊤ then t1 else t2) = t1
⊦ ∀f p. Fibonacci.decode.dest f p [] = 0
⊦ ∀l. Fibonacci.decode l = Fibonacci.decode.dest 1 0 l
⊦ ∀x y. x = y ⇔ y = x
⊦ ∀x y. x = y ⇒ y = x
⊦ ∀m n. m + n = n + m
⊦ ∀x y. x - y = x + ~y
⊦ ∀x y. ~x + (x + y) = y
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀x y z. x = y ∧ y = z ⇒ x = z
⊦ ∀x y z. x + y + z = x + (y + z)
⊦ ∀p. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ ∀x m n. x * (m + n) = x * m + x * n
⊦ ∀p. p [] ∧ (∀h t. p t ⇒ p (h :: t)) ⇒ ∀l. p l
⊦ ∀b f. ∃fn. fn [] = b ∧ ∀h t. fn (h :: t) = f h t (fn t)
⊦ ∀x n y. x + y = y + x ⇒ x * n + y = y + x * n
⊦ ∀x n y. y + x = x + y ⇒ y + x * n = x * n + y
⊦ ∀f p h t.
Fibonacci.decode.dest f p (h :: t) =
let s ← f + p in
let n ← Fibonacci.decode.dest s f t in
if h then s + n else n