Skip to content
Snippets Groups Projects
Commit 383118f5 authored by Jan's avatar Jan
Browse files

added sum_list_with_in

parent f65bf936
No related branches found
No related tags found
No related merge requests found
...@@ -200,6 +200,14 @@ Section sum_list. ...@@ -200,6 +200,14 @@ Section sum_list.
Proof. Proof.
induction l; simpl; rewrite ?reverse_cons, ?sum_list_with_app; simpl; lia. induction l; simpl; rewrite ?reverse_cons, ?sum_list_with_app; simpl; lia.
Qed. Qed.
Lemma sum_list_with_in x (f: A -> nat) l: x l -> f x sum_list_with f l.
Proof.
intros. induction l.
- contradict H. apply not_elem_of_nil.
- cbn. rewrite elem_of_cons in H. destruct H as [H | H].
+ simplify_eq. lia.
+ specialize (IHl H). lia.
Qed.
Lemma join_reshape szs l : Lemma join_reshape szs l :
sum_list szs = length l mjoin (reshape szs l) = l. sum_list szs = length l mjoin (reshape szs l) = l.
Proof. Proof.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment