reserve X,x,y,z for set;
reserve n,m,k,k9,d9 for Nat;
reserve d for non zero Nat;
reserve i,i0,i1 for Element of Seg d;
reserve l,r,l9,r9,l99,r99,x,x9,l1,r1,l2,r2 for Element of REAL d;
reserve Gi for non trivial finite Subset of REAL;
reserve li,ri,li9,ri9,xi,xi9 for Real;
reserve G for Grating of d;

theorem Th45:
  cell(l,r) is Cell of d,G implies
  (cell(l,r) = infinite-cell(G) iff for i holds r.i < l.i)
proof
  assume
A1: cell(l,r) is Cell of d,G;
  then reconsider A = cell(l,r) as Cell of d,G;
  hereby
    assume cell(l,r) = infinite-cell(G);
    then consider l9,r9 such that
A2: cell(l,r) = cell(l9,r9) and
A3: for i holds r9.i < l9.i & [l9.i,r9.i] is Gap of G.i by Def10;
A4: l = l9 by A2,A3,Th28;
    r = r9 by A2,A3,Th28;
    hence for i holds r.i < l.i by A3,A4;
  end;
  set i0 = the Element of Seg d;
  assume for i holds r.i < l.i;
  then
A5: r.i0 < l.i0;
A6: A = cell(l,r);
  for i holds r.i < l.i & [l.i,r.i] is Gap of G.i by A1,A5,Th31;
  hence thesis by A6,Def10;
end;
