Zulip Chat Archive

Stream: Is there code for X?

Topic: Cantor_Bernstein


Chris Birkbeck (Oct 12 2021 at 15:58):

Is the following result somewhere in mathlib?

noncomputable def Cantor_Bernstein {α : Type u} {β : Type u} (f: α  β) (g : β  α )
    (h1 : function.injective f) (h2 :function.injective g) : α  β :=
begin
have c1 := cardinal.mk_le_of_injective h1,
have c2 :=cardinal.mk_le_of_injective h2,
have c3 : cardinal.mk α =cardinal.mk β , by {exact le_antisymm c1 c2,  },
apply (cardinal.eq.1 c3).some,
end

It feels like it should, but I couldn't find it. If not, any ideas where to put it?

Adam Topaz (Oct 12 2021 at 16:03):

I'm inclined to say that it should go somewhere around set_theory.cardinal. Also, it would be better to not require α\alpha and β\beta to be in the same universe.

Johan Commelin (Oct 12 2021 at 16:03):

I would be surprised if this isn't there yet

Anne Baanen (Oct 12 2021 at 16:04):

docs#function.embedding.schroeder_bernstein

Anne Baanen (Oct 12 2021 at 16:05):

I know this result as Cantor-Schröder-Bernstein, so I searched for each of the names in turn until I found it :D

Chris Birkbeck (Oct 12 2021 at 16:07):

ahh wonderful! I knew it had to be somewhere

Adam Topaz (Oct 12 2021 at 16:07):

Anne Baanen said:

docs#function.embedding.schroeder_bernstein

The proof of this is 25 lines long!

Kevin Buzzard (Oct 12 2021 at 16:08):

Yes but does it assume le_antisymm for cardinals?

Anne Baanen (Oct 12 2021 at 16:08):

set_theory/cardinal.lean depends on the theorem, so probably not

Kevin Buzzard (Oct 12 2021 at 16:08):

Right!

Adam Topaz (Oct 12 2021 at 16:08):

Ah :)

Kevin Buzzard (Oct 12 2021 at 16:09):

So in fact your proof is probably circular Chris :-)

Chris Birkbeck (Oct 12 2021 at 16:10):

Kevin Buzzard said:

So in fact your proof is probably circular Chris :-)

Ah yes the best kind of proof!

Riccardo Brasca (Oct 12 2021 at 16:11):

le_antisymm is proved by le_antisymm := by { rintros ⟨α⟩ ⟨β⟩ ⟨e₁⟩ ⟨e₂⟩, exact quotient.sound (e₁.antisymm e₂) }, and antisymm is

theorem antisymm : (α  β)  (β  α)  nonempty (α  β)
| e₁, h₁ e₂, h₂ :=
  let f, hf := schroeder_bernstein h₁ h₂ in
  equiv.of_bijective f hf

So it's indeed circular :)

Riccardo Brasca (Oct 12 2021 at 16:13):

BTW, a good method to find it is to look for the linear_order instance on cardidal, that is found automatically by Lean, and see how antisymmetry is proved.

Riccardo Brasca (Oct 12 2021 at 16:17):

I always use Kevin's trick described here to explicitly find the instance. No idea if there are better ways of doing it.


Last updated: Dec 20 2023 at 11:08 UTC