reserve X1,X2,X3,X4 for set;
reserve n for non zero Nat;
reserve X for non-empty n-element FinSequence;

theorem Thm27:
  for X being non-empty 1-element FinSequence,
  S being SemiringFamily of X holds
  the set of all product <*s*> where s is Element of S.1 is
  semiring_of_sets of the set of all <*x*> where x is Element of X.1
  proof
    let X be non-empty 1-element FinSequence, S be SemiringFamily of X;
    S is SemiringFamily of X & 1 in Seg 1 by FINSEQ_1:3;
    then
A1: S.1 is semiring_of_sets of X.1 by Def2;
    set S1=the set of all product <*s*> where s is Element of S.1;
    set X1=the set of all <*x*> where x is Element of X.1;
    now
      S1 c= bool X1
      proof
        let x be object;
        assume
A2:     x in S1;
        then consider s0 be Element of S.1 such that
A3:     x = product <*s0*>;
        per cases;
        suppose
A4:       s0 is non empty;
          reconsider x1=x as set by A2;
          x1 c= X1
          proof
            let y be object;
            assume
            y in x1;
            then y in the set of all <*a*> where a is Element of s0
            by A3,A4,Thm23;
            then consider a be Element of s0 such that
A6:         y = <*a*>;
A7:         a in union (S.1) by A4,A1,TARSKI:def 4;
            union (S.1) c= union bool (X.1) by A1,ZFMISC_1:77;
            then union (S.1) c= (X.1) by ZFMISC_1:81;
            hence y in X1 by A6,A7;
          end;
          hence x in bool X1;
        end;
        suppose
A8:       s0 is empty;
          product <*{}*> c= X1;
          hence x in bool X1 by A8,A3;
        end;
      end;
      then reconsider S2=S1 as Subset-Family of X1;
      now
Z:      {} is Element of S.1 by A1,SETFAM_1:def 8; then
A9:     {} in S1 by Thm22;
        thus S2 is with_empty_element by Z,Thm22;
        now
          let s1,s2 be Element of S2;
          assume
A10:      s1/\s2 is non empty;
A11:      s1 in S1 & s2 in S2 by A9;
          then consider sa1 be Element of S.1 such that
A12:      s1 = product <*sa1*>;
          consider sa2 be Element of S.1 such that
A13:      s2 = product <*sa2*> by A11;
A14:      sa1/\sa2 is non empty by A12,A13,A10,Thm25,Thm22;
          then consider ax be finite Subset of S.1 such that
A15:      ax is a_partition of sa1/\sa2 by A1,SRINGS_1:def 1;
A16:      ax is non empty by A14,A15;
          set x = the set of all product <*t*> where t is Element of ax;
          now
            deffunc F(object) = product <*$1*>;
            consider f being Function such that
A17:        dom f = ax and
A18:        for x be object st x in ax holds f.x=F(x) from FUNCT_1:sch 3;
            rng f = x
            proof
              now
                hereby
                  let t be object;
                  assume t in rng f;
                  then consider q be object such that
A19:              q in dom f and
A20:              t = f.q by FUNCT_1:def 3;
                  t = F(q) by A17,A19,A20,A18;
                  hence t in x by A17,A19;
                end;
                let t be object;
                assume t in x;
                then consider u be Element of ax such that
A21:            t= product <*u*>;
                f.u = F(u) by A18,A14,A15;
                hence t in rng f by A21,A17,A14,A15,FUNCT_1:def 3;
              end;
              then x c= rng f & rng f c= x;
              hence thesis;
            end;
            hence x is finite by A17,FINSET_1:8;
            x c= S2
            proof
              let t be object;
              assume t in x;
              then consider u be Element of ax such that
A22:          t = product <*u*>;
              u in ax & ax c= S.1 by A16;
              hence t in S2 by A22;
            end;
            hence x is Subset of S2;
            now
A23:          x c= bool (s1/\s2)
              proof
                let t be object;
                assume
                t in x;
                then consider u0 be Element of ax such that
A24:            t = product <*u0*>;
                reconsider t1=t as set by A24;
                per cases;
                suppose
A25:              t1 is empty;
                  {} c= (s1/\s2);
                  hence thesis by A25;
                end;
                suppose
A26:              t1 is non empty; then
A28:              t = the set of all <*y*> where y is Element of u0
                  by A24,Thm22,Thm23;
                  t1 c= s1/\s2
                  proof
                    let y be object;
                    assume y in t1;
                    then consider z be Element of u0 such that
A29:                y=<*z*> by A28;
A30:                product<*sa1/\sa2*> = the set of all <*a*> where
                    a is Element of sa1/\sa2 by A14,Thm23;
                    u0 in ax & union ax = sa1/\sa2 by A16,A15,EQREL_1:def 4;
                    then z in sa1/\sa2 by A24,A26,Thm22,TARSKI:def 4;
                    then y in product <*sa1/\sa2*> by A29,A30;
                    hence y in s1/\s2 by A12,A13,Thm25;
                  end;
                  hence thesis;
                end;
              end;
              hence x is Subset-Family of s1/\s2;
              now
                hereby
                  let a be object;
                  assume a in union x;
                  then consider b be set such that
A31:              a in b and
A32:              b in x by TARSKI:def 4;
                  thus a in s1/\s2 by A31,A32,A23;
                end;
                let a be object;
                assume a in s1/\s2; then
A33:            a in product <*sa1/\sa2*> by A12,A13,Thm25;
                product <*sa1/\sa2*> = the set of all <*u*> where
                u is Element of sa1/\sa2 by A14,Thm23;
                then consider b be Element of sa1/\sa2 such that
A34:            a = <*b*> by A33;
                b in sa1/\sa2 & union ax = sa1/\sa2 by A14,A15,EQREL_1:def 4;
                then consider d be set such that
A35:            b in d & d in ax by TARSKI:def 4;
A36:            product <*d*> = the set of all <*u*> where
                u is Element of d by A35,Thm23;
                <*b*> in product <*d*> & product <*d*> in x by A35,A36;
                hence a in union x by A34,TARSKI:def 4;
              end;
              then union x c= s1/\s2 & s1/\s2 c= union x;
              hence union x = s1/\s2;
              hereby
                let A be Subset of s1/\s2;
                assume A in x;
                then consider a be Element of ax such that
A37:            A = product <*a*>;
A38:            a in ax by A16;
A39:            A = the set of all <*u*> where u is Element of a
                by A14,A15,A37,Thm23;
                consider b be object such that
A40:            b in a by A14,A15,XBOOLE_0:def 1;
                <*b*> in A by A39,A40;
                hence A<>{};
                let B be Subset of s1/\s2;
                assume B in x;
                then consider b be Element of ax such that
A41:            B = product <*b*>;
A42:            b in ax by A16;
                a misses b implies A misses B by A37,A41,Thm25,Thm22;
                hence A=B or A misses B by A42,A38,A15,EQREL_1:def 4,A37,A41;
              end;
            end;
            hence x is a_partition of s1/\s2 by EQREL_1:def 4;
          end;
          hence ex x be finite Subset of S2 st
          x is a_partition of s1/\s2;
        end;
        hence S2 is cap-finite-partition-closed;
        now
          let s1,s2 be Element of S2;
          assume
A44:      s2 c= s1;
          per cases;
          suppose
A45:        s1\s2 is empty;
            now
              {} c= S2;
              hence {} is finite Subset of S2;
              thus {} is a_partition of {} by EQREL_1:45;
            end;
            hence ex x be finite Subset of S2 st
            x is a_partition of s1\s2 by A45;
          end;
          suppose
A46:        s1\s2 is non empty & s2 is empty;
            now
              {s1} c= S2
              proof
                let t be object;
                assume t in {s1};
                then t = s1 by TARSKI:def 1;
                hence thesis by A9;
              end;
              hence {s1} is finite Subset of S2;
              thus {s1} is a_partition of s1 by A46,EQREL_1:39;
            end;
            hence ex x be finite Subset of S2 st
            x is a_partition of s1\s2 by A46;
          end;
          suppose
A47:        s1\s2 is non empty & s2 is non empty;
A48:        s1 in S1 & s2 in S2 by A9;
            then consider sa1 be Element of S.1 such that
A49:        s1 = product <*sa1*>;
            consider sa2 be Element of S.1 such that
A50:        s2 = product <*sa2*> by A48;
A51:        sa1 is non empty by A47,A49;
A52:        product <*sa1*> = the set of all <*u*> where
            u is Element of sa1 by A47,A49,Thm22,Thm23;
A53:        product <*sa2*> = the set of all <*u*> where
            u is Element of sa2 by A47,A50,Thm22,Thm23;
            sa2 c= sa1
            proof
              assume not sa2 c= sa1;
              then consider a be object such that
A54:          a in sa2 and
A55:          not a in sa1;
              <*a*> in s2 by A50,A54,A53;
              then <*a*> in product <*sa1*> by A44,A49;
              then consider a0 be Element of sa1 such that
A56:          <*a*> = <*a0*> by A52;
              a=a0 by A56,FINSEQ_1:76;
              hence contradiction by A51,A55;
            end;
            then consider ax be finite Subset of S.1 such that
A57:        ax is a_partition of sa1\sa2 by A1,SRINGS_1:def 3;
A58:        ax is non empty
            proof
              assume ax is empty;
              then sa1 \ sa2 = {} by A57;
              hence contradiction by A47,A49,A50,Thm26,Thm22;
            end;
A59:        sa1\sa2 <> {} by A49,A50,A47,Thm26,Thm22;
            set x = the set of all product <*t*> where t is Element of ax;
            now
              deffunc F(object) = product <*$1*>;
              consider f being Function such that
A60:          dom f = ax and
A61:          for x be object st x in ax holds f.x=F(x) from FUNCT_1:sch 3;
              rng f = x
              proof
                now
                  hereby
                    let t be object;
                    assume t in rng f;
                    then consider q be object such that
A62:                q in dom f and
A63:                t = f.q by FUNCT_1:def 3;
                    t = product <*q*> & q in ax by A60,A61,A62,A63;
                    hence t in x;
                  end;
                  let t be object;
                  assume t in x;
                  then consider u be Element of ax such that
A64:              t= product <*u*>;
                  f.u = F(u) by A61,A58;
                  hence t in rng f by A64,A60,A58,FUNCT_1:def 3;
                end;
                then x c= rng f & rng f c= x;
                hence thesis;
              end;
              hence x is finite by A60,FINSET_1:8;
              x c= S2
              proof
                let t be object;
                assume t in x;
                then consider u be Element of ax such that
A65:            t = product <*u*>;
                u in ax & ax c= S.1 by A58;
                hence t in S2 by A65;
              end;
              hence x is Subset of S2;
              now
A66:            x c= bool (s1\s2)
                proof
                  let t be object;
                  assume
                  t in x;
                  then consider u0 be Element of ax such that
A67:              t = product <*u0*>;
                  reconsider t1=t as set by A67;
                  per cases;
                  suppose
A68:                t1 is empty;
                    {} c= (s1\s2);
                    hence thesis by A68;
                  end;
                  suppose
A69:                t1 is non empty; then
A71:                t = the set of all <*y*> where y is Element of u0
                    by A67,Thm22,Thm23;
                    t1 c= s1\s2
                    proof
                      let y be object;
                      assume y in t1;
                      then consider z be Element of u0 such that
A72:                  y=<*z*> by A71;
A73:                  product<*sa1\sa2*> = the set of all <*a*> where
                      a is Element of sa1\sa2 by A59,Thm23;
                      u0 in ax & union ax = sa1\sa2 by A57,A58,EQREL_1:def 4;
                      then z in sa1\sa2 by A67,A69,Thm22,TARSKI:def 4;
                      then y in product <*sa1\sa2*> by A72,A73;
                      hence y in s1\s2 by A49,A50,Thm26;
                    end;
                    hence thesis;
                  end;
                end;
                hence x is Subset-Family of s1\s2;
                now
                  hereby
                    let a be object;
                    assume a in union x;
                    then consider b be set such that
A74:                a in b and
A75:                b in x by TARSKI:def 4;
                    thus a in s1\s2 by A66,A74,A75;
                  end;
                  let a be object;
                  assume
A76:              a in s1\s2;
A77:              a in product <*sa1\sa2*> by Thm26,A76,A49,A50;
                  product <*sa1\sa2*> = the set of all <*u*> where
                  u is Element of sa1\sa2 by A59,Thm23;
                  then consider b be Element of sa1\sa2 such that
A78:              a = <*b*> by A77;
                  b in sa1\sa2 & union ax = sa1\sa2 by A59,A57,EQREL_1:def 4;
                  then consider d be set such that
A79:              b in d & d in ax by TARSKI:def 4;
A80:              product <*d*> = the set of all <*u*> where
                  u is Element of d by Thm23,A79;
                  <*b*> in product <*d*> & product <*d*> in x by A79,A80;
                  hence a in union x by A78,TARSKI:def 4;
                end;
                then union x c= s1\s2 & s1\s2 c= union x;
                hence union x = s1\s2;
                hereby
                  let A be Subset of s1\s2;
                  assume A in x;
                  then consider a be Element of ax such that
A81:              A = product <*a*>;
A82:              a in ax by A58;
A83:              A = the set of all <*u*> where u is Element of a
                  by A57,A58,A81,Thm23;
                  consider b be object such that
A84:              b in a by A57,A58,XBOOLE_0:def 1;
                  <*b*> in A by A83,A84;
                  hence A<>{};
                  let B be Subset of s1\s2;
                  assume B in x;
                  then consider b be Element of ax such that
A85:              B = product <*b*>;
A86:              b in ax by A58;
                  a misses b implies A misses B by A81,A85,Thm25,Thm22;
                  hence A=B or A misses B
                    by A86,A81,A85,A82,A57,EQREL_1:def 4;
                end;
              end;
              hence x is a_partition of s1\s2 by EQREL_1:def 4;
            end;
            hence ex x be finite Subset of S2 st
            x is a_partition of s1\s2;
          end;
        end;
        hence S2 is diff-c=-finite-partition-closed;
      end;
      hence S1 is semiring_of_sets of X1;
    end;
    hence thesis;
  end;
