The following rules could represent if there is no bigger number than A, then A is the maximum.
non_max(X) :- p(X), p(Y), Y > X.
max(X) :- p(X), not non_max(X).
Basically, the rule you are representing is a rule with a universal quantifier, i.e.
∀b ∈ p(b), if a > b, then a is the maximum. (1)
If a is the maximum, then ∀b ∈ p(b), a > b. (2)
Transform (2) into its contrapositive, we have
If ∃b ∈ p(b), a < b, then b is not the maximum (3)
correspondingn rule of (3) is non_max(X) :- p(X), p(Y), Y > X.
Since max and non_max are mutually exclusive, then we have
max(X) :- p(X), not non_max(X).