Clear["Global`*"]

(* This program implements the theorem with explicit formulas for 3-person games*)
(* If the returned value of z is <0, the core is nonempty; if z>0 then the core is empty*)

IsCoreEmpty[v1_,v2_,v3_,v12_,v13_,v23_,v123_]:=Module[{x1,x2,x3},obj=z;cnsts={v1-x1≤z,v2-x2≤z,v3-x3≤z,v12-x1-x2≤z,v13-x1-x3≤z,v23-x2-x3≤z,x1+x2+x3==v123};Minimize[{obj,cnsts},{x1,x2,x3}]]

IsCoreEmpty[0,0,0,100,0,100,200]

IsCoreEmpty[0,0,0,1,1,1,1]

IsCoreEmpty[90,36,16,135,110,65,170]

(*Convert to normalized characteristic function*)
NormChar[v1_,v2_,v3_,v12_,v13_,v23_,v123_]:=Module[{w1,w2,w3,w12,w13,w23,w123},
{w1=0,w2=0,w3=0,w12=(v12-v1-v2)/(v123-v1-v2-v3),w13=(v13-v1-v3)/(v123-v1-v2-v3),w23=(v23-v2-v3)/(v123-v1-v2-v3),w123=1}];

W=NormChar[90,36,16,135,110,65,170.5]

W[[4]]

CheckCore[v12_,v13_,v23_,v123_]:=
Module[{y1,y2,y3},
Which [v123≥3*v12 && v123≥3*v13 && v123≥3*v23,
{y1=v123/3,y2=y1,y3=y1,
Print["Case 1"]},

 v123≥v12+2*v23 && v123≥v12+2*v13 && v123≤3*v12,
{y1=(v123+v12)/4,
y2=y1,
y3=(v123-v12)/2,
Print["Case 2"]},
 v123≥v12+2*v23 && v123≤v12+2*v13 && v12≥v13,
{y1=(v12+v13)/2,
y2=(v123-v13)/2,
y3=(v123-v12)/2,
Print["Case 3"]}, v123≤v12+2*v23 && v123≥v12+2*v13 && v23≤v12,
{y1=(v123-v23)/2,
y2=(v12+v23)/2,
y3=(v123-v12)/2,
Print["Case 4"]},

v123≤v12+2*v23 && v123≤v12+2*v13 && v123+v12≥2*(v13+v23),
{y1=(v123+v12-2*(v23-v13))/4,
y2=(v123+v12+2*(v23-v13))/4,
y3=(v123-v12)/2,
Print["Case 5"]},
v123≥v13+2*v23 && v123≥v13+2*v12 && v123≤3*v13 ,
{y1=(v123+v13)/4,
y2=(v123-v13)/2,
y3=y1,
Print["Case 6"]},
v123≥v13+2*v23 && v123≤v13+2*v12 && v13≥v12 ,
{y1=(v12+v13)/2,
y2=(v123-v13)/2,
y3=(v123-v12)/2,
Print["Case 7"]},
v123≤v13+2*v23 && v123≥v13+2*v12 && v13≥v23 ,
{y1=(v123-v23)/2,
y2=(v123-v13)/2,
y3=(v13+v23)/2,
Print["Case 8"]},

v123≤v13+2*v23 && v123≤v13+2*v12 && v123+v13≥2*(v12+v23) ,
{y1=(v123+v13-2*(v23-v12))/4,
y2=(v123-v13)/2,
y3=(v123+v13+2*(v23-v12))/4,
Print["Case 9"]},
v123≥v23+2*v13 && v123≥v23+2*v12 && v123≤3*v23 ,
{y1=(v123-v23)/2,
y2=(v123+v23)/4,
y3=y2,
Print["Case 10"]},
v123≥v23+2*v13 && v123≤v23+2*v12 && v23≥v12 ,
{y1=(v123-v23)/2,
y2=(v12+v23)/2,
y3=(v123-v12)/2,
Print["Case 11"]},
v123≤v23+2*v13 && v123≥v23+2*v12 && v23≥v13 ,
{y1=(v123-v23)/2,
y2=(v123-v13)/2,
y3=(v13+v23)/2,
Print["Case 12"]},
v123≤v23+2*v13 && v123≤v23+2*v12 && v123+v23≥2*(v13+v12) ,
{y1=(v123-v23)/2,
y2=(v123+v23-2*(v13-v12))/4,
y3=(v123+v23+2*(v13-v12))/4,
Print["Case 13"]},
v123+v12≤2*(v13+v23) && v123+v13≤2*(v12+v23) && v123+v23≤2*(v13+v12) ,
{y1=(v123+v12+v13-2*v23)/3,
y2=(v123+v12+v23-2*v13)/3,
y3=(v123+v13+v23-2*v12)/3,
Print["Case 14"]}
]
]

CheckCore[W[[4]],W[[5]],W[[6]],W[[7]]]

CheckCore[100,0,100,200]

CheckCore[1,2,10,15]

CheckCore[60,80,100,105]

CheckCore[4,0,3,6]

CheckCore[1,2,0,2]

CheckCore[2,2,10,12]