Las funciones biyectivas tienen inversa
En Lean4 se puede definir que \(g\) es una inversa de \(f\) por
def inversa (f : X → Y) (g : Y → X) := (∀ x, (g ∘ f) x = x) ∧ (∀ y, (f ∘ g) y = y)
y que \(f\) tiene inversa por
def tiene_inversa (f : X → Y) := ∃ g, inversa f g
Demostrar con Lean4 que si la función \(f\) es biyectiva, entonces \(f\) tiene inversa.
Para ello, completar la siguiente teoría de Lean4:
import Mathlib.Tactic open Function variable {X Y : Type _} variable (f : X → Y) def inversa (f : X → Y) (g : Y → X) := (∀ x, (g ∘ f) x = x) ∧ (∀ y, (f ∘ g) y = y) def tiene_inversa (f : X → Y) := ∃ g, inversa g f example (hf : Bijective f) : tiene_inversa f := by sorry