Zulip Chat Archive

Stream: Is there code for X?

Topic: coprod and prod on submodules


Eric Wieser (Jul 07 2021 at 14:00):

Do we have anything that be used to make this proof shorter?

import linear_algebra.prod

variables {R M M₂ M₃} [semiring R] [add_comm_monoid M] [add_comm_monoid M₂] [add_comm_monoid M₃]
variables [module R M] [module R M₂] [module R M₃]

lemma coprod_map_prod (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃)
  (S : submodule R M) (S' : submodule R M₂) :
  (submodule.prod S S').map (linear_map.coprod f g) = (S.map f)  (S'.map g) :=
set_like.coe_injective $ begin
  ext,
  simp [submodule.mem_sup],
  simp_rw exists_and_distrib_left,
  simp_rw and_assoc,
end

Eric Wieser (Jul 07 2021 at 14:17):

I suspect a variant of docs#submodule.mem_sup that expressed the RHS as a sum would help

Yakov Pechersky (Jul 07 2021 at 14:35):

A term-mode-like proof:

lemma coprod_map_prod (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃)
  (S : submodule R M) (S' : submodule R M₂) :
  (submodule.prod S S').map (linear_map.coprod f g) = (S.map f)  (S'.map g) :=
begin
  ext,
  simp only [mem_sup, mem_map, linear_map.coprod_apply, mem_prod, prod.exists, exists_prop],
  exact λ y, z, hy, hz⟩, h⟩, f y, mem_map_of_mem hy, g z, mem_map_of_mem hz, h⟩,
         λ _, y, hy, rfl⟩, _, z, hz, rfl⟩, h⟩, y, z, hy, hz⟩, h⟩⟩
end

Eric Wieser (Jul 07 2021 at 14:50):

I think this was the lemma I wanted:

lemma coe_sup : (p  p') = (p + p' : set M) :=
begin
  ext,
  rw [set_like.mem_coe, mem_sup, set.mem_add],
  simp,
end

Eric Wieser (Jul 07 2021 at 15:45):

#8220 adds coprod_map_prod and coe_sup. coe_supr is probably not far out of reach, but I didn't care enough to try.

Alex J. Best (Aug 23 2021 at 17:20):

@Eric Wieser maybe you are on holiday already, but which of the lemma you added here and docs#map_coprod_prod should we keep?

Eric Wieser (Aug 23 2021 at 18:33):

That link doesn't seem to work and the search page fails on mobile (I'm on holiday, but happy to do things that don't require lean access)

Alex J. Best (Aug 23 2021 at 18:34):

Oops sorry docs#linear_map.map_coprod_prod, its the same lemma as docs#linear_map.coprod_map_prod, just the new one has a nicer proof I suppose?

Alex J. Best (Aug 23 2021 at 18:37):

The naming convention is confusing me a lot though

Eric Wieser (Aug 23 2021 at 18:41):

Ouch, did I introduce that for other subobjects too?

Eric Wieser (Aug 23 2021 at 18:42):

Can we make a linter to catch this type of thing?

Alex J. Best (Aug 23 2021 at 19:39):

@Eric Wieser yes I found this with a "duplicate lemma finder" metaprogram!

Eric Wieser (Aug 23 2021 at 19:40):

How many others did you find?

Alex J. Best (Aug 23 2021 at 19:44):

Hard to say, some are still false positives but 30-50 maybe?

Alex J. Best (Aug 23 2021 at 19:45):

Just picked some that seemed easyish to fix up first in branch#alexjbest/dedup/1. But some are a bit subtle to choose which versions are better


Last updated: Dec 20 2023 at 11:08 UTC