Set Implicit Arguments.
Set Strict Implicit.
Set Asymmetric Patterns.
Fixpoint vector (T : Type) (n : nat) : Type :=
match n with
| 0 => unit
| S n => prod T (vector T n)
end.
Fixpoint get {T} {n : nat} (f : fin n) : vector T n -> T :=
match f in fin n return vector T n -> T with
| F0 n => fun v : T * vector T n => fst v
| FS n f => fun v : T * vector T n => get f (snd v)
end.
Fixpoint put {T} {n : nat} (f : fin n) (t : T) : vector T n -> vector T n :=
match f in fin n return vector T n -> vector T n with
| F0 _ => fun v => (t, snd v)
| FS _ f => fun v => (fst v, put f t (snd v))
end.

Theorem get_put_eq : forall {T n} (v : vector T n) (f : fin n) val,
get f (put f val v) = val.