logic.small.basicMathlib.Logic.Small.Defs

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathbin.Logic.Equiv.Set
+import Logic.Equiv.Set
 
 #align_import logic.small.basic from "leanprover-community/mathlib"@"c3291da49cfa65f0d43b094750541c0731edc932"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module logic.small.basic
-! leanprover-community/mathlib commit c3291da49cfa65f0d43b094750541c0731edc932
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Logic.Equiv.Set
 
+#align_import logic.small.basic from "leanprover-community/mathlib"@"c3291da49cfa65f0d43b094750541c0731edc932"
+
 /-!
 # Small types
 
Diff
@@ -67,10 +67,12 @@ instance (priority := 100) small_self (α : Type v) : Small.{v} α :=
 #align small_self small_self
 -/
 
+#print small_map /-
 theorem small_map {α : Type _} {β : Type _} [hβ : Small.{w} β] (e : α ≃ β) : Small.{w} α :=
   let ⟨γ, ⟨f⟩⟩ := hβ.equiv_small
   Small.mk' (e.trans f)
 #align small_map small_map
+-/
 
 #print small_lift /-
 theorem small_lift (α : Type u) [hα : Small.{v} α] : Small.{max v w} α :=
@@ -101,9 +103,11 @@ section
 
 open scoped Classical
 
+#print small_congr /-
 theorem small_congr {α : Type _} {β : Type _} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
   ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
 #align small_congr small_congr
+-/
 
 #print small_subtype /-
 instance small_subtype (α : Type v) [Small.{w} α] (P : α → Prop) : Small.{w} { x // P x } :=
Diff
@@ -157,8 +157,8 @@ instance small_Pi {α} (β : α → Type _) [Small.{w} α] [∀ a, Small.{w} (β
 
 #print small_sigma /-
 instance small_sigma {α} (β : α → Type _) [Small.{w} α] [∀ a, Small.{w} (β a)] :
-    Small.{w} (Σa, β a) :=
-  ⟨⟨Σa' : Shrink α, Shrink (β ((equivShrink α).symm a')),
+    Small.{w} (Σ a, β a) :=
+  ⟨⟨Σ a' : Shrink α, Shrink (β ((equivShrink α).symm a')),
       ⟨Equiv.sigmaCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩
 #align small_sigma small_sigma
 -/
@@ -198,7 +198,7 @@ instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [S
 #print not_small_type /-
 theorem not_small_type : ¬Small.{u} (Type max u v)
   | ⟨⟨S, ⟨e⟩⟩⟩ =>
-    @Function.cantor_injective (Σα, e.symm α) (fun a => ⟨_, cast (e.3 _).symm a⟩) fun a b e =>
+    @Function.cantor_injective (Σ α, e.symm α) (fun a => ⟨_, cast (e.3 _).symm a⟩) fun a b e =>
       (cast_inj _).1 <| eq_of_hEq (Sigma.mk.inj e).2
 #align not_small_type not_small_type
 -/
Diff
@@ -99,7 +99,7 @@ theorem small_type : Small.{max (u + 1) v} (Type u) :=
 
 section
 
-open Classical
+open scoped Classical
 
 theorem small_congr {α : Type _} {β : Type _} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
   ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
Diff
@@ -67,12 +67,6 @@ instance (priority := 100) small_self (α : Type v) : Small.{v} α :=
 #align small_self small_self
 -/
 
-/- warning: small_map -> small_map is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u2}} {β : Type.{u3}} [hβ : Small.{u1, u3} β], (Equiv.{succ u2, succ u3} α β) -> (Small.{u1, u2} α)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [hβ : Small.{u3, u1} β], (Equiv.{succ u2, succ u1} α β) -> (Small.{u3, u2} α)
-Case conversion may be inaccurate. Consider using '#align small_map small_mapₓ'. -/
 theorem small_map {α : Type _} {β : Type _} [hβ : Small.{w} β] (e : α ≃ β) : Small.{w} α :=
   let ⟨γ, ⟨f⟩⟩ := hβ.equiv_small
   Small.mk' (e.trans f)
@@ -107,12 +101,6 @@ section
 
 open Classical
 
-/- warning: small_congr -> small_congr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u2}} {β : Type.{u3}}, (Equiv.{succ u2, succ u3} α β) -> (Iff (Small.{u1, u2} α) (Small.{u1, u3} β))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}}, (Equiv.{succ u2, succ u1} α β) -> (Iff (Small.{u3, u2} α) (Small.{u3, u1} β))
-Case conversion may be inaccurate. Consider using '#align small_congr small_congrₓ'. -/
 theorem small_congr {α : Type _} {β : Type _} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
   ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
 #align small_congr small_congr
Diff
@@ -149,8 +149,7 @@ instance (priority := 100) small_subsingleton (α : Type v) [Subsingleton α] :
   by
   rcases isEmpty_or_nonempty α with ⟨⟩ <;> skip
   · apply small_map (Equiv.equivPEmpty α)
-  · apply small_map Equiv.punitOfNonemptyOfSubsingleton
-    assumption'
+  · apply small_map Equiv.punitOfNonemptyOfSubsingleton; assumption'
 #align small_subsingleton small_subsingleton
 -/
 

Changes in mathlib4

mathlib3
mathlib4
chore(Logic): reduce use of autoImplicit (#12135)

In one case, replacing this naively errored, so I just merged the single declaration using it.

Delete two unused variables in Logic/Basic.

Diff
@@ -23,9 +23,6 @@ If `α ≃ β`, then `Small.{w} α ↔ Small.{w} β`.
 See `Mathlib.Logic.Small.Basic` for further instances and theorems.
 -/
 
-set_option autoImplicit true
-
-
 universe u w v v'
 
 /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
@@ -64,7 +61,7 @@ theorem Shrink.ext {α : Type v} [Small.{w} α] {x y : Shrink α}
 -- https://github.com/JLimperg/aesop/issues/59
 -- is resolved.
 @[eliminator]
-protected noncomputable def Shrink.rec [Small.{w} α] {F : Shrink α → Sort v}
+protected noncomputable def Shrink.rec {α : Type*} [Small.{w} α] {F : Shrink α → Sort v}
     (h : ∀ X, F (equivShrink _ X)) : ∀ X, F X :=
   fun X => ((equivShrink _).apply_symm_apply X) ▸ (h _)
 
chore(Logic): reduce use of autoImplicit (#12135)

In one case, replacing this naively errored, so I just merged the single declaration using it.

Delete two unused variables in Logic/Basic.

Diff
@@ -14,9 +14,6 @@ import Mathlib.Logic.Equiv.Set
 In particular we prove `small_of_injective` and `small_of_surjective`.
 -/
 
-set_option autoImplicit true
-
-
 universe u w v v'
 
 section
feat: remove superseded small_of_fintype (#11326)
Diff
@@ -57,8 +57,7 @@ theorem small_of_injective_of_exists {α : Type v} {β : Type w} {γ : Type v'}
     infer_instance
 
 /-!
-We don't define `small_of_fintype` or `small_of_countable` in this file,
-to keep imports to `Logic` to a minimum.
+We don't define `Countable.toSmall` in this file, to keep imports to `Logic` to a minimum.
 -/
 
 instance small_Pi {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} (β a)] :
chore: remove tactics (#11365)

More tactics that are not used, found using the linter at #11308.

The PR consists of tactic removals, whitespace changes and replacing a porting note by an explanation.

Diff
@@ -38,7 +38,7 @@ theorem small_of_surjective {α : Type v} {β : Type w} [Small.{u} α] {f : α 
 #align small_of_surjective small_of_surjective
 
 instance (priority := 100) small_subsingleton (α : Type v) [Subsingleton α] : Small.{w} α := by
-  rcases isEmpty_or_nonempty α with ⟨⟩ <;> skip
+  rcases isEmpty_or_nonempty α with ⟨⟩
   · apply small_map (Equiv.equivPEmpty α)
   · apply small_map Equiv.punitOfNonemptyOfSubsingleton
 #align small_subsingleton small_subsingleton
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -103,7 +103,7 @@ theorem small_type : Small.{max (u + 1) v} (Type u) :=
 
 section
 
-open Classical
+open scoped Classical
 
 theorem small_congr {α : Type*} {β : Type*} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
   ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -21,7 +21,7 @@ universe u w v v'
 
 section
 
-open Classical
+open scoped Classical
 
 instance small_subtype (α : Type v) [Small.{w} α] (P : α → Prop) : Small.{w} { x // P x } :=
   small_map (equivShrink α).subtypeEquivOfSubtype'
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -68,7 +68,7 @@ protected noncomputable def Shrink.rec [Small.{w} α] {F : Shrink α → Sort v}
     (h : ∀ X, F (equivShrink _ X)) : ∀ X, F X :=
   fun X => ((equivShrink _).apply_symm_apply X) ▸ (h _)
 
---Porting note: Priority changed to 101
+-- Porting note: Priority changed to 101
 instance (priority := 101) small_self (α : Type v) : Small.{v} α :=
   Small.mk' <| Equiv.refl α
 #align small_self small_self
feat: small_iUnion and small_sUnion (#10921)

Also moves the other results about Small on sets to their own file.

Diff
@@ -37,11 +37,6 @@ theorem small_of_surjective {α : Type v} {β : Type w} [Small.{u} α] {f : α 
   small_of_injective (Function.injective_surjInv hf)
 #align small_of_surjective small_of_surjective
 
-theorem small_subset {α : Type v} {s t : Set α} (hts : t ⊆ s) [Small.{u} s] : Small.{u} t :=
-  let f : t → s := fun x => ⟨x, hts x.prop⟩
-  @small_of_injective _ _ _ f fun _ _ hxy => Subtype.ext (Subtype.mk.inj hxy)
-#align small_subset small_subset
-
 instance (priority := 100) small_subsingleton (α : Type v) [Subsingleton α] : Small.{w} α := by
   rcases isEmpty_or_nonempty α with ⟨⟩ <;> skip
   · apply small_map (Equiv.equivPEmpty α)
@@ -84,14 +79,4 @@ instance small_set {α} [Small.{w} α] : Small.{w} (Set α) :=
   ⟨⟨Set (Shrink α), ⟨Equiv.Set.congr (equivShrink α)⟩⟩⟩
 #align small_set small_set
 
-instance small_range {α : Type v} {β : Type w} (f : α → β) [Small.{u} α] :
-    Small.{u} (Set.range f) :=
-  small_of_surjective Set.surjective_onto_range
-#align small_range small_range
-
-instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [Small.{u} S] :
-    Small.{u} (f '' S) :=
-  small_of_surjective Set.surjective_onto_image
-#align small_image small_image
-
 end
feat: switch to weaker UnivLE (#8556)

Switch from the strong version of UnivLE ∀ α : Type max u v, Small.{v} α to the weaker version ∀ α : Type u, Small.{v} α.

Transfer Has/Preserves/Reflects(Co)limitsOfSize from a larger size (higher universe) to a smaller size.

In a few places it's now necessary to make the type explicit (for Lean to infer the Small instance, I think).

Also prove a characterization of UnivLE and the totality of the UnivLE relation.

A pared down version of #7695.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

feat: switch to weaker UnivLE (#8556)

Switch from the strong version of UnivLE ∀ α : Type max u v, Small.{v} α to the weaker version ∀ α : Type u, Small.{v} α.

Transfer Has/Preserves/Reflects(Co)limitsOfSize from a larger size (higher universe) to a smaller size.

In a few places it's now necessary to make the type explicit (for Lean to infer the Small instance, I think).

Also prove a characterization of UnivLE and the totality of the UnivLE relation.

A pared down version of #7695.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -3,21 +3,15 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
+import Mathlib.Logic.Small.Defs
 import Mathlib.Logic.Equiv.Set
-import Mathlib.Tactic.PPWithUniv
 
 #align_import logic.small.basic from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
 
 /-!
-# Small types
+# Instances and theorems for `Small`.
 
-A type is `w`-small if there exists an equivalence to some `S : Type w`.
-
-We provide a noncomputable model `Shrink α : Type w`, and `equivShrink α : α ≃ Shrink α`.
-
-A subsingleton type is `w`-small for any `w`.
-
-If `α ≃ β`, then `Small.{w} α ↔ Small.{w} β`.
+In particular we prove `small_of_injective` and `small_of_surjective`.
 -/
 
 set_option autoImplicit true
@@ -25,80 +19,10 @@ set_option autoImplicit true
 
 universe u w v v'
 
-/-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
--/
-@[mk_iff, pp_with_univ]
-class Small (α : Type v) : Prop where
-  /-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
-  equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
-#align small Small
-
-/-- Constructor for `Small α` from an explicit witness type and equivalence.
--/
-theorem Small.mk' {α : Type v} {S : Type w} (e : α ≃ S) : Small.{w} α :=
-  ⟨⟨S, ⟨e⟩⟩⟩
-#align small.mk' Small.mk'
-
-/-- An arbitrarily chosen model in `Type w` for a `w`-small type.
--/
-def Shrink (α : Type v) [Small.{w} α] : Type w :=
-  Classical.choose (@Small.equiv_small α _)
-#align shrink Shrink
-
-/-- The noncomputable equivalence between a `w`-small type and a model.
--/
-noncomputable def equivShrink (α : Type v) [Small.{w} α] : α ≃ Shrink α :=
-  Nonempty.some (Classical.choose_spec (@Small.equiv_small α _))
-#align equiv_shrink equivShrink
-
-@[ext]
-theorem Shrink.ext {α : Type v} [Small.{w} α] {x y : Shrink α}
-    (w : (equivShrink _).symm x = (equivShrink _).symm y) : x = y := by
-  simpa using w
-
--- It would be nice to mark this as `aesop cases` if
--- https://github.com/JLimperg/aesop/issues/59
--- is resolved.
-@[eliminator]
-protected noncomputable def Shrink.rec [Small.{w} α] {F : Shrink α → Sort v}
-    (h : ∀ X, F (equivShrink _ X)) : ∀ X, F X :=
-  fun X => ((equivShrink _).apply_symm_apply X) ▸ (h _)
-
---Porting note: Priority changed to 101
-instance (priority := 101) small_self (α : Type v) : Small.{v} α :=
-  Small.mk' <| Equiv.refl α
-#align small_self small_self
-
-theorem small_map {α : Type*} {β : Type*} [hβ : Small.{w} β] (e : α ≃ β) : Small.{w} α :=
-  let ⟨_, ⟨f⟩⟩ := hβ.equiv_small
-  Small.mk' (e.trans f)
-#align small_map small_map
-
-theorem small_lift (α : Type u) [hα : Small.{v} α] : Small.{max v w} α :=
-  let ⟨⟨_, ⟨f⟩⟩⟩ := hα
-  Small.mk' <| f.trans (Equiv.ulift.{w}).symm
-#align small_lift small_lift
-
-instance (priority := 100) small_max (α : Type v) : Small.{max w v} α :=
-  small_lift.{v, w} α
-#align small_max small_max
-
-instance small_ulift (α : Type u) [Small.{v} α] : Small.{v} (ULift.{w} α) :=
-  small_map Equiv.ulift
-#align small_ulift small_ulift
-
-theorem small_type : Small.{max (u + 1) v} (Type u) :=
-  small_max.{max (u + 1) v} _
-#align small_type small_type
-
 section
 
 open Classical
 
-theorem small_congr {α : Type*} {β : Type*} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
-  ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
-#align small_congr small_congr
-
 instance small_subtype (α : Type v) [Small.{w} α] (P : α → Prop) : Small.{w} { x // P x } :=
   small_map (equivShrink α).subtypeEquivOfSubtype'
 #align small_subtype small_subtype
@@ -139,22 +63,15 @@ theorem small_of_injective_of_exists {α : Type v} {β : Type w} {γ : Type v'}
 
 /-!
 We don't define `small_of_fintype` or `small_of_countable` in this file,
-to keep imports to `logic` to a minimum.
+to keep imports to `Logic` to a minimum.
 -/
 
-
 instance small_Pi {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} (β a)] :
     Small.{w} (∀ a, β a) :=
   ⟨⟨∀ a' : Shrink α, Shrink (β ((equivShrink α).symm a')),
       ⟨Equiv.piCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩
 #align small_Pi small_Pi
 
-instance small_sigma {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} (β a)] :
-    Small.{w} (Σa, β a) :=
-  ⟨⟨Σa' : Shrink α, Shrink (β ((equivShrink α).symm a')),
-      ⟨Equiv.sigmaCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩
-#align small_sigma small_sigma
-
 instance small_prod {α β} [Small.{w} α] [Small.{w} β] : Small.{w} (α × β) :=
   ⟨⟨Shrink α × Shrink β, ⟨Equiv.prodCongr (equivShrink α) (equivShrink β)⟩⟩⟩
 #align small_prod small_prod
@@ -177,12 +94,4 @@ instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [S
   small_of_surjective Set.surjective_onto_image
 #align small_image small_image
 
-theorem not_small_type : ¬Small.{u} (Type max u v)
-  | ⟨⟨S, ⟨e⟩⟩⟩ =>
-    @Function.cantor_injective (Σα, e.symm α) (fun a => ⟨_, cast (e.3 _).symm a⟩) fun a b e => by
-      dsimp at e
-      injection e with h₁ h₂
-      simpa using h₂
-#align not_small_type not_small_type
-
 end
feat: a functor from a small category to a filtered category factors through a small filtered category (#6212)
Diff
@@ -23,7 +23,7 @@ If `α ≃ β`, then `Small.{w} α ↔ Small.{w} β`.
 set_option autoImplicit true
 
 
-universe u w v
+universe u w v v'
 
 /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
 -/
@@ -124,6 +124,19 @@ instance (priority := 100) small_subsingleton (α : Type v) [Subsingleton α] :
   · apply small_map Equiv.punitOfNonemptyOfSubsingleton
 #align small_subsingleton small_subsingleton
 
+/-- This can be seen as a version of `small_of_surjective` in which the function `f` doesn't
+    actually land in `β` but in some larger type `γ` related to `β` via an injective function `g`.
+    -/
+theorem small_of_injective_of_exists {α : Type v} {β : Type w} {γ : Type v'} [Small.{u} α]
+    (f : α → γ) {g : β → γ} (hg : Function.Injective g) (h : ∀ b : β, ∃ a : α, f a = g b) :
+    Small.{u} β := by
+  by_cases hβ : Nonempty β
+  · refine' small_of_surjective (f := Function.invFun g ∘ f) (fun b => _)
+    obtain ⟨a, ha⟩ := h b
+    exact ⟨a, by rw [Function.comp_apply, ha, Function.leftInverse_invFun hg]⟩
+  · simp only [not_nonempty_iff] at hβ
+    infer_instance
+
 /-!
 We don't define `small_of_fintype` or `small_of_countable` in this file,
 to keep imports to `logic` to a minimum.
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -20,6 +20,8 @@ A subsingleton type is `w`-small for any `w`.
 If `α ≃ β`, then `Small.{w} α ↔ Small.{w} β`.
 -/
 
+set_option autoImplicit true
+
 
 universe u w v
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -67,7 +67,7 @@ instance (priority := 101) small_self (α : Type v) : Small.{v} α :=
   Small.mk' <| Equiv.refl α
 #align small_self small_self
 
-theorem small_map {α : Type _} {β : Type _} [hβ : Small.{w} β] (e : α ≃ β) : Small.{w} α :=
+theorem small_map {α : Type*} {β : Type*} [hβ : Small.{w} β] (e : α ≃ β) : Small.{w} α :=
   let ⟨_, ⟨f⟩⟩ := hβ.equiv_small
   Small.mk' (e.trans f)
 #align small_map small_map
@@ -93,7 +93,7 @@ section
 
 open Classical
 
-theorem small_congr {α : Type _} {β : Type _} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
+theorem small_congr {α : Type*} {β : Type*} (e : α ≃ β) : Small.{w} α ↔ Small.{w} β :=
   ⟨fun h => @small_map _ _ h e.symm, fun h => @small_map _ _ h e⟩
 #align small_congr small_congr
 
@@ -128,13 +128,13 @@ to keep imports to `logic` to a minimum.
 -/
 
 
-instance small_Pi {α} (β : α → Type _) [Small.{w} α] [∀ a, Small.{w} (β a)] :
+instance small_Pi {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} (β a)] :
     Small.{w} (∀ a, β a) :=
   ⟨⟨∀ a' : Shrink α, Shrink (β ((equivShrink α).symm a')),
       ⟨Equiv.piCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩
 #align small_Pi small_Pi
 
-instance small_sigma {α} (β : α → Type _) [Small.{w} α] [∀ a, Small.{w} (β a)] :
+instance small_sigma {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} (β a)] :
     Small.{w} (Σa, β a) :=
   ⟨⟨Σa' : Shrink α, Shrink (β ((equivShrink α).symm a')),
       ⟨Equiv.sigmaCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module logic.small.basic
-! leanprover-community/mathlib commit d012cd09a9b256d870751284dd6a29882b0be105
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Logic.Equiv.Set
 import Mathlib.Tactic.PPWithUniv
 
+#align_import logic.small.basic from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
+
 /-!
 # Small types
 
feat: using UnivLE in constructing limits in Type (#5724)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Apurva <apurvnakade@gmail.com> Co-authored-by: Jon Eugster <eugster.jon@gmail.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -52,6 +52,11 @@ noncomputable def equivShrink (α : Type v) [Small.{w} α] : α ≃ Shrink α :=
   Nonempty.some (Classical.choose_spec (@Small.equiv_small α _))
 #align equiv_shrink equivShrink
 
+@[ext]
+theorem Shrink.ext {α : Type v} [Small.{w} α] {x y : Shrink α}
+    (w : (equivShrink _).symm x = (equivShrink _).symm y) : x = y := by
+  simpa using w
+
 -- It would be nice to mark this as `aesop cases` if
 -- https://github.com/JLimperg/aesop/issues/59
 -- is resolved.
refactor: make pp_with_univ be an attribute (#5633)
Diff
@@ -28,13 +28,12 @@ universe u w v
 
 /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
 -/
-@[mk_iff] class Small (α : Type v) : Prop where
+@[mk_iff, pp_with_univ]
+class Small (α : Type v) : Prop where
   /-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
   equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
 #align small Small
 
-pp_with_univ Small
-
 /-- Constructor for `Small α` from an explicit witness type and equivalence.
 -/
 theorem Small.mk' {α : Type v} {S : Type w} (e : α ≃ S) : Small.{w} α :=
feat: ¬ UnivLE.{u+1, u} (#5739)

Thanks to @kmill on zulip.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -28,7 +28,7 @@ universe u w v
 
 /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
 -/
-class Small (α : Type v) : Prop where
+@[mk_iff] class Small (α : Type v) : Prop where
   /-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
   equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
 #align small Small
feat: use pp_with_univ (#5622)

Certain definitions do nothing except change universes. We might as well have the pretty printer always show us these universes!

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -9,6 +9,7 @@ Authors: Scott Morrison
 ! if you have ported upstream changes.
 -/
 import Mathlib.Logic.Equiv.Set
+import Mathlib.Tactic.PPWithUniv
 
 /-!
 # Small types
@@ -32,6 +33,8 @@ class Small (α : Type v) : Prop where
   equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
 #align small Small
 
+pp_with_univ Small
+
 /-- Constructor for `Small α` from an explicit witness type and equivalence.
 -/
 theorem Small.mk' {α : Type v} {S : Type w} (e : α ≃ S) : Small.{w} α :=
feat: API around Small (#5645)

@fpvandoorn, could you help me with the to_additive problem here?

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -50,6 +50,14 @@ noncomputable def equivShrink (α : Type v) [Small.{w} α] : α ≃ Shrink α :=
   Nonempty.some (Classical.choose_spec (@Small.equiv_small α _))
 #align equiv_shrink equivShrink
 
+-- It would be nice to mark this as `aesop cases` if
+-- https://github.com/JLimperg/aesop/issues/59
+-- is resolved.
+@[eliminator]
+protected noncomputable def Shrink.rec [Small.{w} α] {F : Shrink α → Sort v}
+    (h : ∀ X, F (equivShrink _ X)) : ∀ X, F X :=
+  fun X => ((equivShrink _).apply_symm_apply X) ▸ (h _)
+
 --Porting note: Priority changed to 101
 instance (priority := 101) small_self (α : Type v) : Small.{v} α :=
   Small.mk' <| Equiv.refl α
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -28,7 +28,7 @@ universe u w v
 /-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
 -/
 class Small (α : Type v) : Prop where
-/-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
+  /-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
   equiv_small : ∃ S : Type w, Nonempty (α ≃ S)
 #align small Small
 
feat port: Logic.Small.Basic (#1079)

d012cd09

Dependencies 40

41 files ported (100.0%)
23548 lines ported (100.0%)

All dependencies are ported!