File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 11Require Import ExtLib.Data.Map.FMapPositive.
2+ Require Import ExtLib.Data.Eq.
23Require Import ExtLib.Tactics.Injection.
34
45Fixpoint pmap_lookup' (ts : pmap Type ) (p : positive) : option Type :=
@@ -67,10 +68,24 @@ Definition OutOf {ts} {T : Type} (n : positive)
6768 | eq_refl => @asNth ts n
6869 end .
6970
70- Theorem OutOf_Into : forall ts T p pf v,
71- @OutOf ts T p pf (@Into ts T p pf v) = Some v.
71+ Lemma asNth'_get_lookup : forall p ts v, asNth' (ts:=ts) p p v = Some v.
7272Proof .
73- Admitted .
73+ induction p; simpl; intros; auto.
74+ Qed .
75+
76+ Theorem Outof_Into : forall ts T p pf v,
77+ @OutOf ts T p pf (@Into ts T p pf v) = Some v.
78+ Proof using .
79+ unfold OutOf, Into.
80+ intros.
81+ repeat rewrite (eq_Arr_eq pf).
82+ repeat rewrite (eq_Const_eq pf).
83+ repeat rewrite (eq_Const_eq (eq_sym pf)).
84+ unfold asNth. simpl.
85+ rewrite asNth'_get_lookup.
86+ { generalize dependent (pmap_lookup' ts p).
87+ intros. subst. reflexivity. }
88+ Qed .
7489
7590Theorem asNth_eq
7691: forall ts p oe v,
You can’t perform that action at this time.
0 commit comments