% problem-set/algebra/rings/commute.ver2.in
% created : 07/11/86                                        
% revised : 07/13/88                                        

% description :
%
% Theorem: If for all x, (x * x = x) then the ring 
%         is commutative under multiplication.                   
%         That is, (x * y = y * x) for all x and y.              

% representation :
%
% declare_predicate(2,EQUAL).
% declare_functions(2,[j,f]).
% declare_function(1,g).
% declare_constants([0]).
% declare_variables([x,y,z]).
%
% j(x,y) is the sum of x and y, f(x,y) is the product of x and y; 
% g(x) is the additive inverse of x; 0 is the additive identity element

lex(j(x,x),f(x,x),g(x),0).
set(para_into).
set(para_from).
set(para_from_left).
set(para_from_right).
assign(max_kept,1000).
assign(max_weight,1000).


list(axioms).

% The following clauses are given by Stickel as a complete set 
% of reductions for ring theory. 


% existence of left identity for addition 

EQUAL(j(0,x),x).

% existence of left additive inverse  

EQUAL(j(g(x),x),0).

% distributive property of product over sum    

EQUAL(f(x,j(y,z)),j(f(x,y),f(x,z))).
EQUAL(f(j(x,y),z),j(f(x,z),f(y,z))).

% inverse of identity is identity 

EQUAL(g(0),0).

% inverse of inverse of x is x itself 

EQUAL(g(g(x)),x).

% behavior of 0 and the multiplication operation  

EQUAL(f(x,0),0).
EQUAL(f(0,x),0).

% inverse of (x + y) is inverse(x) + inverse(y)  

EQUAL(g(j(x,y)),j(g(x),g(y))).

% x * inverse(y) = inverse (x * y)

EQUAL(f(x,g(y)),g(f(x,y))).
EQUAL(f(g(x),y),g(f(x,y))).

% end of Stickel's clauses

% associativity of addition

EQUAL(j(j(x,y),z),j(x,j(y,z))).

% commutativity of addition

EQUAL(j(x,y),j(y,x)).

% associativity of product

EQUAL(f(f(x,y),z),f(x,f(y,z))).

% reflexivity of equality 

EQUAL(x,x).

% right identity & inverse

EQUAL(j(x,0),x).
EQUAL(j(x,g(x)),0).

end_of_list.


list(sos).

% the ring is boolean

EQUAL(f(x,x),x).

% denial of the theorem

EQUAL(f(a,b),c).
-EQUAL(f(b,a),c).

end_of_list.


list(demodulators).

EQUAL(j(0,x),x).
EQUAL(j(g(x),x),0).
EQUAL(f(x,j(y,z)),j(f(x,y),f(x,z))).
EQUAL(f(j(x,y),z),j(f(x,z),f(y,z))).
EQUAL(g(0),0).
EQUAL(g(g(x)),x).
EQUAL(f(x,0),0).
EQUAL(f(0,x),0).
EQUAL(g(j(x,y)),j(g(x),g(y))).
EQUAL(f(x,g(y)),g(f(x,y))).
EQUAL(f(g(x),y),g(f(x,y))).
EQUAL(j(j(x,y),z),j(x,j(y,z))).
EQUAL(f(f(x,y),z),f(x,f(y,z))).
EQUAL(j(x,y),j(y,x)).
EQUAL(f(x,x),x).
EQUAL(j(x,j(y,z)),j(y,j(x,z))).

end_of_list.
