proposition: Lemma list_gt_list_cons_right_true: forall p lg ls a, list_gt_list p lg (a::ls) = Some true -> list_gt_list p lg ls = Some true.
proof: Proof. unfold list_gt_list. intros. apply list_gt_list_is_complete_true. assert (H1:= @list_forall_option_is_sound term (fun s : term => list_exists_option (fun g : term => match p g s with | Some Equivalent => Some false | Some Less_than => Some false | Some Greater_than => Some true | Some Uncomparable => Some false | None => None end) ( lg)) (a:: ls) ). rewrite H in H1. clear H. intros. assert (H1':= H1 s). clear H1. assert (list_exists_option (fun g : term => match p g s with | Some Equivalent => Some false | Some Less_than => Some false | Some Greater_than => Some true | Some Uncomparable => Some false | None => None end) ( lg) = Some true). apply H1'. simpl. right. trivial. assert (H0':= @list_exists_option_is_sound term (fun g : term => match p g s with | Some Equivalent => Some false | Some Less_than => Some false | Some Greater_than => Some true | Some Uncomparable => Some false | None => None end) (lg)). rewrite H0 in H0'. destruct H0'. destruct H1. exists x. split. trivial. case_eq (p x s). intros. destruct c. rewrite H3 in H2. discriminate. rewrite H3 in H2. discriminate. trivial. rewrite H3 in H2. discriminate. intros. rewrite H3 in H2. discriminate. Qed.
imports: Coq(Bool Peano List PeanoNat) CoLoR(closure more_list equiv_list list_permut dickson) Coq(Relations Wellfounded Arith Wf_nat Recdef Program Morphisms Lia) CoLoR(term_spec term decidable_set ordered_set NatCompat)