reserve n,i,j,k,l for Nat;
reserve D for non empty set;
reserve c,d for Element of D;
reserve p,q,q9,r for FinSequence of D;
reserve RAS for MidSp-like non empty ReperAlgebraStr over n+2;
reserve a,b,d,pii,p9i for Point of RAS;
reserve p,q for Tuple of (n+1),RAS;
reserve m for Nat of n;
reserve W for ATLAS of RAS;
reserve v for Vector of W;
reserve x,y for Tuple of (n+1),W;
reserve RAS for ReperAlgebra of n;
reserve a,b,pm,p9m,p99m for Point of RAS;
reserve p for Tuple of (n+1),RAS;
reserve W for ATLAS of RAS;
reserve v for Vector of W;
reserve x for Tuple of (n+1),W;

theorem Th28:
  RAS is_semi_additive_in m iff for x holds Phi((x+*(m,Double(x.m)
  ))) = Double Phi(x)
proof
  thus RAS is_semi_additive_in m implies for x holds Phi((x+*(m,Double(x.m))))
  = Double Phi(x)
  proof
    set a = the Point of RAS;
    assume
A1: RAS is_semi_additive_in m;
    let x;
    set x9 = (x+*(m,Double(x.m)));
    set p = (a,x).W, p9 = (a,x9).W;
    set q = (p9+*(m,a@(p9.m)));
    for i being Nat of n holds p.i = q.i
    proof
      let i be Nat of n;
      now
        per cases;
        suppose
A2:       i = m;
          W.(a,p) = x by Th15;
          then
A3:       W.(a,p.m) = x.m by Def9;
          W.(a,p9) = x9 by Th15;
          then
A4:       W.(a,p9.m) = x9.m by Def9;
          x9.m = Double (x.m) by Th13;
          then p.m = a@(p9.m) by A3,A4,MIDSP_2:31
            .= q.m by Th10;
          hence thesis by A2;
        end;
        suppose
A5:       i <> m;
          thus p.i = (a,x.i).W by Def8
            .= (a,x9.i).W by A5,FUNCT_7:32
            .= p9.i by Def8
            .= q.i by A5,FUNCT_7:32;
        end;
      end;
      hence thesis;
    end;
    then p = q by Th9;
    then *'(a,p) = a@*'(a,p9) by A1;
    then
A6: W.(a,*'(a,p9)) = Double W.(a,*'(a,p)) by MIDSP_2:31;
    Phi(x9) = W.(a,*'(a,p9)) by Lm5;
    hence thesis by A6,Lm5;
  end;
  thus (for x holds Phi((x+*(m,Double(x.m)))) = Double Phi(x)) implies RAS
  is_semi_additive_in m
  proof
    assume
A7: for x holds Phi((x+*(m,Double(x.m)))) = Double Phi(x);
    let a;
    let p9m be Point of RAS, p9 be Tuple of (n+1),RAS such that
A8: p9.m = p9m;
    set p = (p9+*(m,a@(p9.m)));
    set x = W.(a,p);
    set x9 = (x+*(m,Double(x.m)));
    W.(a,p9) = x9
    proof
      set y = W.(a,p9);
      for i being Nat of n holds x9.i = y.i
      proof
        let i be Nat of n;
        now
          per cases;
          suppose
A9:         i = m;
A10:        W.(a,p.m) = x.m & p.m = a@(p9.m) by Def9,Th10;
            x9.m = Double (x.m) & W.(a,p9.m) = y.m by Def9,Th13;
            hence thesis by A9,A10,MIDSP_2:31;
          end;
          suppose
A11:        i <> m;
            hence x9.i = x.i by FUNCT_7:32
              .= W.(a,p.i) by Def9
              .= W.(a,p9.i) by A11,FUNCT_7:32
              .= y.i by Def9;
          end;
        end;
        hence thesis;
      end;
      hence thesis by Th14;
    end;
    then
A12: Phi(x9) = W.(a,*'(a,p9)) by Lm4;
    Phi(x) = W.(a,*'(a,p)) by Lm4;
    then W.(a,*'(a,p9)) = Double W.(a,*'(a,p)) by A7,A12;
    hence thesis by A8,MIDSP_2:31;
  end;
end;
