reserve x,y,z for object;
reserve n,m,k for Element of NAT;
reserve r for Real;

theorem Th2:
  for n ex m st n = 3*m or n = 3*m+1 or n = 3*m+2
proof
  let n;
  take n div 3;
  set w = n mod 3;
A1: w = 0 or w = 1 or w = 2
  proof
    w < 2 + 1 by NAT_D:1;
    then
A2: w <= 1 + 1 by NAT_1:13;
    now
      per cases by A2,NAT_1:8;
      suppose
A3:     w <= 1;
        now
          per cases by A3,NAT_1:8;
          suppose
            w <= 0;
            hence thesis by NAT_1:2;
          end;
          suppose
            w = 0 + 1;
            hence thesis;
          end;
        end;
        hence thesis;
      end;
      suppose
        w = 1 + 1;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
A4: n = 3*(n div 3) + (n mod 3) by NAT_D:2;
  now
    per cases by A1;
    suppose
      w = 0;
      hence thesis by A4;
    end;
    suppose
      w = 1;
      hence thesis by NAT_D:2;
    end;
    suppose
      w = 2;
      hence thesis by NAT_D:2;
    end;
  end;
  hence thesis;
end;
