
theorem
  for a being Integer holds Leg(a,2) = a mod 2
proof
let a be Integer;
per cases;
suppose A1: a is even;
 then a mod 2 = 0 by INT_1:62;
 hence thesis by A1,Def3;
 end;
suppose A2: a is odd;
 reconsider amod2 = a mod 2 as Element of NAT by INT_1:3,INT_1:57;
 A3: amod2 = 0 or amod2 = 1 by NAT_1:23,INT_1:58;
 a - 1 = (a div 2) * 2 + 1 - 1 by A3,A2,INT_1:62,INT_1:59;
 then A4: 1,a are_congruent_mod 2 by INT_1:def 5,INT_1:14;
 a gcd 2 <= 2 by INT_2:27,INT_2:21;
 then A5: a gcd 2 = 0 or ... or a gcd 2 = 2;
 1|^(1+1) = 1;
 hence thesis by A4,INT_2:5,A5,INT_2:21,A3,A2,INT_1:62,Def3,Th22;
 end;
end;
