Zulip Chat Archive

Stream: lean4

Topic: Dependent version of congr_arg₂


Geoffrey Irving (Aug 13 2024 at 16:24):

Ignoring the dependent types this would be just simp [Vector.toList_length], but alas that does nothing. How can I prove this?

import Mathlib.Data.Vector.Basic

variable {α β : Type}

lemma congr_arg₂_vector (f : (n : )  Vector α n  β) (n : ) (y : Vector α n) :
     h, f y.toList.length y.toList, h = f n y := by
  sorry

Johan Commelin (Aug 13 2024 at 18:51):

Does cases y help?

Eric Wieser (Aug 13 2024 at 19:43):

lemma congr_arg₂_vector (f : (n : )  Mathlib.Vector α n  β) (n : ) (y : Mathlib.Vector α n) (h) :
    f y.toList.length y.toList, h = f n y := by
  obtain y, rfl := y
  rfl

Last updated: May 02 2025 at 03:31 UTC