
theorem Th27:
  for n be non zero Nat for k be Nat st k < 2 to_power n holds (n
  +1)-BinarySequence k = (n-BinarySequence k)^<*FALSE*>
proof
  let n be non zero Nat;
  let k be Nat;
  assume
A1: k < 2 to_power n;
  now
    let i be Nat;
    assume
A2: i in Seg (n + 1);
    then i in Seg len ((n+1)-BinarySequence k) by CARD_1:def 7;
    then
A3: i in dom ((n+1)-BinarySequence k) by FINSEQ_1:def 3;
    now
      per cases by A2,FINSEQ_2:7;
      suppose
A4:     i in Seg n;
        then i in Seg len (n-BinarySequence k) by CARD_1:def 7;
        then
A5:     i in dom (n-BinarySequence k) by FINSEQ_1:def 3;
        thus ((n+1)-BinarySequence k).i = ((n+1)-BinarySequence k)/.i by A3,
PARTFUN1:def 6
          .= IFEQ((k div 2 to_power (i-'1)) mod 2,0,FALSE,TRUE) by A2,Def1
          .= (n-BinarySequence k)/.i by A4,Def1
          .= (n-BinarySequence k).i by A5,PARTFUN1:def 6
          .= ((n-BinarySequence k)^<*FALSE*>).i by A5,FINSEQ_1:def 7;
      end;
      suppose
A6:     i = n + 1;
        hence ((n+1)-BinarySequence k).i = FALSE by A1,Th26
          .= ((n-BinarySequence k)^<*FALSE*>).i by A6,FINSEQ_2:116;
      end;
    end;
    hence ((n+1)-BinarySequence k).i = ((n-BinarySequence k)^<*FALSE*>).i;
  end;
  hence thesis by FINSEQ_2:119;
end;
