reserve X for BCI-algebra;
reserve X1 for non empty Subset of X;
reserve A,I for Ideal of X;
reserve x,y,z for Element of X;
reserve a for Element of A;

theorem Th21:
  I is p-ideal of X iff for x,y st x in I & x<=y holds y in I
proof
  thus I is p-ideal of X implies for x,y st x in I & x<=y holds y in I
  proof
    assume I is p-ideal of X;
    then
A1: BCK-part(X) c= I by Th19;
    let x,y such that
A2: x in I and
A3: x <= y;
A4: x\y = 0.X by A3;
    then (y\x)`=x\y by BCIALG_1:6;
    then 0.X <= y\x by A4;
    then y\x in BCK-part(X);
    hence thesis by A2,A1,BCIALG_1:def 18;
  end;
  assume
A5: for x,y st x in I & x<=y holds y in I;
A6: for x,y,z st (x\z)\(y\z) in I & y in I holds x in I
  proof
    let x,y,z such that
A7: (x\z)\(y\z) in I and
A8: y in I;
    ((x\z)\(y\z))\(x\y)=0.X by BCIALG_1:def 3;
    then ((x\z)\(y\z))<= x\y;
    then x\y in I by A5,A7;
    hence thesis by A8,BCIALG_1:def 18;
  end;
  0.X in I by BCIALG_1:def 18;
  hence thesis by A6,Def5;
end;
