proposition: Lemma swim1_dec: forall L j L' j', swim1 L j = (L', Some j') -> j' < j.
proof: Proof. unfold swim1. intros L j L' j'. case_eq (j <=? root_idx). discriminate. case_eq (nth_error L j). 2: discriminate. case_eq (nth_error L (parent j)). 2: discriminate. intros a a0 ?. case (a1 <<=? a). 2: discriminate. intros. inversion H1. apply parent_dec. apply Nat.leb_nle in H0. lia. Qed.
imports: Psatz List Arith.Div2 Even Relations RelationClasses PeanoNat Peano_dec Recdef Sorting Permutation Multiset