Zulip Chat Archive

Stream: lean4

Topic: dsimp cannot reduce structure projection


Eric Wieser (Feb 19 2024 at 10:58):

Why is dsimp not able to reduce the structure projection here?

import Mathlib.Init.Data.List.Instances

example {A : Type} (a : A) (l : List {a : A // True}) : a  (l : List A) := by
  -- nasty unfolding, this probably shouldn't be necessary
  unfold Lean.Internal.coeM instCoeT instCoeHTCT_1 instCoeHTC_1 instCoeOTC instCoeOTC_2
  unfold subtypeCoe CoeOTC.coe CoeT.coe CoeHTCT.coe CoeHTC.coe CoeOut.coe
  -- this doesn't make progress
  dsimp only
  sorry

Eric Wieser (Feb 19 2024 at 10:59):

The goal is

A: Type
a: A
l: List { a // True }
 a  do
  let a  l
  pure
      {
          coe :=
            {
                  coe := fun a =>
                    { coe := fun a => { coe := fun a => { coe := fun a => a }.1 ({ coe := fun v => v }.1 a) }.1 a }.1
                      a }.1
              a }.1

where I would very much hope the .1s cancel with the constructors

Eric Wieser (Feb 19 2024 at 11:00):

It seems simp only can make progress, but it's not clear to me why dsimp cannot

Joachim Breitner (Feb 19 2024 at 11:10):

Me neither. I tried dsimp (config := {proj := true}) only but same effect. Probably worth reporting as an issue!

Eric Wieser (Feb 19 2024 at 11:32):

lean4#3395


Last updated: May 02 2025 at 03:31 UTC