Skip to content

Commit

Permalink
feat(logic/function/basic): not_surjective_Type (#12311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHughes24 committed Feb 27, 2022
1 parent 7ae0b36 commit b1c2d70
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/logic/function/basic.lean
Expand Up @@ -213,6 +213,23 @@ theorem cantor_injective {α : Type*} (f : (set α) → α) :
cantor_surjective (λ a b, ∀ U, a = f U → U b) $
right_inverse.surjective (λ U, funext $ λ a, propext ⟨λ h, h U rfl, λ h' U' e, i e ▸ h'⟩)

/-- There is no surjection from `α : Type u` into `Type u`. This theorem
demonstrates why `Type : Type` would be inconsistent in Lean. -/
theorem not_surjective_Type {α : Type u} (f : α → Type (max u v)) :
¬ surjective f :=
begin
intro hf,
let T : Type (max u v) := sigma f,
cases hf (set T) with U hU,
let g : set T → T := λ s, ⟨U, cast hU.symm s⟩,
have hg : injective g,
{ intros s t h,
suffices : cast hU (g s).2 = cast hU (g t).2,
{ simp only [cast_cast, cast_eq] at this, assumption },
{ congr, assumption } },
exact cantor_injective g hg
end

/-- `g` is a partial inverse to `f` (an injective but not necessarily
surjective function) if `g y = some x` implies `f x = y`, and `g y = none`
implies that `y` is not in the range of `f`. -/
Expand Down

0 comments on commit b1c2d70

Please sign in to comment.