proposition: Lemma list_gt_list_cons_right_true_1: forall p lg ls a, (exists a', In a' lg /\ p a' a = Some Greater_than) -> list_gt_list p lg ls = Some true -> list_gt_list p lg (a :: ls) = Some true.
proof: Proof. intros. apply list_gt_list_is_complete_true. unfold list_gt_list in H0. intros. assert (H0':= @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) ls). rewrite H0 in H0'. simpl in H1. destruct H1. clear H0. rewrite <- H1. clear H1 s. assumption. clear H0. assert (H0'':= H0' s). clear H0'. 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 H0''. trivial. clear H0''. assert (H2:= @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 H2. destruct H2. destruct H2. exists x. split. trivial. case_eq (p x s). intros. destruct c. rewrite H4 in H3. discriminate. rewrite H4 in H3. discriminate. trivial. rewrite H4 in H3. discriminate. intros. rewrite H4 in H3. 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)