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 Th26:
  for f1,f2 being ConwayGameChain st
    ex g st g = f2.1 & f1.(len f1) in the_Options_of g
    holds f1^f2 is ConwayGameChain
proof
  let f1,f2 be ConwayGameChain;
  assume
A1: ex g st g = f2.1 & f1.(len f1) in the_Options_of g;
  then reconsider g = f2.1 as ConwayGame;

  f1^f2 is ConwayGame-valued
  proof
    let x;
    set y = (f1^f2).x;
    assume x in dom (f1^f2);
    then y in rng (f1^f2) by FUNCT_1:3;
    then
A2:   y in rng f1 \/ rng f2 by FINSEQ_1:31;
    per cases by A2,XBOOLE_0:def 3;
      suppose y in rng f1;
        then ex z being object st z in dom f1 & y = f1.z by FUNCT_1:def 3;
        hence y is ConwayGame;
      end;
      suppose y in rng f2;
        then ex z being object st z in dom f2 & y = f2.z by FUNCT_1:def 3;
        hence y is ConwayGame;
      end;
  end;
  then reconsider f12 = f1^f2 as ConwayGame-valued non empty FinSequence;

  f12 is ConwayGameChain-like
  proof
    let n be Element of dom f12;
    assume
A3:   n > 1;
    per cases by XXREAL_0:1;
      suppose n < len f1 + 1;
        then n <= len f1 by NAT_1:22;
        then reconsider n0 = n as Element of dom f1 by A3,FINSEQ_3:25;
        n0 - 1 in dom f1 by Th20,A3;
        then f1.n0 = f12.n0 & f1.(n0-1) = f12.(n0-1) by FINSEQ_1:def 7;
        hence thesis by A3,Def11;
      end;
      suppose
A4:       n = len f1 + 1;
        len f1 in dom f1 & 1 in dom f2 by FINSEQ_5:6;
        then f12.(n-1) = f1.(len f1) & f12.n = f2.1 by A4,FINSEQ_1:def 7;
        hence thesis by A1;
      end;
      suppose
A5:       n > len f1 + 1;
        n <= len f12 & len f12 = len f1 + len f2 & n >= len f1
          by A5,FINSEQ_1:22,FINSEQ_3:25,XREAL_1:38;
        then
A6:       (n - len f1) > 1 & (n - len f1) <= len f2 & n - len f1 is Nat
          by A5,NAT_1:21,XREAL_1:20;
        then reconsider k = n - len f1 as Element of dom f2
          by FINSEQ_3:25;
        k-1 in dom f2 by A6,Th20;
        then f12.(len f1 + k) = f2.k & f12.(len f1 + (k-1)) = f2.(k-1)
          by FINSEQ_1:def 7;
        hence thesis by A6,Def11;
      end;
  end;
  hence thesis;
end;
