reserve n,m,k,i for Nat,
  g,s,t,p for Real,
  x,y,z for object, X,Y,Z for set,
  A1 for SetSequence of X,
  F1 for FinSequence of bool X,
  RFin for real-valued FinSequence,
  Si for SigmaField of X,
  XSeq,YSeq for SetSequence of Si,
  Omega for non empty set,
  Sigma for SigmaField of Omega,
  ASeq,BSeq for SetSequence of Sigma,
  P for Probability of Sigma;

theorem Th54:
  for F1 being FinSequence of bool X holds ex A1 being SetSequence
  of X st (for k st k in dom F1 holds A1.k = F1.k) & for k st not k in dom F1
  holds A1.k = {}
proof
  deffunc G(object) = {};
  let F1 be FinSequence of bool X;
  defpred P[object] means $1 in dom F1;
  deffunc F(object) = F1.$1;
  ex f being Function st dom f = NAT &
 for k being object st k in NAT holds (
  P[k] implies f.k=F(k)) & (not P[k] implies f.k=G(k)) from PARTFUN1:sch 1;
  then consider f being Function such that
A1: dom f = NAT and
A2: for x being object st x in NAT
holds (x in dom F1 implies f.x = F1.x) & (not x in
  dom F1 implies f.x = {});
A3: for x st x in dom F1 holds F1.x in bool X
  proof
    let x;
    assume x in dom F1;
    then F1.x in rng F1 by FUNCT_1:3;
    hence thesis;
  end;
  for x st x in NAT holds f.x in bool X
  proof
    let x;
    assume
A4: x in NAT;
    per cases;
    suppose
      not x in dom F1;
      then f.x = {} by A2,A4;
      then f.x c= X;
      hence thesis;
    end;
    suppose
A5:   x in dom F1;
      then f.x = F1.x by A2;
      hence thesis by A3,A5;
    end;
  end;
  then reconsider f as SetSequence of X by A1,FUNCT_2:3;
  take f;
  thus for k st k in dom F1 holds f.k = F1.k by A2;
  let k;
  k in NAT by ORDINAL1:def 12;
  hence thesis by A2;
end;
