Zulip Chat Archive

Stream: Is there code for X?

Topic: finset.sup_attach


Yaël Dillies (Oct 14 2021 at 22:31):

Did I miss a generalization? Is there a slick proof of that?

import data.finset.lattice

lemma finset.sup_attach {α β : Type*} [semilattice_sup_bot α] (s : finset β) (f : β  α) :
  s.attach.sup (λ x, f x) = s.sup f :=
eq_of_forall_ge_iff $ λ c, begin
  rw [finset.sup_le_iff, finset.sup_le_iff],
  exact λ h b hb, h b, hb (s.mem_attach _), λ h b _, h b.1 b.2⟩,
end

Yakov Pechersky (Oct 14 2021 at 22:44):

import data.finset.lattice

lemma finset.sup_attach {α β : Type*} [semilattice_sup_bot α] (s : finset β) (f : β  α) :
  s.attach.sup (λ x, f x) = s.sup f :=
begin
  classical,
  induction s using finset.induction_on with x s hx IH generalizing f,
  { simp [finset.sup_image] },
  { simp only [finset.sup_image, finset.attach_insert, subtype.coe_mk, finset.sup_insert,
             subtype.val_eq_coe],
    rw IH,
    congr }
end

Yakov Pechersky (Oct 14 2021 at 22:44):

Oh sorry missed that you edited it

Yaël Dillies (Oct 14 2021 at 22:44):

Shorter :stuck_out_tongue:

Yaël Dillies (Oct 14 2021 at 22:45):

but I expect there's something more general about this "let's drop the proof" kind of thing.

Eric Wieser (Oct 15 2021 at 08:35):

Do we have docs#finset.sup_map or docs#finset.sup_image?

Eric Wieser (Oct 15 2021 at 08:36):

Yes; you can use that to pull the coercion out of the sup, and then you just need something like s.attach.map coe = s


Last updated: Dec 20 2023 at 11:08 UTC