reserve X for non empty set;
reserve x for Element of X;
reserve d1,d2 for Element of X;
reserve A for BinOp of X;
reserve M for Function of [:X,X:],X;
reserve V for Ring;
reserve V1 for Subset of V;

theorem Th1:
  V1 = X & A = (the addF of V)||V1 & M = (the multF of V)||V1 & d1
= 1.V & d2 = 0.V & V1 is having-inverse implies doubleLoopStr (# X,A,M,d1,d2 #)
  is Subring of V
proof
  assume that
A1: V1 = X and
A2: A = (the addF of V)||V1 and
A3: M = (the multF of V)||V1 and
A4: d1 = 1.V and
A5: d2 = 0.V and
A6: for v be Element of V st v in V1 holds -v in V1;
  reconsider W = doubleLoopStr(# X,A,M,d1,d2 #) as non empty doubleLoopStr;
A7: now
    let a,x be Element of W;
    a*x = (the multF of V).([a,x]) by A1,A3,FUNCT_1:49;
    hence a*x = (the multF of V).(a,x);
  end;
A8: now
    let x,y be Element of W;
    x + y = (the addF of V).([x,y]) by A1,A2,FUNCT_1:49;
    hence x + y = (the addF of V).(x,y);
  end;
A9: W is Abelian add-associative right_zeroed right_complementable
  associative well-unital distributive
  proof
    set MV = the multF of V;
    set Av = the addF of V;
    hereby
      let x,y be Element of W;
      reconsider x1 = x, y1 = y as Element of V by A1,TARSKI:def 3;
      x + y = x1 + y1 & y + x = y1 + x1 by A8;
      hence x + y = y + x;
    end;
    hereby
      let x,y,z be Element of W;
      reconsider x1 = x, y1 = y, z1 = z as Element of V by A1,TARSKI:def 3;
      x + (y + z) = Av.(x1,y + z) by A8;
      then
A10:  x + (y + z) = x1 + (y1 + z1) by A8;
      (x + y) + z = Av.(x +y,z1) by A8;
      then (x + y) + z = (x1 + y1) + z1 by A8;
      hence (x + y) + z = x + (y + z) by A10,RLVECT_1:def 3;
    end;
    hereby
      let x be Element of W;
      reconsider y = x as Element of V by A1,TARSKI:def 3;
      x + 0.W = y + 0.V by A5,A8;
      hence x + 0.W = x;
    end;
    thus W is right_complementable
    proof
      let x be Element of W;
      reconsider x1 = x as Element of V by A1,TARSKI:def 3;
      consider v be Element of V such that
A11:  x1 + v = 0.V by ALGSTR_0:def 11;
      v = - x1 by A11,VECTSP_1:16;
      then reconsider y = v as Element of W by A1,A6;
      take y;
      thus thesis by A5,A8,A11;
    end;
    hereby
      let a,b,x be Element of W;
      reconsider y=x, a1=a, b1=b as Element of V by A1,TARSKI:def 3;
      a * (b * x) = MV.(a,b * x) by A7;
      then
A12:  a * (b * x) = a1 * (b1 * y) by A7;
      a * b = a1 * b1 by A7;
      then (a * b) * x = (a1 * b1) * y by A7;
      hence (a * b) * x = a * (b * x) by A12,GROUP_1:def 3;
    end;
    hereby
      let x be Element of W;
      reconsider y = x as Element of V by A1,TARSKI:def 3;
      x*1.W = y * 1.V & 1.W * x = 1.V * y by A4,A7;
      hence x*1.W = x & 1.W * x =x;
    end;
    hereby
      let a,x,y be Element of W;
      reconsider x1=x, y1=y, a1=a as Element of V by A1,TARSKI:def 3;
      (x+y)*a = MV.(x+y,a) by A7;
      then (x+y)*a = (x1+y1)*a1 by A8;
      then (x+y)*a = x1*a1 + y1*a1 by VECTSP_1:def 7;
      then (x+y)*a = Av.(MV.(x1,a1),y*a) by A7;
      then
A13:  (x+y)*a = Av.(x*a,y*a) by A7;
      a*(x+y) = MV.(a,x+y) by A7;
      then a*(x+y) = a1*(x1+y1) by A8;
      then a*(x+y) = a1*x1 + a1*y1 by VECTSP_1:def 7;
      then a*(x+y) = Av.(MV.(a,x1),a*y) by A7;
      then a*(x+y) = Av.(a*x,a*y) by A7;
      hence a*(x+y) = a*x + a*y & (x+y)*a = x*a + y*a by A8,A13;
    end;
  end;
  0.W = 0.V & 1.W = 1.V by A4,A5;
  hence thesis by A1,A2,A3,A9,Def3;
end;
