reserve OAS for OAffinSpace;
reserve a,a9,b,b9,c,c9,d,d1,d2,e1,e2,e3,e4,e5,e6,p,p9,q,r,x,y,z for Element of
  OAS;

theorem Th20:
  p<>b & Mid p,b,c implies ex x st Mid p,a,x & b,a // c,x
proof
  assume that
A1: p<>b and
A2: Mid p,b,c;
A3: p,b // b,c by A2,DIRAF:def 3;
  then
A4: p,b // p,c by ANALOAF:def 5;
A5: now
    assume
A6: not p,a,b are_collinear;
    consider x such that
A7: p,a // p,x and
A8: b,a // c,x by A1,A4,Th18;
A9: p<>c by A1,A2,DIRAF:8;
A10: p<>x
    proof
      p,b // p,c by A2,DIRAF:7;
      then
A11:  c,p // b,p by DIRAF:2;
      assume p=x;
      then b,a // b,p by A8,A9,A11,DIRAF:3;
      then Mid b,a,p or Mid b,p,a by DIRAF:7;
      then b,a,p are_collinear or b,p,a are_collinear by DIRAF:28;
      hence contradiction by A6,DIRAF:30;
    end;
    not p,x,c are_collinear
    proof
      Mid p,a,x or Mid p,x,a by A7,DIRAF:7;
      then p,a,x are_collinear or p,x,a are_collinear by DIRAF:28;
      then
A12:  p,x,a are_collinear by DIRAF:30;
A13:  p,x,p are_collinear  by DIRAF:31;
      p,b,c are_collinear by A2,DIRAF:28;
      then
A14:  p,c,b are_collinear by DIRAF:30;
A15:  p,c,p are_collinear by DIRAF:31;
      assume p,x,c are_collinear;
      then p,c,a are_collinear by A10,A12,A13,DIRAF:32;
      hence contradiction by A6,A9,A14,A15,DIRAF:32;
    end;
    hence thesis by A1,A2,A7,A8,Th15;
  end;
A16: now
    assume that
A17: p,a,b are_collinear and
A18: c <>b;
A19: now
      assume Mid p,a,b;
      then Mid a,b,c by A2,DIRAF:11;
      then Mid c,b,a by DIRAF:9;
      then
A20:  c,b // b,a by DIRAF:def 3;
      then c,b // c,a by ANALOAF:def 5;
      hence Mid p,a,a & b,a // c,a by A18,A20,ANALOAF:def 5,DIRAF:10;
    end;
A21: now
      assume Mid p,b,a;
      then
A22:  p,b // b,a by DIRAF:def 3;
A23:  now
A24:    now
          assume p,a // a,c;
          then Mid p,a,c by DIRAF:def 3;
          hence thesis by DIRAF:4;
        end;
A25:    now
          assume a=b;
          then b,a // c,a by DIRAF:4;
          hence thesis by DIRAF:10;
        end;
        p,b // p,a by A22,ANALOAF:def 5;
        then
A26:    b,a // p,a by A1,A22,ANALOAF:def 5;
        assume b,a // a,c;
        hence thesis by A26,A25,A24,ANALOAF:def 5;
      end;
A27:  now
        assume
A28:    b,c // c,a;
        then b,c // b,a by ANALOAF:def 5;
        hence Mid p,a,a & b,a // c,a by A18,A28,ANALOAF:def 5,DIRAF:10;
      end;
      b,a // b,c by A1,A3,A22,ANALOAF:def 5;
      hence thesis by A23,A27,ANALOAF:def 5;
    end;
    now
      assume Mid a,p,b;
      then Mid a,b,c by A1,A2,DIRAF:12;
      then Mid c,b,a by DIRAF:9;
      then
A29:  c,b // b,a by DIRAF:def 3;
      then c,b // c,a by ANALOAF:def 5;
      hence Mid p,a,a & b,a // c,a by A18,A29,ANALOAF:def 5,DIRAF:10;
    end;
    hence thesis by A17,A19,A21,DIRAF:29;
  end;
  c =b implies Mid p,a,a & b,a // c,a by DIRAF:1,10;
  hence thesis by A5,A16;
end;
