reserve
  S for (4,1) integer bool-correct non empty non void BoolSignature,
  X for non-empty ManySortedSet of the carrier of S,
  T for vf-free integer all_vars_including inheriting_operations free_in_itself
  (X,S)-terms VarMSAlgebra over S,
  C for (4,1) integer bool-correct non-empty image of T,
  G for basic GeneratorSystem over S,X,T,
  A for IfWhileAlgebra of the generators of G,
  I for integer SortSymbol of S,
  x,y,z,m for pure (Element of (the generators of G).I),
  b for pure (Element of (the generators of G).the bool-sort of S),
  t,t1,t2 for Element of T,I,
  P for Algorithm of A,
  s,s1,s2 for Element of C-States(the generators of G);
reserve
  f for ExecutionFunction of A, C-States(the generators of G),
  (\falseC)-States(the generators of G, b);
reserve u for ManySortedFunction of FreeGen T, the Sorts of C;
reserve
  S for 1-1-connectives (4,1) integer (11,1,1)-array 11 array-correct
  bool-correct non empty non void BoolSignature,
  X for non-empty ManySortedSet of the carrier of S,
  T for vf-free all_vars_including inheriting_operations free_in_itself
  (X,S)-terms integer-array non-empty VarMSAlgebra over S,
  C for (11,1,1)-array (4,1) integer bool-correct non-empty image of T,
  G for basic GeneratorSystem over S,X,T,
  A for IfWhileAlgebra of the generators of G,
  I for integer SortSymbol of S,
  x,y,m,i for pure (Element of (the generators of G).I),
  M,N for pure (Element of (the generators of G).the_array_sort_of S),
  b for pure (Element of (the generators of G).the bool-sort of S),
  s,s1 for (Element of C-States(the generators of G));
reserve u for ManySortedFunction of FreeGen T, the Sorts of C;
reserve i1,i2 for pure Element of (the generators of G).I;

theorem Th98:
  T is non array-degenerated implies
  vf (@M.@i) = (I-singleton i) (\/) ((the_array_sort_of S)-singleton M)
  proof set t = @M.@i;
    assume
A1: T is non array-degenerated;
    reconsider N = M as Element of (FreeGen T).the_array_sort_of S by Def4;
    @N = @M; then
A2: @M.@i = Sym(In((the connectives of S).11, the carrier' of S),X)-tree<*M,i*>
    by A1;
A3: <*M,i*>.(0+1) = M & <*M,i*>.(1+1) = i & len <*M,i*> = 2 by FINSEQ_1:44;
    then
A4: t|<*0*> = M & t|<*1*> = i by A2,TREES_4:def 4;
    M in (FreeGen T).the_array_sort_of S by Def4;
    then M in FreeGen(the_array_sort_of S, X) by MSAFREE:def 16;
    then consider m being set such that
A5: m in X.the_array_sort_of S & M = root-tree[m,the_array_sort_of S]
    by MSAFREE:def 15;
    i in (FreeGen T).I by Def4;
    then i in FreeGen(I, X) by MSAFREE:def 16;
    then consider j being set such that
A6: j in X.I & i = root-tree[j,I] by MSAFREE:def 15;
    (t|<*0*>).{} = [m,the_array_sort_of S] & (t|<*1*>).{} = [j,I]
    by A4,A5,A6,TREES_4:3;
    then
A7: ((t|<*0*>).{})`2 = the_array_sort_of S & ((t|<*1*>).{})`2 = I;
    {} in dom root-tree[m,the_array_sort_of S] & {} in dom root-tree[j,I]
    by TREES_1:22;
    then <*0*>^{} in dom t & <*1*>^{} in dom t by A2,A5,A6,A3,TREES_4:11;
    then
A8: <*0*> in dom t & <*1*> in dom t by FINSEQ_1:34;
A9: the_array_sort_of S <> I by Th73;
A10: {M} = (vf t).the_array_sort_of S
    proof
      set A = {t|p where p is Element of dom t: ((t|p).{})`2
      = the_array_sort_of S};
A11:   M in A & A = (vf t).the_array_sort_of S
      by A4,A7,A8,AOFA_A00:def 12;
      hence {M} c= (vf t).the_array_sort_of S by ZFMISC_1:31;
      let x be object; assume x in (vf t).the_array_sort_of S;
      then consider p being Element of dom t such that
A12:   x = t|p & ((t|p).{})`2 = the_array_sort_of S by A11;
      per cases by A2,TREES_4:11;
      suppose p = {};
        then t|p = t by TREES_9:1;
        then (t|p).{} = Sym(In((the connectives of S).11, the carrier' of S),X)
        by A2,TREES_4:def 4
        .= [In((the connectives of S).11, the carrier' of S), the carrier of S]
        by MSAFREE:def 9;
        then ((t|p).{})`2 = the carrier of S &
        the_array_sort_of S in the carrier of S;
        hence thesis by A12;
      end;
      suppose ex k being Nat, T being DecoratedTree,
        q being Node of T st k < len <*M,i*> & T = <*M,i*>.(k+1) & p = <*k*>^q;
        then consider k being Nat, Q being DecoratedTree,
        q being Element of dom Q such that
A13:     k < len <*M,i*> & Q = <*M,i*>.(k+1) & p = <*k*>^q;
A14:     k = 0 or k = 1 by A3,A13,NAT_1:23;
        then q in dom root-tree [m,the_array_sort_of S] or
        q in dom root-tree [j,I] by A13,A5,A6;
        then q in {{}} by TREES_4:3,TREES_1:29;
        then q = {} by TARSKI:def 1;
        then p = <*0*> by A12,A14,A9,A7,A13,FINSEQ_1:34;
        hence x in {M} by A12,A4,TARSKI:def 1;
      end;
    end;
A15: {i} = (vf t).I
    proof
      set A = {t|p where p is Element of dom t: ((t|p).{})`2 = I};
A16:   i in A & A = (vf t).I by A4,A7,A8,AOFA_A00:def 12;
      hence {i} c= (vf t).I by ZFMISC_1:31;
      let x be object; assume x in (vf t).I;
      then consider p being Element of dom t such that
A17:   x = t|p & ((t|p).{})`2 = I by A16;
      per cases by A2,TREES_4:11;
      suppose p = {};
        then t|p = t by TREES_9:1;
        then (t|p).{} = Sym(In((the connectives of S).11, the carrier' of S),X)
        by A2,TREES_4:def 4
        .= [In((the connectives of S).11, the carrier' of S), the carrier of S]
        by MSAFREE:def 9;
        then ((t|p).{})`2 = the carrier of S & I in the carrier of S;
        hence thesis by A17;
      end;
      suppose ex k being Nat, T being DecoratedTree,
        q being Node of T st k < len <*M,i*> & T = <*M,i*>.(k+1) & p = <*k*>^q;
        then consider k being Nat, Q being DecoratedTree,
        q being Element of dom Q such that
A18:     k < len <*M,i*> & Q = <*M,i*>.(k+1) & p = <*k*>^q;
A19:     k = 0 or k = 1 by A3,A18,NAT_1:23;
        then q in dom root-tree [m,the_array_sort_of S] or
        q in dom root-tree [j,I] by A18,A5,A6;
        then q in {{}} by TREES_4:3,TREES_1:29;
        then q = {} by TARSKI:def 1;
        then p = <*1*> by A17,A19,A9,A7,A18,FINSEQ_1:34;
        hence x in {i} by A17,A4,TARSKI:def 1;
      end;
    end;
A20: for s being SortSymbol of S st s <> the_array_sort_of S & s <> I
    holds {} = (vf t).s
    proof
      let s be SortSymbol of S;
      assume A21: s <> the_array_sort_of S;
      assume A22: s <> I;
      set A = {t|p where p is Element of dom t: ((t|p).{})`2 = s};
A23:   A = (vf t).s by AOFA_A00:def 12;
      thus {} c= (vf t).s;
      let x be object; assume x in (vf t).s;
      then consider p being Element of dom t such that
A24:   x = t|p & ((t|p).{})`2 = s by A23;
      per cases by A2,TREES_4:11;
      suppose p = {};
        then t|p = t by TREES_9:1;
        then (t|p).{} = Sym(In((the connectives of S).11, the carrier' of S),X)
        by A2,TREES_4:def 4
        .= [In((the connectives of S).11, the carrier' of S), the carrier of S]
        by MSAFREE:def 9;
        then ((t|p).{})`2 = the carrier of S & s in the carrier of S;
        hence thesis by A24;
      end;
      suppose ex k being Nat, T being DecoratedTree,
        q being Node of T st k < len <*M,i*> & T = <*M,i*>.(k+1) & p = <*k*>^q;
        then consider k being Nat, Q being DecoratedTree,
        q being Element of dom Q such that
A25:     k < len <*M,i*> & Q = <*M,i*>.(k+1) & p = <*k*>^q;
A26:     k = 0 or k = 1 by A3,A25,NAT_1:23;
        then q in dom root-tree [m,the_array_sort_of S] or
        q in dom root-tree [j,I] by A25,A5,A6;
        then q in {{}} by TREES_4:3,TREES_1:29;
        then q = {} by TARSKI:def 1;
        hence thesis by A24,A26,A7,A21,A22,A25,FINSEQ_1:34;
      end;
    end;
    let a be SortSymbol of S;
    per cases;
    suppose
A27:   a = the_array_sort_of S;
      thus (vf t).a
      = {} \/ ((the_array_sort_of S)-singleton M).a by A10,A27,AOFA_A00:6
      .= ((I-singleton i).a)\/((the_array_sort_of S)-singleton M).a
      by A27,A9,AOFA_A00:6
      .= ((I-singleton i) (\/) ((the_array_sort_of S)-singleton M)).a
      by PBOOLE:def 4;
    end;
    suppose
A28:   a = I;
      hence (vf t).a = (I-singleton i).a \/ {} by A15,AOFA_A00:6
      .= ((I-singleton i).a)\/((the_array_sort_of S)-singleton M).a
      by A28,Th73,AOFA_A00:6
      .= ((I-singleton i) (\/) ((the_array_sort_of S)-singleton M)).a
      by PBOOLE:def 4;
    end;
    suppose
A29:   a <> the_array_sort_of S & a <> I;
      hence (vf t).a = {} by A20
      .= (I-singleton i).a \/ {} by A29,AOFA_A00:6
      .= ((I-singleton i).a)\/((the_array_sort_of S)-singleton M).a
      by A29,AOFA_A00:6
      .= ((I-singleton i) (\/) ((the_array_sort_of S)-singleton M)).a
      by PBOOLE:def 4;
    end;
  end;
