Section section_for_maxs.
#[local] Notation In := List.In.
Definition maxs : list nat -> nat := fold_right max 0.
Proof with (lia || eauto).
unfold maxs. revert n H_IN. induction ns as [ | n' ns IH]; simpl...
intros n [H_eq | H_in]... enough (ENOUGH: fold_right max 0 ns >= n)...
Qed.
Proof with (lia || eauto).
unfold maxs. revert ns2.
induction ns1 as [ | n1 ns1 IH]; simpl...
intros n; rewrite IH...
Qed.

Lemma maxs_ind (phi : nat -> Prop) (ns : list nat)
(phi_dec : forall i, {phi i} + {~ phi i})
(phi_in : forall i, phi i -> In i ns)
: forall n, phi n -> maxs ns >= n.