
theorem ReplaceGamma:
  for f be real-valued FinSequence,
      i,j be Nat st
    i in dom f & j in dom f & i <> j holds
    f, Replace (f,i,j,Mean f,f.i + f.j - Mean f) are_gamma-equivalent
  proof
    let f be real-valued FinSequence,
        i,j be Nat;
    set a = Mean f;
    set b = f.i + f.j - Mean f;
    assume
A1: i in dom f & j in dom f & i <> j;
A2: dom f = dom Replace (f,i,j,a,b) by DinoDom;
    Sum Replace (f,i,j,a,b) = Sum f - f.i - f.j + a + b by SumReplace,A1
       .= Sum f;
    hence thesis by FINSEQ_3:29,A2;
  end;
