Require Export Undecidability.Shared.Libs.PSL.Base Lia.
From Undecidability.L Require Export MoreList.
(* * Preliminaries *)
Instance le_preorder : PreOrder le.
Instance S_le_proper : Proper (le ==> le) S.
Instance plus_le_proper : Proper (le ==> le ==> le) plus.
Instance mult_le_proper : Proper (le ==> le ==> le) mult.
Instance pow_le_proper : Proper (le ==> eq ==> le) Nat.pow.
Instance max_le_proper : Proper (le ==> le ==> le) max.
repeat intro. repeat eapply Nat.max_case_strong;lia.
Qed.
Instance min_le_proper : Proper (le ==> le ==> le) min.
repeat intro. repeat eapply Nat.min_case_strong;lia.
Qed.
Instance Nat_log2_le_Proper : Proper (le ==> le) Nat.log2.
Instance Pos_to_nat_le_Proper : Proper (Pos.le ==> le) Pos.to_nat.
Instance Pos_add_le_Proper : Proper (Pos.le ==> Pos.le ==>Pos.le) Pos.add.

Lemma nth_error_Some_lt A (H:list A) a x : nth_error H a = Some x -> a < |H|.