
theorem Th19:
  for n be non zero Nat for x,y be Tuple of n,BOOLEAN st x/.n =
  TRUE & (carry(x,Bin1 n))/.n = TRUE holds for k be non zero Nat st k <> 1 & k
  <= n holds x/.k = TRUE & (carry(x,Bin1 n))/.k = TRUE
proof
  let n be non zero Nat;
  let x,y be Tuple of n,BOOLEAN;
  assume that
A1: x/.n = TRUE and
A2: (carry(x,Bin1 n))/.n = TRUE;
  defpred P[Nat] means ($1 in Seg (n -' 1) implies x/.(n -' $1 + 1) = TRUE & (
  carry(x,Bin1 n))/.(n -' $1 + 1) = TRUE);
  let k be non zero Nat;
  assume that
A3: k <> 1 and
A4: k <= n;
  set i = n -' k + 1;
  1 < k by A3,NAT_2:19;
  then 1 + 1 <= k by NAT_1:13;
  then
A5: 1 <= k - 1 by XREAL_1:19;
A6: for j be non zero Nat st P[j] holds P[j+1]
  proof
    let j be non zero Nat;
    assume that
A7: P[j] and
A8: j + 1 in Seg (n -' 1);
A9: j + 1 <= n -' 1 by A8,FINSEQ_1:1;
    then
A10: j < n -' 1 by NAT_1:13;
    then j < n - 1 by NAT_1:14,XREAL_1:233;
    then j + 1 < n by XREAL_1:20;
    then
A11: j < n by NAT_1:13;
    j + 1 <= n - 1 by A9,NAT_1:14,XREAL_1:233;
    then 1 <= n - 1 - j by XREAL_1:19;
    then 1 <= n - j - 1;
    then 1 + 1 <= n - j by XREAL_1:19;
    then 1 + 1 <= n -' j by A11,XREAL_1:233;
    then
A12: n -' j > 1 by NAT_1:13;
A13: 1 <= j by NAT_1:14;
A14: n -' j < n by NAT_2:9;
    then n -' j in Seg n by A12,FINSEQ_1:1;
    then
A15: (Bin1 n)/.(n -' j) = FALSE by A12,BINARI_2:6;
    then ((Bin1 n)/.(n -' j)) '&' ((carry(x,Bin1 n))/.(n -' j)) = FALSE;
    then
A16: TRUE = (x/.(n -' j)) '&' ((Bin1 n)/.(n -' j)) 'or' (x/.(n -' j)) '&'
    ((carry(x,Bin1 n))/.(n -' j)) by A7,A13,A10,A14,A12,A15,BINARITH:def 2
,FINSEQ_1:1
      .= (x/.(n -' j)) '&' ((carry(x,Bin1 n))/.(n -' j)) by A15;
    then x/.(n -' j) = TRUE by MARGREL1:12;
    hence x/.(n -' (j+1) + 1) = TRUE by A11,NAT_2:7;
    (carry(x,Bin1 n))/.(n -' j) = TRUE by A16,MARGREL1:12;
    hence thesis by A11,NAT_2:7;
  end;
A17: 1 <= i by NAT_1:11;
  i = n - k + 1 by A4,XREAL_1:233
    .= n - (k - 1);
  then
A18: i <= n - 1 by A5,XREAL_1:13;
  then i + 1 <= n by XREAL_1:19;
  then i < n by NAT_1:13;
  then
A19: k = n -' i + 1 by A4,NAT_2:5;
  i <= n -' 1 by A18,NAT_1:14,XREAL_1:233;
  then
A20: i in Seg (n -' 1) by A17,FINSEQ_1:1;
A21: P[1] by A1,A2,NAT_1:14,XREAL_1:235;
  for j be non zero Nat holds P[j] from NAT_1:sch 10(A21,A6);
  hence thesis by A19,A20;
end;
