This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Theorem indecidable : | |
| forall (b : ballot) (l : list cand), | |
| {forall c : cand, In c l -> b c > 0} + {~ forall c : cand, In c l -> b c > 0}. | |
| Proof. | |
| intros b. induction l. | |
| left; intros. inversion H. | |
| destruct IHl. left; intros. | |
| apply in_inv in H. destruct H. | |
| rewrite <- H. apply g. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Theorem indecidable : | |
| forall (b : ballot) (l : list cand), | |
| {forall c : cand, In c l -> b c > 0} + {~(forall c : cand, In c l -> b c > 0)}. | |
| Proof. | |
| intros b. induction l. | |
| left. intros. inversion H. | |
| destruct IHl. left. | |
| intros c H. apply in_inv in H. destruct H. | |
| admit. | |
| firstorder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cand : Type | |
| cand_all : list cand | |
| dec_cand : forall n m : cand, {n = m} + {n <> m} | |
| cand_fin : forall c : cand, In c cand_all | |
| wins : cand -> (cand -> cand -> Z) -> Type | |
| loses : cand -> (cand -> cand -> Z) -> Type | |
| is_marg : (cand -> cand -> Z) -> list ballot -> Prop | |
| m : cand -> cand -> Z | |
| p : ballot | |
| c, d : cand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Theorem ceval_deterministic: forall (c:com) st st1 st2 s1 s2, | |
| c / st \\ s1 / st1 -> | |
| c / st \\ s2 / st2 -> | |
| st1 = st2 /\ s1 = s2. | |
| Proof. | |
| induction c. intros st st1 st2 s1 s2 H1 H2. | |
| inv H1; inv H2. intuition. | |
| intros. inv H; inv H0. intuition. | |
| intros. inv H; inv H0. intuition. | |
| intros. inv H; inv H0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 15 subgoals, subgoal 1 (ID 4519) | |
| Inductive ceval : com -> state -> status -> state -> Prop := | |
| | E_Skip st : CSkip / st \\ SContinue / st | |
| | E_Break st : CBreak / st \\ SBreak / st | |
| | E_Ass st a1 n x : aeval st a1 = n -> (x ::= a1) / st \\ SContinue / (t_update st x n) | |
| | E_IfTrue st st' b c1 c2 s : | |
| beval st b = true -> c1 / st \\ s / st' -> | |
| (IFB b THEN c1 ELSE c2 FI) / st \\ s / st' | |
| | E_IfFalse st st' b c1 c2 s : | |
| beval st b = false -> c2 / st \\ s / st' -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fixpoint f_Z_nat (n : Z) : nat := | |
| match n with | |
| | Z0 => 0 | |
| | Zpos p => 2 * Z.to_nat (Zpos p) - 1 | |
| | Zneg p => 2 * Z.to_nat (Zpos p) | |
| end. | |
| Eval compute in (f_Z_nat 10). | |
| Eval compute in (f_Z_nat (-2)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fixpoint f_Z_nat (n : Z) : nat := | |
| match n with | |
| | Z0 => 0 | |
| | Zpos p => 2 * Z.to_nat (Zpos p) - 1 | |
| | Zneg p => 2 * Z.to_nat (Zpos p) | |
| end. | |
| Eval compute in (f_Z_nat 10). | |
| Eval compute in (f_Z_nat (-2)). | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Lemma Zmn : forall (m n : Z), m < n -> Z.max m n = n. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fixpoint maxlist (l : list Z) : Z := | |
| match l with | |
| | [] => 0%Z | |
| | [h] => h | |
| | h :: t => Z.max h (maxlist t) | |
| end. | |
| Lemma Max_of_nonempty_list : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Theorem N : forall (n : nat) (c d : Evote.cand), n <> O -> Z. | |
| refine (fix MM (n : nat) (c d : Evote.cand) := _). | |
| destruct n. | |
| refine (fun H => False_rect _ (H eq_refl)). | |
| refine (fun H => maxlist (map (fun x : Evote.cand => Z.min (Evote.edge c x) | |
| (M n x d)) Evote.cand_all)). | |
| Defined. | |
| (* the function M n maps a pair of candidates c, d to the strength of the strongest path of | |
| length at most (n + 1) *) |