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 x, y being set, f being Function st x in dom f implies y in dom f
  & f.x = f.y holds f = f*((id dom f)+*(x,y))
proof
  let x, y be set, f be Function;
  assume
A1: x in dom f implies y in dom f & f.x = f.y;
  set g1 = (id dom f)+*(x,y);
  set g = f*g1;
A2: dom id dom f = dom f;
  per cases;
  suppose
    not x in dom f;
    then id dom f = g1 by Def2;
    hence thesis by RELAT_1:52;
  end;
  suppose
A3: x in dom f;
A4: dom g1 = dom f by A2,Th29;
    now
      rng g1 c= dom f
      proof
        let b be object;
        assume b in rng g1;
        then consider a being object such that
A5:     a in dom g1 and
A6:     b = g1.a by FUNCT_1:def 3;
        per cases;
        suppose
          a = x;
          hence thesis by A1,A2,A3,A6,Th30;
        end;
        suppose
          a <> x;
          then (id dom f).a = g1.a by Th31;
          hence thesis by A4,A5,A6,FUNCT_1:18;
        end;
      end;
      hence dom f = dom g by A4,RELAT_1:27;
      let a be object;
      assume a in dom f;
      thus f.a = g.a by A1,A3,Th106;
    end;
    hence thesis;
  end;
end;
