reserve k,n for Nat,
  x,y,z,y1,y2 for object,X,Y for set,
  f,g for Function;
reserve p,q,r,s,t for XFinSequence;
reserve D for set;

theorem Th54: :: CATALAN2:1
  (p^q)|dom p = p
proof
    set r=(p^q)|(dom p);
A1: now
    let k such that
A2: k < len p;
A3: k in dom p by A2,Lm1;
    then
A4: (p^q).k=p.k by Def3;
    k+0<len p+len q by A2,XREAL_1:8;
    then k in Segm(len p+len q) by NAT_1:44;
    then k in dom (p^q) by Def3;
    then k in dom (p^q)/\ dom p by A3,XBOOLE_0:def 4;
    hence r.k=p.k by A4,FUNCT_1:48;
  end;
  dom p c= dom (p^q) by Th19;
  then len r= len p by RELAT_1:62;
  hence thesis by A1,Th8;
end;
