reserve G for non empty DTConstrStr,
  s for Symbol of G,
  n,m for String of G;
reserve n1,n2,n3 for String of G;
reserve a,b,c for set,
  D for non empty set,
  d for Element of D;

theorem
  Lang TotalGrammar D = D*
proof
  set T = TotalGrammar D;
  set I = <*the InitialSym of T*>;
  defpred X[Nat] means for p being String of T st len p = $1 & p in
  D* holds p^I is_derivable_from I;
A1: D c= succ D by XBOOLE_1:7;
A2: the Rules of T = {[D,<*d,D*>] where d is Element of D: d = d} \/ {[D,{}]
  } by Def10;
A3: the InitialSym of T = D by Def10;
A4: for k being Nat st X[k] holds X[k+1]
  proof
    let k be Nat such that
A5: for p being String of T st len p = k & p in D* holds p^I
    is_derivable_from I;
    let p be String of T;
    assume that
A6: len p = k+1 and
A7: p in D*;
    consider q being FinSequence, a such that
A8: p = q^<*a*> and
A9: len q = k by A6,TREES_2:3;
A10: rng <*a*> = {a} by FINSEQ_1:38;
    <*a*> is FinSequence of the carrier of T by A8,FINSEQ_1:36;
    then
A11: {a} c= the carrier of T by A10,FINSEQ_1:def 4;
A12: q is FinSequence of the carrier of T by A8,FINSEQ_1:36;
A13: p is FinSequence of D by A7,FINSEQ_1:def 11;
    then
A14: q is FinSequence of D by A8,FINSEQ_1:36;
    <*a*> is FinSequence of D by A8,A13,FINSEQ_1:36;
    then
A15: {a} c= D by A10,FINSEQ_1:def 4;
    reconsider q as String of T by A12,FINSEQ_1:def 11;
    reconsider a as Element of D by A15,ZFMISC_1:31;
    reconsider x = a as Symbol of T by A11,ZFMISC_1:31;
    [D,<*a,D*>] in {[D,<*d,D*>]: d = d};
    then [D,<*a,D*>] in the Rules of T by A2,XBOOLE_0:def 3;
    then the InitialSym of T ==> <*x,the InitialSym of T*> by A3;
    then I ==> <*x,the InitialSym of T*> by Th3;
    then
A16: q^I ==> q^<*x,the InitialSym of T*> by Th5;
    <*x,the InitialSym of T*> = <*x*>^I by FINSEQ_1:def 9;
    then q^I ==> p^I by A8,A16,FINSEQ_1:32;
    then
A17: p^I is_derivable_from q^I by Th7;
    q in D* by A14,FINSEQ_1:def 11;
    then q^I is_derivable_from I by A5,A9;
    hence thesis by A17,Th8;
  end;
  [D,{}] in {[D,{}]} by TARSKI:def 1;
  then [D,{}] in the Rules of T by A2,XBOOLE_0:def 3;
  then the InitialSym of T ==> <*> the carrier of T by A3;
  then
A18: I ==> <*> the carrier of T by Th3;
A19: Terminals T = D by Th16;
  thus Lang T c= D*
  proof
    let a be object;
    assume a in Lang T;
    then consider p being String of T such that
A20: a = p and
A21: rng p c= Terminals T and
    p is_derivable_from <*the InitialSym of T*>;
    p is FinSequence of D by A19,A21,FINSEQ_1:def 4;
    hence thesis by A20,FINSEQ_1:def 11;
  end;
  let a be object;
  assume
A22: a in D*;
  then reconsider a as FinSequence of D by FINSEQ_1:def 11;
  the carrier of T = succ D by Def10;
  then rng a c= the carrier of T by A1;
  then a is FinSequence of the carrier of T by FINSEQ_1:def 4;
  then reconsider n = a as String of T by FINSEQ_1:def 11;
  n^{} = n by FINSEQ_1:34;
  then n^I ==> n by A18,Th5;
  then
A23: n is_derivable_from n^I by Th7;
A24: X[0]
  proof
    let p be String of T;
    assume len p = 0;
    then p = {};
    then p^I = I by FINSEQ_1:34;
    hence thesis by Th6;
  end;
A25: for k being Nat holds X[k] from NAT_1:sch 2(A24,A4);
  len n = len n;
  then n^I is_derivable_from I by A25,A22;
  then
A26: n is_derivable_from I by A23,Th8;
  rng a c= D;
  hence thesis by A19,A26;
end;
