Zulip Chat Archive

Stream: general

Topic: two orphaned lemmas


Scott Morrison (Jul 21 2020 at 12:41):

I'm trying to slice up algebra.big_operators into small files, both because it was getting quite jumbled, and also because every time I look at the output of leanproject import-graph --to X there's an unpleasant knot at algebra.big_operators. :-)

Scott Morrison (Jul 21 2020 at 12:42):

This has mostly gone well, but I've been left with two lemmas, neither of which get used anywhere in mathlib, and neither of which has a natural home anymore.

Scott Morrison (Jul 21 2020 at 12:42):

protected lemma sum_nat_coe_enat (s : finset α) (f : α  ) :
  ( x in s, (f x : enat)) = ( x  in s, f x : ) :=
begin
  classical,
  induction s using finset.induction with a s has ih h,
  { simp },
  { simp [has, ih] }
end

Scott Morrison (Jul 21 2020 at 12:42):

/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive]
lemma prod_powerset_insert [decidable_eq α] [comm_monoid β] {s : finset α} {x : α} (h : x  s) (f : finset α  β) :
  ( a in (insert x s).powerset, f a) =
    ( a in s.powerset, f a) * ( t in s.powerset, f (insert x t)) :=
begin
  rw [powerset_insert, finset.prod_union, finset.prod_image],
  { assume t₁ h₁ t₂ h₂ heq,
    rw [ finset.erase_insert (not_mem_of_mem_powerset_of_not_mem h₁ h),
         finset.erase_insert (not_mem_of_mem_powerset_of_not_mem h₂ h), heq] },
  { rw finset.disjoint_iff_ne,
    assume t₁ h₁ t₂ h₂,
    rcases finset.mem_image.1 h₂ with t₃, h₃, H₃₂,
    rw  H₃₂,
    exact ne_insert_of_not_mem _ _ (not_mem_of_mem_powerset_of_not_mem h₁ h) }
end

Scott Morrison (Jul 21 2020 at 12:42):

Please use suitable emojis to indicate their preferred fate. :-)

Scott Morrison (Jul 21 2020 at 12:42):

More seriously, suggestions where to put them welcome.

Johan Commelin (Jul 21 2020 at 12:43):

Put them in algebra.big_operators.orphans?

Scott Morrison (Jul 21 2020 at 12:43):

They're currently in algebra.big_operators.others :-)

Anne Baanen (Jul 21 2020 at 12:58):

sum_nat_coe_enat is just a case of sum_hom, right? Then we can just delete it.

Johan Commelin (Jul 21 2020 at 12:58):

Alas, enat is not an add_monoid

Kevin Buzzard (Jul 21 2020 at 12:59):

Why not?

Johan Commelin (Jul 21 2020 at 12:59):

Ooh, is it?

Kevin Buzzard (Jul 21 2020 at 12:59):

It's not cancellative

Johan Commelin (Jul 21 2020 at 13:00):

Aah, it's multiplication that is an issue

Anne Baanen (Jul 21 2020 at 13:00):

There is even an instance : add_comm_monoid enat

Johan Commelin (Jul 21 2020 at 13:00):

Right

Johan Commelin (Jul 21 2020 at 13:00):

/me should think before talking

Johan Commelin (Jul 21 2020 at 13:00):

@Scott Morrison That signs its fate, I think (and mine??? :worried: )

Scott Morrison (Jul 21 2020 at 13:04):

Great. I might go look at the git blame to see who wanted the other lemma.

Scott Morrison (Jul 21 2020 at 13:04):

(Now that I've said that, it's going to be me, and I'll feel weirdly awkward for having no memory of it.)

Kevin Buzzard (Jul 21 2020 at 13:06):

Two days ago I asked someone if some fact about digits was in mathlib and they replied "you PRed it last week"

Scott Morrison (Jul 21 2020 at 13:06):

Sebastien introduced into back in #1908, but didn't use it in that PR.

Scott Morrison (Jul 21 2020 at 13:07):

Kevin Buzzard said:

Two days ago I asked someone if some fact about digits was in mathlib and they replied "you PRed it last week"

https://mathoverflow.net/questions/23989/are-the-norms-of-graphs-dense-in-any-interval#comment50174_23993

Scott Morrison (Jul 21 2020 at 13:09):

Ah, I'm making false accusations against Sebastien. He used the additive version.

Scott Morrison (Jul 21 2020 at 13:10):

And I'm wrong that it's orphaned, oops!


Last updated: Dec 20 2023 at 11:08 UTC