End Float.
(** * Single-precision FP numbers *)
Module Float32.
(** ** NaN payload manipulations *)
Program Definition transform_quiet_pl (pl:nan_pl 24) : nan_pl 24 :=
Pos.lor pl (iter_nat xO 22 xH).
Next Obligation.
destruct pl.
simpl. rewrite Z.ltb_lt in *.
assert (forall x, Fcore_digits.digits2_pos x = Pos.size x).
{ induction x0; simpl; auto; rewrite IHx0; zify; omega. }
rewrite H, Psize_log_inf, <- Zlog2_log_inf in *. clear H.
change (Z.pos (Pos.lor x 4194304)) with (Z.lor (Z.pos x) 4194304%Z).
rewrite Z.log2_lor by (zify; omega).
apply Z.max_case. auto. simpl. omega.
Qed.

Lemma transform_quiet_pl_idempotent:
forall pl, transform_quiet_pl (transform_quiet_pl pl) = transform_quiet_pl pl.