reserve S for non empty non void ManySortedSign;
reserve X for non-empty ManySortedSet of S;
reserve x,y,z for set, i,j for Nat;
reserve
  A0 for (X,S)-terms non-empty MSAlgebra over S,
  A1 for all_vars_including (X,S)-terms MSAlgebra over S,
  A2 for all_vars_including inheriting_operations (X,S)-terms MSAlgebra over S,
  A for all_vars_including inheriting_operations free_in_itself
  (X,S)-terms MSAlgebra over S;
reserve X0 for non-empty countable ManySortedSet of S;
reserve A0 for all_vars_including inheriting_operations free_in_itself
  (X0,S)-terms MSAlgebra over S;

theorem Th83:
  for p being FinSequence, i being Nat st i+1 <= len p
  holds p|(i+1) = (p|i)^<*p.(i+1)*>
  proof
    let p be FinSequence;
    let i be Nat;
    assume A1: i+1 <= len p;
    then
A2: len(p|(i+1)) = i+1 by FINSEQ_1:59;
    i < len p by A1,NAT_1:13;
    then
A3: len(p|i) = i & len <*p.(i+1)*> = 1 by FINSEQ_1:40,59;
    then
A4: len((p|i)^<*p.(i+1)*>) = i+1 by FINSEQ_1:22;
    thus len (p|(i+1)) = len ((p|i)^<*p.(i+1)*>) by A1,A4,FINSEQ_1:59;
    let j be Nat;
    assume
A5: 1 <= j & j <= len(p|(i+1));
    per cases by A5,A2,NAT_1:8;
    suppose
A6:   j <= i;
A7:   j in dom (p|i) by A3,A5,A6,FINSEQ_3:25;
      thus (p|(i+1)).j = p.j by A2,A5,FINSEQ_1:1,FUNCT_1:49
      .= (p|i).j by A6,A5,FINSEQ_1:1,FUNCT_1:49
      .= ((p|i)^<*p.(i+1)*>).j by A7,FINSEQ_1:def 7;
    end;
    suppose
A8:   j = i+1; then j >= 1 by NAT_1:11;
      hence (p|(i+1)).j = p.(i+1) by A8,FINSEQ_1:1,FUNCT_1:49
      .= ((p|i)^<*p.(i+1)*>).j by A3,A8,FINSEQ_1:42;
    end;
  end;
