Fixpoint nocc (n : nat) (l : list nat) {struct l} : nat :=
  match l with
  | Nil => 0
  | Cons m x => si nat (egal_nat n m) (S (nocc n x)) (nocc n x)
  end.

Theorem sorted_inf : forall (n m : nat) (x : list nat), sorted (Cons nat n (Cons nat m x)) -> inf_egal n m = true.