Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explanation about Inverse function in Chapter 4 #213

Open
yannickseurin opened this issue Jul 12, 2024 · 0 comments
Open

Explanation about Inverse function in Chapter 4 #213

yannickseurin opened this issue Jul 12, 2024 · 0 comments

Comments

@yannickseurin
Copy link
Contributor

Chapter 4 presents the definition of the inverse of a function in Section 4.2:

With these in hand, we can define the inverse function as follows:

noncomputable section

open Classical

def inverse (f : α → β) : β → α := fun y : β ↦
  if h : ∃ x, f x = y then Classical.choose h else default

theorem inverse_spec {f : α → β} (y : β) (h : ∃ x, f x = y) : f (inverse f y) = y := by
 rw [inverse, dif_pos h]
 exact Classical.choose_spec h

Later in Section 4.3, the inverse function is presented once again without reference to the previous section (e.g. without relating inverse in Section 4.2 and invFun in Section 4.3, or inverse_spec and invFun_eq in Section 4.3), which sounds odd:

Specifically, we need the hypothesis [Nonempty β] for the operation invFun that is defined in Mathlib. Given x : α, invFun g x chooses a preimage of x in β if there is one, and returns an arbitrary element of β otherwise. The function invFun g is always a left inverse if g is injective and a right inverse if g is surjective.

#check (invFun g : α → β)
#check (leftInverse_invFun : Injective g → LeftInverse (invFun g) g)
#check (leftInverse_invFun : Injective g → ∀ y, invFun g (g y) = y)
#check (invFun_eq : (∃ y, g y = x) → g (invFun g x) = x)

It sounds as if the end of Section 4.2 has been added after Section 4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant