
theorem PMI:
  for a,b be Integer holds parity (a-b) = |.(parity a) - (parity b).|
  proof
    let a,b be Integer;
    per cases;
    suppose
      A1: a is even;
      per cases;
      suppose b is even; then
        parity (a - b) = 0 & |.(parity a) - (parity b).| = 0 by A1;
        hence thesis;
      end;
      suppose
        B1: b is odd; then
        B2: a - b is odd by A1;
        |.(parity a) - (parity b).| = --1 by A1,B1
        .= parity (a - b) by B2;
        hence thesis;
      end;
    end;
    suppose
      A1: a is odd;
      per cases;
      suppose b is odd; then
        parity (a - b) = 0 & |.(parity a) - (parity b).| = 0 by A1;
        hence thesis;
      end;
      suppose
        B1: b is even; then
         a - b is odd by A1;
        hence thesis by A1,B1;
      end;
    end;
  end;
