Zulip Chat Archive

Stream: Is there code for X?

Topic: End_isUnit_iff


Xavier Xarles (Jan 13 2024 at 22:27):

I am sure this is already in Mathlib4

import Mathlib.GroupTheory.GroupAction.Defs
import Mathlib.Algebra.Group.Units

theorem End_isUnit_iff {M:Type*} (f : Function.End M) :
    IsUnit f  Function.Bijective f := by  sorry

Adam Topaz (Jan 13 2024 at 22:31):

I think a more idiomatic spelling would be something like the following:

def foo (M:Type*) :
    (Function.End M)ˣ  (M  M) :=
  sorry

Adam Topaz (Jan 13 2024 at 22:32):

But I can't seem to find that one either

Eric Wieser (Jan 13 2024 at 22:37):

I think we probably want both spellings

Eric Wieser (Jan 13 2024 at 22:37):

Adam's spelling we already have for Module.End and for affine maps, and possibly more

Eric Wieser (Jan 13 2024 at 22:38):

I think the names are a complete mess though

Eric Wieser (Jan 13 2024 at 22:38):

And I don't think we have the IsUnit version for (edit: m)any morphisms

Adam Topaz (Jan 13 2024 at 22:38):

docs#Module.End_isUnit_iff

Adam Topaz (Jan 13 2024 at 22:38):

That's the only one I could find

Xavier Xarles (Jan 13 2024 at 22:38):

Yeah, that's what I found.

Xavier Xarles (Jan 13 2024 at 22:40):

My proof is pretty bad...

import Mathlib.GroupTheory.GroupAction.Defs
import Mathlib.Algebra.Group.Units


theorem End_isUnit_iff {M:Type*} (f : Function.End M) :
    IsUnit f  Function.Bijective f := by
  rw [@Function.bijective_iff_has_inverse]
  simp_rw [@Function.leftInverse_iff_comp,@Function.rightInverse_iff_comp]
  constructor <;> intro h
  · let u,hu := h
    use u.inv
    rw [ hu]
    exact u.inv_val,u.val_inv
  · let g,hg1,hg2 := h
    use {val:=f, inv:= g, val_inv:=hg2,inv_val:=hg1}

Junyan Xu (Jan 13 2024 at 22:48):

Found docs#Equiv.Perm.equivUnitsEnd by Loogle

Junyan Xu (Jan 13 2024 at 22:48):

(deleted)

Junyan Xu (Jan 13 2024 at 22:48):

@loogle Function.End, Units

loogle (Jan 13 2024 at 22:48):

:search: Equiv.Perm.equivUnitsEnd, Equiv.Perm.val_equivUnitsEnd_apply, and 4 more

Junyan Xu (Jan 13 2024 at 22:49):

@loogle Function.End, IsUnit

loogle (Jan 13 2024 at 22:49):

:shrug: nothing found

Antoine Chambert-Loir (Jan 14 2024 at 16:49):

On the other hand, there is docs#CategoryTheory.isUnit_iff_isIso


Last updated: May 02 2025 at 03:31 UTC