Zulip Chat Archive

Stream: new members

Topic: rewrite only one occurrence


Vasily Ilin (Jun 02 2022 at 02:14):

I have a goal with two occurrences of v, and would like to rewrite only one of them. Can I do that?

example (α : Type) (n : ) (v : fin n  α) (w : α) : fin.tail (matrix.vec_cons w v) = v :=
begin
  rw  @fin.tail_cons _ (λ_,α) w v,
end

I need it for this proof:

variables (k : Type) (V : Type) [field k] [add_comm_group V] [module k V]

example (n : ) (v : fin n  V) (lin_indep : linear_independent k v) (w : V) : linear_independent k (matrix.vec_cons w v)  w  submodule.span k (set.range v)
:=
begin
  rw linear_independent_fin_succ,
  have : fin.tail (matrix.vec_cons w v) = v,
  sorry,
  sorry,
end

Adam Topaz (Jun 02 2022 at 02:24):

tactic#nth_rewrite

Vasily Ilin (Jun 02 2022 at 02:33):

Is it intentional that example (α : Type) (n : ℕ) (v : fin n → α) (w : α) : fin.tail (matrix.vec_cons w v) = v and similar variants do not exist in matrix but do exist in fin? It seems that translating between them is quite tedious (mostly because fin.cons w v does not work for (α : Type) (n : ℕ) (v : fin n → α) (w : α))

Eric Wieser (Jun 02 2022 at 08:18):

Do we have docs#matrix.vec_tail?

Eric Wieser (Jun 02 2022 at 08:19):

Yes; so you're not supposed to mix the two APIs it seems


Last updated: Dec 20 2023 at 11:08 UTC