reserve f for Function;
reserve p,q for FinSequence;
reserve A,B,C for set,x,x1,x2,y,z for object;
reserve k,l,m,n for Nat;
reserve a for Nat;
reserve D for non empty set;
reserve d,d1,d2,d3 for Element of D;
reserve L,M for Element of NAT;
reserve f for Function of A,B;
reserve f for Function;
reserve x1,x2,x3,x4,x5 for object;
reserve p for FinSequence;

theorem Th76:
  p = <*x1,x2,x3,x4*> iff len p = 4 & p.1 = x1 & p.2 = x2 & p.3=x3 & p.4= x4
proof
  thus p = <*x1,x2,x3,x4*> implies len p = 4 & p.1 = x1 & p.2 = x2 & p.3 = x3
  & p.4 = x4
  proof
    set p3=<*x1,x2,x3*>;
    assume
A1: p =<*x1,x2,x3,x4*>;
    hence len p =len <*x1,x2,x3*> + len <*x4*> by FINSEQ_1:22
      .=3 + len <*x4*> by FINSEQ_1:45
      .=3+1 by FINSEQ_1:40
      .=4;
A2: dom p3 ={1,2,3} by FINSEQ_1:89,FINSEQ_3:1;
    then 1 in dom p3 by ENUMSET1:def 1;
    hence p.1 = p3.1 by A1,FINSEQ_1:def 7
      .=x1;
    2 in dom p3 by A2,ENUMSET1:def 1;
    hence p.2 = p3.2 by A1,FINSEQ_1:def 7
      .=x2;
    3 in dom p3 by A2,ENUMSET1:def 1;
    hence p.3 = p3.3 by A1,FINSEQ_1:def 7
      .=x3;
    1 in {1} by TARSKI:def 1;
    then
A3: 1 in dom <*x4*> by FINSEQ_1:2,def 8;
    thus p.4 = (p3^<*x4*>).(3+1) by A1
      .=(p3^<*x4*>).(len p3 + 1) by FINSEQ_1:45
      .= <*x4*>.1 by A3,FINSEQ_1:def 7
      .= x4;
  end;
  assume that
A4: len p = 4 and
A5: p.1 = x1 and
A6: p.2 = x2 and
A7: p.3 = x3 and
A8: p.4=x4;
A9: for k be Nat st k in dom <*x1,x2,x3*> holds p.k=<*x1,x2,x3*>.k
  proof
A10: len <*x1,x2,x3*> = 3 by FINSEQ_1:45;
    let k be Nat;
    assume k in dom <*x1,x2,x3*>;
    then
A11: k in {1,2,3} by A10,FINSEQ_1:def 3,FINSEQ_3:1;
    per cases by A11,ENUMSET1:def 1;
    suppose
      k=1;
      hence thesis by A5;
    end;
    suppose
      k=2;
      hence thesis by A6;
    end;
    suppose
      k=3;
      hence thesis by A7;
    end;
  end;
A12: for k be Nat st k in dom <*x4*> holds p.( (len <*x1,x2,x3*>) + k) = <*
  x4*>.k
  proof
    let k be Nat;
    assume k in dom <*x4*>;
    then k in {1} by FINSEQ_1:2,def 8;
    then
A13: k = 1 by TARSKI:def 1;
    hence p.( (len <*x1,x2,x3*>) + k) = p.(3+1) by FINSEQ_1:45
      .=<*x4*>.k by A8,A13;
  end;
  dom p = Seg(3+1) by A4,FINSEQ_1:def 3
    .= Seg((len <*x1,x2,x3*>) + 1) by FINSEQ_1:45
    .= Seg((len <*x1,x2,x3*>) + len <*x4*>) by FINSEQ_1:39;
  hence thesis by A9,A12,FINSEQ_1:def 7;
end;
