reserve x,y,y1,y2,z,e,s for set;
reserve alpha,beta,gamma for Ordinal;
reserve n,m,k for Nat;
reserve g,g0,g1,g2,gO,gL,gR,gLL,gLR,gRL,gRR for ConwayGame;

theorem Th39:
  (for x holds x in the_LeftOptions_of -g iff
    ex gR st gR in the_RightOptions_of g & x = -gR)
  & (for x holds x in the_RightOptions_of -g iff
    ex gL st gL in the_LeftOptions_of g & x = -gL)
proof
  consider f being Function such that
A1: dom f = the_Tree_of g & f.g = -g
      & for g1 st g1 in dom f holds f.g1 = left-right(#
          { f.gR where gR is Element of the_RightOptions_of g1 :
              the_RightOptions_of g1 <> {} },
          { f.gL where gL is Element of the_LeftOptions_of g1 :
              the_LeftOptions_of g1 <> {} } #) by Def14;

A2:
  (gO in the_RightOptions_of g or gO in the_LeftOptions_of g)
    implies f.gO = -gO
  proof
    assume gO in the_RightOptions_of g or gO in the_LeftOptions_of g;
    then gO in the_Options_of g & the_Options_of g c= the_Tree_of g
      by Th34,XBOOLE_0:def 3;
    hence thesis by Lm4,A1;
  end;

  set L = { f.gR where gR is Element of the_RightOptions_of g
            : the_RightOptions_of g <> {} };
  set R = { f.gL where gL is Element of the_LeftOptions_of g
            : the_LeftOptions_of g <> {} };
  -g = left-right(#L,R#) by A1,Th24;
  then
A3: the_LeftOptions_of -g = L & the_RightOptions_of -g = R
    by Def6,Def7;

  hereby
    let x;
    hereby
      assume x in the_LeftOptions_of -g;
      then consider gR0 being Element of the_RightOptions_of g such that
A4:     x = f.gR0 & the_RightOptions_of g <> {} by A3;
      reconsider gR = gR0 as ConwayGame by Th18,A4;
      take gR;
      thus gR in the_RightOptions_of g & x = -gR by A4,A2;
    end;
    hereby
      assume ex gR st gR in the_RightOptions_of g & x = -gR;
      then consider gR such that
A5:     x = -gR & gR in the_RightOptions_of g;
      f.gR = -gR by A2,A5;
      hence x in the_LeftOptions_of -g by A3,A5;
    end;
  end;

  hereby
    let x;
    hereby
      assume x in the_RightOptions_of -g;
      then consider gL0 being Element of the_LeftOptions_of g such that
A6:     x = f.gL0 & the_LeftOptions_of g <> {} by A3;
      reconsider gL = gL0 as ConwayGame by Th18,A6;
      take gL;
      thus gL in the_LeftOptions_of g & x = -gL by A6,A2;
    end;
    hereby
      assume ex gL st gL in the_LeftOptions_of g & x = -gL;
      then consider gL such that
A7:     x = -gL & gL in the_LeftOptions_of g;
      f.gL = -gL by A2,A7;
      hence x in the_RightOptions_of -g by A3,A7;
    end;
  end;
end;
