reserve x,y for object,X,Y for set,
  D for non empty set,
  i,j,k,l,m,n,m9,n9 for Nat,
  i0,j0,n0,m0 for non zero Nat,
  K for Field,
  a,b for Element of K,
  p for FinSequence of K,
  M for Matrix of n,K;
reserve A for (Matrix of D),
  A9 for Matrix of n9,m9,D,
  M9 for Matrix of n9, m9,K,
  nt,nt1,nt2 for Element of n-tuples_on NAT,
  mt,mt1 for Element of m -tuples_on NAT,
  M for Matrix of K;
reserve P,P1,P2,Q,Q1,Q2 for without_zero finite Subset of NAT;

theorem Th81:
  for f,g be Function st rng f c= rng g ex h be Function st dom h
  = dom f & rng h c= dom g & f = g*h
proof
  let f,g be Function such that
A1: rng f c= rng g;
  defpred P[object,object] means f.$1=g.$2;
A2: for x being object st x in dom f
ex y being object st y in dom g & P[x,y] by A1,FUNCT_1:114;
  consider h be Function of dom f,dom g such that
A3: for x being object st x in dom f holds P[x,h.x] from FUNCT_2:sch 1(A2);
  per cases;
  suppose
    dom g={};
    then rng g={} by RELAT_1:42;
    then
A4: f=g*{} by A1;
    rng {} c= dom g;
    hence thesis by A4;
  end;
  suppose
A5: dom g<>{};
A6: rng h c= dom g by RELAT_1:def 19;
A7: dom h=dom f by A5,FUNCT_2:def 1;
    then
A8: dom (g*h)=dom f by A6,RELAT_1:27;
    now
      let x being object such that
A9:   x in dom f;
      thus f.x = g.(h.x) by A3,A9
        .= (g*h).x by A8,A9,FUNCT_1:12;
    end;
    hence thesis by A7,A6,A8,FUNCT_1:2;
  end;
end;
