reserve a,x,y for object, A,B for set,
  l,m,n for Nat;
reserve X,Y for set, x for object,
  p,q for Function-yielding FinSequence,
  f,g,h for Function;
reserve m,n,k for Nat, R for Relation;
reserve i,j for Nat;
reserve F for Function,
  e,x,y,z for object;

theorem
  for f,g,h being Function, A being set holds f, g equal_outside A
  implies h +* f, h +* g equal_outside A
proof
  let f,g,h be Function;
  let A be set;
  assume f,g equal_outside A;
  then
A1: f | (dom f \ A) = g | (dom g \ A);
  then
A2: dom f \ A = dom (g | (dom g \ A)) by RELAT_1:156
    .= dom g \ A by RELAT_1:156;
A3: dom ((h +* f) | (dom (h +* f) \ A)) = dom (h +* f) \ A by RELAT_1:156
    .= (dom h \/ dom f) \ A by FUNCT_4:def 1
    .= (dom h \ A) \/ (dom f \ A) by XBOOLE_1:42;
  then
A4: dom ((h +* f) | (dom (h +* f) \ A)) = (dom h \/ dom g) \ A by A2,
XBOOLE_1:42
    .= dom (h +* g) \ A by FUNCT_4:def 1
    .= dom ((h +* g) | (dom (h +* g) \ A)) by RELAT_1:156;
  now
    let x be object;
    assume
A5: x in dom ((h +* f) | (dom (h +* f) \ A));
    then
A6: x in dom h \ A or x in dom f \ A by A3,XBOOLE_0:def 3;
    per cases;
    suppose
A7:   x in dom f \ A;
      thus ((h +* f) | (dom (h +* f) \ A)).x = (h +* f).x by A5,FUNCT_1:47
        .= f.x by A7,FUNCT_4:13
        .= (g | (dom g \ A)).x by A1,A7,FUNCT_1:49
        .= g.x by A2,A7,FUNCT_1:49
        .= (h +* g).x by A2,A7,FUNCT_4:13
        .= ((h +* g) | (dom (h +* g) \ A)).x by A4,A5,FUNCT_1:47;
    end;
    suppose
A8:   not x in dom f \ A;
A9:   not x in A by A6,XBOOLE_0:def 5;
      then
A10:  not x in dom f by A8,XBOOLE_0:def 5;
A11:  not x in dom g by A2,A8,A9,XBOOLE_0:def 5;
      thus ((h +* f) | (dom (h +* f) \ A)).x = (h +* f).x by A5,FUNCT_1:47
        .= h.x by A10,FUNCT_4:11
        .= (h +* g).x by A11,FUNCT_4:11
        .= ((h +* g) | (dom (h +* g) \ A)).x by A4,A5,FUNCT_1:47;
    end;
  end;
  then (h +* f) | (dom (h +* f) \ A) = (h +* g) | (dom (h +* g) \ A) by A4;
  hence thesis;
end;
