Zulip Chat Archive

Stream: new members

Topic: Isometric image of finite metric ball


Rémi Bottinelli (Mar 06 2022 at 09:32):

Hey! I'm trying to prove that in a transitive metric space, balls have the same cardinality (assuming finite, in my case).
I reckon there should be a very quick way to do this: an isometry restricts to a bijection on balls, which implies equal cardinalities, but I'm not sure how to use what: fintype,finset,injective, maps_to, etc.
How should I proceed here ? And also, is fintype better suited than finset here?

import topology.metric_space.basic
import topology.metric_space.isometry

universe u

open function set fintype function
open_locale nnreal ennreal

variables {α : Type u} [pseudo_metric_space α]

@[class] structure finite_balls :=
(fintype_ball :  x : α,  r : , fintype (metric.ball x r))

attribute [instance] finite_balls.fintype_ball

def uniformly_finite_balls_with [@finite_balls α _] (k :   ) :=
 x : α,  r : ,  card (metric.ball x r)  k r

namespace uniformly_finite_balls_with

lemma of_transitive
  [inhabited α]
  [@finite_balls α _]
  (tr :  x y : α,  f : α ≃ᵢ α, (f x = y)) :
   k :   , @uniformly_finite_balls_with α _ _ k :=
begin
  let x := arbitrary α,
  let k := λ r, card $ metric.ball x r,
  use k,
  intros y r,
  rcases tr x y with f,fxy⟩,
  rw fxy,
  rw  isometric.image_ball f x r, -- doesn't work
end

end uniformly_finite_balls_with

Vincent Beffara (Mar 06 2022 at 09:45):

finset.card_image_of_injective ?

Rémi Bottinelli (Mar 06 2022 at 09:53):

Does that mean I should change my defs to use finset, or is it fine as it is?

Rémi Bottinelli (Mar 06 2022 at 14:39):

lemma of_transitive
  [inhabited α]
  (fb : @finite_balls α _)
  (tr :  x y : α,  f : α ≃ᵢ α, (f x = y)) :
   k :   , @uniformly_finite_balls_with α _ _ k :=
begin
  let x := arbitrary α,
  let k := λ (r : ), card (metric.ball x r),
  use k,
  intros y r,
  rcases tr x y with f,fxy⟩,
  rw fxy,
  have Bxrfintype : fintype (metric.ball x r), by {sorry},
  have Byrfintype : fintype (metric.ball y r), by {sorry},
  have lol1 := isometric.image_ball f x r, -
  have imgffintype : fintype (f '' metric.ball x r), by {sorry},
  have lol3 : card (metric.ball x r)  k r, by {simp},
  have lol4 := @card_image_of_injective α α (metric.ball x r) Bxrfintype f imgffintype (isometric.injective f),
  simp_rw lol1 at lol4,
  rw lol4,
  exact lol3,
end

I think that's a contender for ugliest non-working code. After some search on zulip, it seems part of the problem is that the elaborator doesn't handle the fintype instances in the way I'd like it to.

Yaël Dillies (Mar 06 2022 at 14:52):

Those have should be haveI

Rémi Bottinelli (Mar 06 2022 at 14:54):

lemma of_transitive
  [inhabited α]
  [fb : @finite_balls α _]
  (tr :  x y : α,  f : α ≃ᵢ α, (f x = y)) :
   k :   , @uniformly_finite_balls_with α _ _ k :=
begin
  let x := arbitrary α,
  let k := λ (r : ), card (metric.ball x r),
  use k,
  intros y r,
  rcases tr x y with f,fxy⟩,
  rw fxy,
  have Bxrfintype : fintype (metric.ball x r), by {sorry},
  have Byrfintype : fintype (metric.ball y r), by {sorry},
  have imgisball:= isometric.image_ball f x r,
  have imgffintype : fintype (f '' metric.ball x r), from set.fintype_image _ f,
  have := @card_image_of_injective _ _ (metric.ball x r) _ f imgffintype (isometric.injective f),
  simp_rw [imgisball,this] at *,
end

Rémi Bottinelli (Mar 06 2022 at 14:55):

OK, only two sorries, which I feel should come for free?

Rémi Bottinelli (Mar 06 2022 at 14:55):

oh, thanks, haveI looks to be part of what I was missing!

Rémi Bottinelli (Mar 06 2022 at 14:58):

ah, I'm getting there, let me see

Rémi Bottinelli (Mar 06 2022 at 15:03):

lemma of_transitive
  [inhabited α]
  [fb : @finite_balls α _]
  (tr :  x y : α,  f : α ≃ᵢ α, (f x = y)) :
   k :   , @uniformly_finite_balls_with α _ _ k :=
begin
  let x := arbitrary α,
  let k := λ (r : ), card (metric.ball x r),
  use k,
  intros y r,
  rcases tr x y with f,fxy⟩,
  rw fxy,
  have imgisball := isometric.image_ball f x r,
  have imgcard   := card_image_of_injective (metric.ball x r) (isometric.injective f),
  simp_rw [imgisball,imgcard] at *,
end

I believe that's close enough! Thanks for the help!

Rémi Bottinelli (Mar 06 2022 at 15:04):

And by the way, it seems that lean doesn't accept unfolding definitions when they are not made properly as a def.
Say in the code above, I can't unfold k. What's the reason for this?

Sebastien Gouezel (Mar 06 2022 at 15:12):

The mathlib way would probably be to split this into several lemmas:

  • if there is an isometric equivalence between two spaces, mapping x to y, then the cardinality (in the sense of cardinal numbers) of ball x r and ball y r are the same.
  • If additionally ball x r is finite, then ball y r is also finite
  • and their cardinalities as finite sets are the same

Last updated: Dec 20 2023 at 11:08 UTC