reserve a,b,c,k,l,m,n for Nat,
  i,j,x,y for Integer;

theorem Th3:
  n is prime & k in {kk where kk is Element of NAT: n,kk
   are_coprime & kk >= 1 & kk <= n}
  iff n is prime & k in Segm n & not k in {0}
proof
  set X = {kk where kk is Element of NAT : n,kk are_coprime & kk >= 1 &
  kk <= n};
  thus n is prime & k in X implies n is prime & k in Segm n & not k in {0}
  proof
    assume that
A1: n is prime and
A2: k in X;
A3: ex kk being Element of NAT st kk = k & n,kk are_coprime & kk >=
    1 & kk <= n by A2;
    then k <> n by A1,Lm2,Th1;
    then k < n by A3,XXREAL_0:1;
    hence thesis by A1,A3,NAT_1:44,TARSKI:def 1;
  end;
  assume that
A4: n is prime and
A5: k in Segm n and
A6: not k in {0};
A7: k <> 0 by A6,TARSKI:def 1;
  then
A8: k >= 1 by NAT_1:14;
A9: k < n by A5,NAT_1:44;
  then k in NAT & k,n are_coprime by A4,A7,Th2,ORDINAL1:def 12;
  hence thesis by A4,A9,A8;
end;
