reserve n,m,i,j,k for Nat,
  x,y,e,X,V,U for set,
  W,f,g for Function;
reserve p,q for FinSequence;
reserve G for Graph,
  pe,qe for FinSequence of the carrier' of G;

theorem Th7:
 for x being object holds
  q^<*x*> is one-to-one & rng (q^<*x*>) c= rng p implies ex p1,p2
  being FinSequence st p=p1^<*x*>^p2 & rng q c= rng (p1^p2)
proof let x be object;
  set r=q^<*x*>, i=len q +1;
  assume that
A1: r is one-to-one and
A2: rng r c= rng p;
A3: r.i=x by FINSEQ_1:42;
  rng q c= rng r by FINSEQ_1:29;
  then
A4: rng q c= rng p by A2;
  len r =i & 1 <= i by FINSEQ_2:16,NAT_1:11;
  then
A5: i in dom r by FINSEQ_3:25;
  then consider y being object such that
A6: y in dom p and
A7: r.i = p.y by A2,FUNCT_1:114;
  reconsider j=y as Element of NAT by A6;
  j <= len p by A6,FINSEQ_3:25;
  then consider k being Nat such that
A8: len p = j+k by NAT_1:10;
  reconsider k as Element of NAT by ORDINAL1:def 12;
  consider s, p2 being FinSequence such that
A9: len s = j and
  len p2 = k and
A10: p = s^p2 by A8,FINSEQ_2:22;
A11: 1 <= j by A6,FINSEQ_3:25;
  then ex m being Nat st j = 1 + m by NAT_1:10;
  then consider p1 being FinSequence, d being object such that
A12: s = p1^<*d*> by A9,FINSEQ_2:18;
  j in dom s by A9,A11,FINSEQ_3:25;
  then
A13: s.j=x by A7,A10,A3,FINSEQ_1:def 7;
  take p1,p2;
A14: j = len p1 +1 by A9,A12,FINSEQ_2:16;
  hence p=p1^<*x*>^p2 by A10,A12,A13,FINSEQ_1:42;
  let y be object;
  assume
A15: y in rng q;
  now
    let y be set;
    assume
A16: y in rng q;
    assume y = x;
    then consider z being object such that
A17: z in dom q and
A18: x = q.z by A16,FUNCT_1:def 3;
    reconsider n=z as Element of NAT by A17;
    n <= len q by A17,FINSEQ_3:25;
    then
A19: n <> i by XREAL_1:29;
    n in dom r & r.n=r.i by A3,A17,A18,FINSEQ_1:def 7,FINSEQ_2:15;
    hence contradiction by A1,A5,A19;
  end;
  then
A20: y <> x by A15;
  s = p1^<*x*> by A12,A14,A13,FINSEQ_1:42;
  then rng p = rng (p1^<*x*>) \/ rng p2 by A10,FINSEQ_1:31
    .= rng p1 \/ rng <*x*> \/ rng p2 by FINSEQ_1:31
    .= rng p1 \/ rng p2 \/ rng <*x*> by XBOOLE_1:4
    .= rng (p1^p2) \/ rng <*x*> by FINSEQ_1:31
    .= rng (p1^p2) \/ {x} by FINSEQ_1:38;
  then y in rng (p1^p2) or y in {x} by A15,A4,XBOOLE_0:def 3;
  hence thesis by A20,TARSKI:def 1;
end;
