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

[Merged by Bors] - feat(logic/function/basic): not_surjective_Type #12311

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/logic/function/basic.lean
Original file line number Diff line number Diff line change
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)) :
Copy link
Member

@TwoFX TwoFX Feb 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are willing to move the theorem to logic/small.lean, then the proof is just

not_small_type ∘ small_of_surjective

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That file has a lot of dependencies, comparatively speaking. Perhaps the proof can be used to shorten this one, but I think it is fine where it is.

¬ 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