2015-02-05 03:33:08 +00:00
|
|
|
import algebra.group
|
2015-05-07 23:20:20 +00:00
|
|
|
open algebra
|
2015-02-05 03:33:08 +00:00
|
|
|
|
|
|
|
constant f {A : Type} : A → A → A
|
|
|
|
|
|
|
|
theorem test1 {A : Type} [s : add_comm_group A] (a b c : A) : f (a + 0) (f (a + 0) (a + 0)) = f a (f (0 + a) a) :=
|
|
|
|
begin
|
2015-02-05 04:16:24 +00:00
|
|
|
rewrite [
|
2015-02-22 17:39:27 +00:00
|
|
|
add_zero at {1, 3}, -- rewrite 1st and 3rd occurrences
|
2015-05-07 23:20:20 +00:00
|
|
|
{0 + _}add.comm] -- apply commutativity to (0 + _)
|
2015-02-05 03:33:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
axiom Ax {A : Type} [s₁ : has_mul A] [s₂ : has_one A] (a : A) : f (a * 1) (a * 1) = 1
|
|
|
|
|
|
|
|
theorem test2 {A : Type} [s : comm_group A] (a b c : A) : f a a = 1 :=
|
|
|
|
begin
|
2015-02-22 17:39:27 +00:00
|
|
|
rewrite [-(mul_one a), -- - means apply symmetry, rewrite 0 ==> a * 0 at 1st and 2nd occurrences
|
2015-02-05 04:16:24 +00:00
|
|
|
Ax] -- use Ax as rewrite rule
|
2015-02-05 03:33:08 +00:00
|
|
|
end
|