Attached lists and list-to-finset products #
Two facts used wherever a proof enumerates a finite set as a list and then maps or multiplies over it: mapping a function defined on the attached subtype agrees with mapping the total function, and a list product is the finset product of the finset the list enumerates.
theorem
RS.attachWith_map_eq
{β : Type u_1}
{γ : Type u_2}
{p : β → Prop}
(fsub : { g : β // p g } → γ)
(ftot : β → γ)
(hpt : ∀ (g : β) (hg : p g), fsub ⟨g, hg⟩ = ftot g)
(l : List β)
(H : ∀ g ∈ l, p g)
:
Mapping over an attached list agrees with mapping the total function, when the two agree pointwise.