reserve Al for QC-alphabet;
reserve p,q,p1,p2,q1 for Element of CQC-WFF(Al),
  k for Element of NAT,
  f,f1,f2,g for FinSequence of CQC-WFF(Al),
  a,b,b1,b2,c,i,n for Nat;

theorem Th13:
  i in dom Sgm(seq(len g,len f)) implies Sgm(seq(len g,len f)).i = len g+i
proof
  defpred P[Nat] means 1 <= $1 & $1 <= len f implies
   for i being Nat st 1 <= i & i <= $1 holds Sgm(seq(len g,len f)).i = len g+i;
  assume
A1: i in dom Sgm(seq(len g,len f));
  then i in dom f by Th11;
  then
A2: i <= len f by FINSEQ_3:25;
A3: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A4: P[k];
    assume that
A5: 1 <= k+1 and
A6: k+1 <= len f;
    let n be Nat such that
A7: 1 <= n and
A8: n <= k+1;
A9: now
      assume
A10:  n = k+1;
      dom Sgm(seq(len g,len f)) = dom f by Th11;
      then n in dom Sgm(seq(len g,len f)) by A5,A6,A10,FINSEQ_3:25;
      then Sgm(seq(len g,len f)).n in rng Sgm(seq(len g,len f)) by FUNCT_1:3;
      then reconsider i = Sgm(seq(len g,len f)).n as Element of NAT;
A11:  now
        assume
A12:    i < len g+(k+1);
A13:    now
          assume k <> 0;
          then
A14:      0+1 <= k by NAT_1:13;
          then
A15:      Sgm(seq(len g,len f)).k = len g+k by A4,A6,NAT_1:13;
          then reconsider j = Sgm(seq(len g,len f)).k as Nat;
A17:      k < k+1 & k+1 <= len Sgm(seq(len g,len f)) by A6,Th10,NAT_1:13;
          i < len g+k+1 by A12;
          then i <= j by A15,NAT_1:13;
          hence contradiction by A10,A14,A17,FINSEQ_1:def 14;
        end;
        now
          1 <= len f by A5,A6,XXREAL_0:2;
          then 1 in dom f by FINSEQ_3:25;
          then
A18:      1 in dom Sgm(seq(len g,len f)) by Th11;
          assume
A19:      k = 0;
          then not i in seq(len g,len f) by A12,Th1;
          then not i in rng Sgm(seq(len g,len f)) by Th12;
          hence contradiction by A10,A19,A18,FUNCT_1:3;
        end;
        hence contradiction by A13;
      end;
      now
        1+len g <= 1+len g+k & len g+(k+1) <= len f+len g
        by A6,NAT_1:11,XREAL_1:6;
        then len g+(k+1) in seq(len g,len f);
        then len g+(k+1) in rng Sgm(seq(len g,len f)) by Th12;
        then consider l being Nat such that
A20:    l in dom Sgm(seq(len g,len f)) and
A21:    Sgm(seq(len g,len f)).l = len g+(k+1) by FINSEQ_2:10;
        assume
A22:    i > len g+(k+1);
A23:    now
A24:      now
            assume
A25:        l <= k;
            now
              assume 1 <= l;
              then len g+(k+1) = len g+l by A4,A6,A21,A25,NAT_1:13
,XXREAL_0:2;
              hence contradiction by A25,NAT_1:13;
            end;
            hence contradiction by A20,FINSEQ_3:25;
          end;
          assume l <= k+1;
          hence contradiction by A10,A22,A21,A24,NAT_1:8;
        end;
A26:    1 <= n & seq(len g,len f) c= Seg (len g+len f) by A10,Th7,NAT_1:11;
        l <= len Sgm(seq(len g,len f)) by A20,FINSEQ_3:25;
        hence contradiction by A10,A22,A21,A23,A26,FINSEQ_1:def 14;
      end;
      hence thesis by A10,A11,XXREAL_0:1;
    end;
    n <= k implies thesis by A4,A6,A7,NAT_1:13,XXREAL_0:2;
    hence thesis by A8,A9,NAT_1:8;
  end;
A27: P[0];
A28: for n being Nat holds P[n] from NAT_1:sch 2(A27,A3);
  1 <= i by A1,FINSEQ_3:25;
  hence thesis by A2,A28;
end;
