reserve x,y for object,X,Y,A,B,C,M for set;
reserve P,Q,R,R1,R2 for Relation;
reserve X,X1,X2 for Subset of A;
reserve Y for Subset of B;
reserve R,R1,R2 for Subset of [:A,B:];
reserve FR for Subset-Family of [:A,B:];

theorem :: (3.2.1)
  for A being set,B being non empty set, R being Relation of A,B,
  F being Subset-Family of A, G being Subset-Family of B st
  G = {R.:^Y where Y is Subset of A: Y in F} holds R.:^(union F) = Intersect G
proof
  let A be set,B be non empty set, R be Relation of A,B,
  F be Subset-Family of A, G be Subset-Family of B;
  assume
A1: G = {R.:^Y where Y is Subset of A: Y in F};
  per cases;
  suppose
A2: union F = {};
    then
A3: R.:^(union F) = B by Th29;
    per cases;
    suppose
A4:   G <> {};
      G c= {B}
      proof
        let x be object;
        assume x in G;
        then consider Y being Subset of A such that
A5:     x = R.:^Y and
A6:     Y in F by A1;
        Y = {} by A2,A6,ORDERS_1:6;
        then .:R.:{_{Y}_} = {} by Th23;
        then Intersect(.:R.:{_{Y}_}) = B by SETFAM_1:def 9;
        hence thesis by A5,TARSKI:def 1;
      end;
      then meet {B} c= meet G by A4,SETFAM_1:6;
      then B c= meet G by SETFAM_1:10;
      then meet G = B;
      hence thesis by A3,SETFAM_1:def 9;
    end;
    suppose G = {};
      hence thesis by A3,SETFAM_1:def 9;
    end;
  end;
  suppose union F <> {};
    then consider Z1 being set such that
    Z1 <> {} and
A7: Z1 in F by ORDERS_1:6;
    reconsider Z1 as Subset of A by A7;
A8: G <> {}
    proof
      assume not thesis;
      then not R.:^Z1 in G;
      hence contradiction by A1,A7;
    end;
    thus R.:^(union F) c= Intersect G
    proof
      let a be object;
      assume
A9:   a in R.:^(union F);
      for Y being set holds Y in G implies a in Y
      proof
        let Z2 be set;
        assume Z2 in G;
        then consider Z3 being Subset of A such that
A10:    Z2 = R.:^Z3 and
A11:    Z3 in F by A1;
        reconsider a as Element of B by A9;
        for x being set st x in Z3 holds a in Im(R,x)
        proof
          let x be set;
          assume x in Z3;
          then x in union F by A11,TARSKI:def 4;
          hence thesis by A9,Th24;
        end;
        hence thesis by A10,Th25;
      end;
      then a in meet G by A8,SETFAM_1:def 1;
      hence thesis by A8,SETFAM_1:def 9;
    end;
    let a be object;
    assume
A12: a in Intersect G;
    then
A13: a in meet G by A8,SETFAM_1:def 9;
    reconsider a as Element of B by A12;
    for X being set st X in union F holds a in Im(R,X)
    proof
      let X be set;
      assume X in union F;
      then consider Z being set such that
A14:  X in Z and
A15:  Z in F by TARSKI:def 4;
      reconsider Z as Subset of A by A15;
      set C = R.:^Z;
      C in G by A1,A15;
      then a in C by A13,SETFAM_1:def 1;
      hence thesis by A14,Th24;
    end;
    hence thesis by Th25;
  end;
end;
