
theorem Th18:
  for x,y being FinSequence, n being Nat holds
  (n-BitBorrowOutput(x,y))`1 = <*> &
  (n-BitBorrowOutput(x,y))`2 = (0-tuples_on BOOLEAN)-->TRUE &
  proj1 (n-BitBorrowOutput(x,y))`2 = 0-tuples_on BOOLEAN or
  card (n-BitBorrowOutput(x,y))`1 = 3 & (n-BitBorrowOutput(x,y))`2 = or3 &
  proj1 (n-BitBorrowOutput(x,y))`2 = 3-tuples_on BOOLEAN
proof
  let x,y be FinSequence;
  defpred P[Nat] means ($1-BitBorrowOutput(x,y))`1 = <*> &
  ($1-BitBorrowOutput(x,y))`2 = (0-tuples_on BOOLEAN)-->TRUE &
  proj1 ($1-BitBorrowOutput(x,y))`2 = 0-tuples_on BOOLEAN or
  card ($1-BitBorrowOutput(x,y))`1 = 3 & ($1-BitBorrowOutput(x,y))`2 = or3 &
  proj1 ($1-BitBorrowOutput(x,y))`2 = 3-tuples_on BOOLEAN;
A1: dom ((0-tuples_on BOOLEAN)-->TRUE) = 0-tuples_on BOOLEAN by FUNCOP_1:13;
  0-BitBorrowOutput(x,y) = [<*>, (0-tuples_on BOOLEAN)-->TRUE] by Th2;
  then
A2: P[ 0 ] by A1;
A3: now
    let n be Nat;
    assume P[n];
    set c = n-BitBorrowOutput(x, y);
A4: (n+1)-BitBorrowOutput(x, y) = BorrowOutput(x .(n+1), y.(n+1), c) by Th7
      .= [<*[<*x .(n+1),y.(n+1)*>, and2a], [<*y.(n+1),c*>, and2],
    [<*x .(n+1),c*>, and2a]*>, or3];
A5: dom or3 = 3-tuples_on BOOLEAN by FUNCT_2:def 1;
    thus P[n+1] by A4,A5,FINSEQ_1:45;
  end;
  thus for i being Nat holds P[i] from NAT_1:sch 2(A2,A3);
end;
