reserve
  X,x,y,z for set,
  k,n,m for Nat ,
  f for Function,
  p,q,r for FinSequence of NAT;
reserve p1,p2,p3 for FinSequence;
reserve T,T1 for Tree;
reserve fT,fT1 for finite Tree;
reserve t for Element of T;
reserve w for FinSequence;
reserve t1,t2 for Element of T;

theorem
  width elementary_tree(n+1) = n+1
proof
  set T = elementary_tree(n+1);
 now
 { <*k*> : k < n+1 } is AntiChain_of_Prefixes-like
    proof
      thus x in { <*k*> : k < n+1 } implies x is FinSequence
      proof
        assume x in { <*k*> : k < n+1 };
then      ex k st x = <*k*> & k < n+1;
        hence thesis;
      end;
      let p1,p2;
      assume p1 in { <*k*> : k < n+1 } & p2 in { <*m*> : m < n+1 };
      then    (
 ex k st p1 = <*k*> & k < n+1)& ex m st p2 = <*m*> & m < n+1;
      hence thesis by Th4;
    end;
    then reconsider X = { <*k*> : k < n+1 } as AntiChain_of_Prefixes;
 X c= T by XBOOLE_1:7;
    then reconsider X as AntiChain_of_Prefixes of T by Def11;
    take X;
 X,Seg(n+1) are_equipotent
    proof
      defpred P[object,object] means ex n st $1 = <*n*> & $2 = n+1;
A1:   x in X & P[x,y] & P[x,z] implies y = z
      proof
        assume x in X;
        given n1 being Nat such that
A2:    x = <*n1*> & y = n1+1;
        given n2 being Nat such that
A3:    x = <*n2*> & z = n2+1;
    <*n1*>.1 = n1;
        hence thesis by A2,A3,FINSEQ_1:def 8;
      end;
A4:  for x being object holds x in X implies ex y being object st P[x,y]
      proof let x be object;
        assume x in X;
        then consider k such that
A5:    x = <*k*> and k < n+1;
        reconsider y = k+1 as set;
        take y;
        thus thesis by A5;
      end;
      consider f such that
A6:  dom f = X &
     for x being object st x in X holds P[x,f.x] from CLASSES1:sch 1(A4);
      take f;
      thus f is one-to-one
      proof
        let x,y be object;
        assume that
A7:    x in dom f & y in dom f and
A8:    f.x = f.y;
        (ex k1 being Nat st x = <*k1*> & f.x = k1+1)&
         ex k2 being Nat st y = <*k2*> & f.y = k2+1 by A6,A7;
        hence thesis by A8;
      end;
      thus dom f = X by A6;
      thus rng f c= Seg(n+1)
      proof
        let x be object;
        assume x in rng f;
        then consider y being object such that
A9:    y in dom f and
A10:    x = f.y by FUNCT_1:def 3;
        consider k such that
A11:    y = <*k*> and
A12:    x = k+1 by A6,A9,A10;
        consider m such that
A13:    y = <*m*> & m < n+1 by A6,A9;
    <*k*>.1 = k & <*m*>.1 = m;
then     0+1 <= k+1 & k+1 <= n+1 by A11,A13,NAT_1:13;
        hence thesis by A12,FINSEQ_1:1;
      end;
      let x be object;
      assume
A14:  x in Seg(n+1);
      then reconsider k = x as Nat;
A15:  1 <= k by A14,FINSEQ_1:1;
A16:  k <= n+1 by A14,FINSEQ_1:1;
      consider m be Nat such that
A17:  k = 1+m by A15,NAT_1:10;
      reconsider m as Nat;
  m < n+1 by A16,A17,NAT_1:13;
then A18:  <*m*> in X;
then   P[<*m*>,f.<*m*>] by A6;
then   x = f.<*m*> by A1,A17,A18;
      hence thesis by A6,A18,FUNCT_1:def 3;
    end;
then A19: card Seg(n+1) = card X by CARD_1:5;
    hence n+1 = card X by FINSEQ_1:57;
    let Y be AntiChain_of_Prefixes of T;
A20: Y c= T by Def11;
A21: {} in Y implies Y = D
    proof
      assume that
A22:  {} in Y and
A23:  Y <> D;
      consider x being object such that
A24:  not (x in Y iff x in D) by A23,TARSKI:2;
A25:  {} <> x by A22,A24,TARSKI:def 1;
      reconsider x as FinSequence of NAT by A20,A24,Th18;
  {} is_a_prefix_of x;
then   {},x are_c=-comparable;
      hence contradiction by A22,A24,A25,Def10,TARSKI:def 1;
    end;
A26: card D = 1 & 1 <= 1+n by CARD_1:30,NAT_1:11;
 now
      assume
A27:  not {} in Y;
  Y c= X
      proof
        let x be object;
        assume
A28:    x in Y;
then     x in { <*k*> : k < n+1 } or x in D by A20,XBOOLE_0:def 3;
        hence thesis by A27,A28,TARSKI:def 1;
      end;
      hence card Y <= card X by NAT_1:43;
    end;
    hence card Y <= card X by A19,A21,A26,FINSEQ_1:57;
  end;
  hence thesis by Def13;
end;
