Zulip Chat Archive

Stream: Is there code for X?

Topic: finsupp.nonzero_iff_exist


Scott Morrison (May 04 2022 at 11:37):

We have finsupp.nonzero_iff_exists {f : α →₀ M} : f ≠ 0 ↔ ∃ a : α, f a ≠ 0, but I'm not finding the analogue of this that I want, for linear maps. Are these hiding somewhere under a different name, or do they need adding?

Yaël Dillies (May 04 2022 at 11:38):

I just added something similar. docs#continuous_linear_map.exists_ne_zero

Johan Commelin (May 04 2022 at 11:44):

Shouldn't we just have that for arbitrary functions?

Yaël Dillies (May 04 2022 at 11:45):

Well, yeah, but it depends on the specific has_zero instance.

Scott Morrison (May 04 2022 at 11:45):

If we just write it for "bare" functions, we won't be able to use it with rw or simp, unfortunately.

Yaël Dillies (May 04 2022 at 11:45):

Usually, ⇑0 = 0 is defeq though.

Scott Morrison (May 04 2022 at 11:46):

Still, syntactic form is what counts. :-(

Yaël Dillies (May 04 2022 at 11:46):

@Anne Baanen, didn't you have plans to write a has_pointwise_zero instance? :grinning:

Yaël Dillies (May 04 2022 at 11:46):

You can rw [←coe_zero, coe_inj] I believe, Scott. But I agree it's a pain.

Scott Morrison (May 04 2022 at 11:47):

But I don't want to have extra rewrites, or to have to know a silly name like coe_zero. :-)

Scott Morrison (May 04 2022 at 11:47):

and library_search must find this lemma

Scott Morrison (May 04 2022 at 11:47):

because otherwise I'm going to have to ask here again. :-)

Yaël Dillies (May 04 2022 at 11:47):

I'm always here to serve!

Eric Wieser (May 04 2022 at 11:50):

Shouldn't we just have that for arbitrary functions?

docs#function.ne_iff

Eric Wieser (May 04 2022 at 11:50):

docs#fun_like.ne_iff

Eric Wieser (May 04 2022 at 11:51):

Zero falls out as an uninteresting special case, since pretty much all function types have 0 x = 0 by definition

Anne Baanen (May 04 2022 at 11:55):

Yaël Dillies said:

Anne Baanen, didn't you have plan,s to write a has_pointwise_zero instance? :grinning:

I don't recall that. Wasn't Yury doing something with pointwise maps?

Scott Morrison (May 04 2022 at 12:04):

The other similiar statement I'd like is nontrivial iff surjective f → f ≠ 0. That seems harder to make polymorphic, because of the "what does the zero function mean" issue.

Eric Wieser (May 04 2022 at 12:23):

You could always put a coe_fn on the f

Eric Wieser (May 04 2022 at 12:24):

Which I guess would be on all occurences of f at that point, so it just becomes about function.

Eric Wieser (May 04 2022 at 12:24):

What I think we are missing are lemmas like docs#linear_map.coe_eq_zero which should contain the obvious iff

Yaël Dillies (May 04 2022 at 12:49):

Yeah I proved some stuff similar to that a while back. See docs#finset.coe_eq_singleton. This dumb lemma is super practical.


Last updated: Dec 20 2023 at 11:08 UTC