Skip to content

Commit 1327df0

Browse files
committed
chore: smile more often (#20436)
This replaces `: _)` with the shorter and otherwise *almost* identical `:)`. The former is a Lean 3 ism; or at least, the latter is new syntax in Lean 4. More precisely (thanks @kmill): - `(e : _)` elaborates `e` without an expected type, and then it inserts a coercion if the type of `e` does not match the expected type. - `(e :)` elaborates `e` without an expected type *to completion*, and then it inserts a coercion if the type of `e` does not match the expected type. A few places break when switched to `:)`; in many of these cases, the `: _)`/`:)` can just be dropped entirely. The remainder are left as is.
1 parent 57f8888 commit 1327df0

File tree

216 files changed

+368
-368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+368
-368
lines changed

Archive/Sensitivity.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ open Classical in
368368
subspace of `V (m+1)` spanned by the corresponding basis vectors non-trivially
369369
intersects the range of `g m`. -/
370370
theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
371-
∃ y ∈ Span (e '' H) ⊓ range (g m), y ≠ (0 : _) := by
371+
∃ y ∈ Span (e '' H) ⊓ range (g m), y ≠ 0 := by
372372
let W := Span (e '' H)
373373
let img := range (g m)
374374
suffices 0 < dim (W ⊓ img) by
@@ -408,7 +408,7 @@ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
408408
rw [Finsupp.mem_support_iff] at p_in
409409
rw [Set.mem_toFinset]
410410
exact (dualBases_e_ε _).mem_of_mem_span y_mem_H p p_in
411-
obtain ⟨q, H_max⟩ : ∃ q : Q m.succ, ∀ q' : Q m.succ, |(ε q' : _) y| ≤ |ε q y| :=
411+
obtain ⟨q, H_max⟩ : ∃ q : Q m.succ, ∀ q' : Q m.succ, |(ε q' :) y| ≤ |ε q y| :=
412412
Finite.exists_max _
413413
have H_q_pos : 0 < |ε q y| := by
414414
contrapose! y_ne

Counterexamples/Girard.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ theorem girard.{u} (pi : (Type u → Type u) → Type u)
4141
let τ (T : Set (Set U)) : U := lam (G T)
4242
let σ (S : U) : Set (Set U) := app S U τ
4343
have στ : ∀ {s S}, s ∈ σ (τ S) ↔ {x | τ (σ x) ∈ s} ∈ S := fun {s S} =>
44-
iff_of_eq (congr_arg (fun f : F U => s ∈ f τ) (beta (G S) U) : _)
44+
iff_of_eq (congr_arg (fun f : F U => s ∈ f τ) (beta (G S) U) :)
4545
let ω : Set (Set U) := {p | ∀ x, p ∈ σ x → x ∈ p}
4646
let δ (S : Set (Set U)) := ∀ p, p ∈ S → τ S ∈ p
4747
have : δ ω := fun _p d => d (τ ω) <| στ.2 fun x h => d (τ (σ x)) (στ.2 h)

Mathlib/Algebra/Algebra/NonUnitalHom.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ lemma coe_restrictScalars' (f : A →ₙₐ[S] B) : (f.restrictScalars R : A →
474474

475475
theorem restrictScalars_injective :
476476
Function.Injective (restrictScalars R : (A →ₙₐ[S] B) → A →ₙₐ[R] B) :=
477-
fun _ _ h ↦ ext (congr_fun h : _)
477+
fun _ _ h ↦ ext (congr_fun h :)
478478

479479
end NonUnitalAlgHom
480480

Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ theorem coe_codRestrict (f : F) (S : NonUnitalSubalgebra R B) (hf : ∀ x, f x
467467

468468
theorem injective_codRestrict (f : F) (S : NonUnitalSubalgebra R B) (hf : ∀ x : A, f x ∈ S) :
469469
Function.Injective (NonUnitalAlgHom.codRestrict f S hf) ↔ Function.Injective f :=
470-
fun H _x _y hxy => H <| Subtype.eq hxy, fun H _x _y hxy => H (congr_arg Subtype.val hxy : _)⟩
470+
fun H _x _y hxy => H <| Subtype.eq hxy, fun H _x _y hxy => H (congr_arg Subtype.val hxy :)⟩
471471

472472
/-- Restrict the codomain of an `NonUnitalAlgHom` `f` to `f.range`.
473473

Mathlib/Algebra/Algebra/RestrictScalars.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ instance RestrictScalars.opModule [Module Sᵐᵒᵖ M] : Module Rᵐᵒᵖ (Res
124124

125125
instance RestrictScalars.isCentralScalar [Module S M] [Module Sᵐᵒᵖ M] [IsCentralScalar S M] :
126126
IsCentralScalar R (RestrictScalars R S M) where
127-
op_smul_eq_smul r _x := (op_smul_eq_smul (algebraMap R S r) (_ : M) : _)
127+
op_smul_eq_smul r _x := (op_smul_eq_smul (algebraMap R S r) (_ : M) :)
128128

129129
/-- The `R`-algebra homomorphism from the original coefficient algebra `S` to endomorphisms
130130
of `RestrictScalars R S M`.

Mathlib/Algebra/Algebra/Subalgebra/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ theorem coe_codRestrict (f : A →ₐ[R] B) (S : Subalgebra R B) (hf : ∀ x, f
520520

521521
theorem injective_codRestrict (f : A →ₐ[R] B) (S : Subalgebra R B) (hf : ∀ x, f x ∈ S) :
522522
Function.Injective (f.codRestrict S hf) ↔ Function.Injective f :=
523-
fun H _x _y hxy => H <| Subtype.eq hxy, fun H _x _y hxy => H (congr_arg Subtype.val hxy : _)⟩
523+
fun H _x _y hxy => H <| Subtype.eq hxy, fun H _x _y hxy => H (congr_arg Subtype.val hxy :)⟩
524524

525525
/-- Restrict the codomain of an `AlgHom` `f` to `f.range`.
526526
@@ -819,7 +819,7 @@ noncomputable def botEquivOfInjective (h : Function.Injective (algebraMap R A))
819819
(⊥ : Subalgebra R A) ≃ₐ[R] R :=
820820
AlgEquiv.symm <|
821821
AlgEquiv.ofBijective (Algebra.ofId R _)
822-
fun _x _y hxy => h (congr_arg Subtype.val hxy : _), fun ⟨_y, x, hx⟩ => ⟨x, Subtype.eq hx⟩⟩
822+
fun _x _y hxy => h (congr_arg Subtype.val hxy :), fun ⟨_y, x, hx⟩ => ⟨x, Subtype.eq hx⟩⟩
823823

824824
/-- The bottom subalgebra is isomorphic to the field. -/
825825
@[simps! symm_apply]
@@ -995,7 +995,7 @@ instance isScalarTower_left [SMul α β] [SMul A α] [SMul A β] [IsScalarTower
995995
instance isScalarTower_mid {R S T : Type*} [CommSemiring R] [Semiring S] [AddCommMonoid T]
996996
[Algebra R S] [Module R T] [Module S T] [IsScalarTower R S T] (S' : Subalgebra R S) :
997997
IsScalarTower R S' T :=
998-
fun _x y _z => (smul_assoc _ (y : S) _ : _)
998+
fun _x y _z => smul_assoc _ (y : S) _⟩
999999

10001000
instance [SMul A α] [FaithfulSMul A α] (S : Subalgebra R A) : FaithfulSMul S α :=
10011001
inferInstanceAs (FaithfulSMul S.toSubsemiring α)

Mathlib/Algebra/Algebra/Subalgebra/Tower.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ variable [Algebra R A] [IsScalarTower R S A]
5858

5959
instance subalgebra' (S₀ : Subalgebra R S) : IsScalarTower R S₀ A :=
6060
@IsScalarTower.of_algebraMap_eq R S₀ A _ _ _ _ _ _ fun _ ↦
61-
(IsScalarTower.algebraMap_apply R S A _ : _)
61+
(IsScalarTower.algebraMap_apply R S A _ :)
6262

6363
end Semiring
6464

Mathlib/Algebra/Algebra/Tower.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ theorem coe_restrictScalars' (f : A →ₐ[S] B) : (restrictScalars R f : A →
200200

201201
theorem restrictScalars_injective :
202202
Function.Injective (restrictScalars R : (A →ₐ[S] B) → A →ₐ[R] B) := fun _ _ h =>
203-
AlgHom.ext (AlgHom.congr_fun h : _)
203+
AlgHom.ext (AlgHom.congr_fun h :)
204204

205205
end AlgHom
206206

@@ -223,7 +223,7 @@ theorem coe_restrictScalars' (f : A ≃ₐ[S] B) : (restrictScalars R f : A →
223223

224224
theorem restrictScalars_injective :
225225
Function.Injective (restrictScalars R : (A ≃ₐ[S] B) → A ≃ₐ[R] B) := fun _ _ h =>
226-
AlgEquiv.ext (AlgEquiv.congr_fun h : _)
226+
AlgEquiv.ext (AlgEquiv.congr_fun h :)
227227

228228
end AlgEquiv
229229

Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ variable {M₁ M₂ M₃ M₄}
6363

6464
@[simp]
6565
lemma tensorObj_map_tmul {X Y : Cᵒᵖ} (f : X ⟶ Y) (m₁ : M₁.obj X) (m₂ : M₂.obj X) :
66-
DFunLike.coe (α := (M₁.obj X ⊗ M₂.obj X : _))
66+
DFunLike.coe (α := (M₁.obj X ⊗ M₂.obj X :))
6767
(β := fun _ ↦ (ModuleCat.restrictScalars (R.map f).hom).obj (M₁.obj Y ⊗ M₂.obj Y))
6868
((tensorObj M₁ M₂).map f).hom (m₁ ⊗ₜ[R.obj X] m₂) = M₁.map f m₁ ⊗ₜ[R.obj Y] M₂.map f m₂ := rfl
6969

Mathlib/Algebra/Category/Ring/Constructions.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def equalizerFork : Fork f g :=
283283
def equalizerForkIsLimit : IsLimit (equalizerFork f g) := by
284284
fapply Fork.IsLimit.mk'
285285
intro s
286-
use ofHom <| s.ι.hom.codRestrict _ fun x => (ConcreteCategory.congr_hom s.condition x : _)
286+
use ofHom <| s.ι.hom.codRestrict _ fun x => (ConcreteCategory.congr_hom s.condition x :)
287287
constructor
288288
· ext
289289
rfl
@@ -327,7 +327,7 @@ instance equalizer_ι_is_local_ring_hom' (F : WalkingParallelPairᵒᵖ ⥤ Comm
327327
have : _ = limit.π F (walkingParallelPairOpEquiv.functor.obj _) :=
328328
(limit.isoLimitCone_inv_π
329329
⟨_, IsLimit.whiskerEquivalence (limit.isLimit F) walkingParallelPairOpEquiv⟩
330-
WalkingParallelPair.zero : _)
330+
WalkingParallelPair.zero :)
331331
erw [← this]
332332
-- note: this was not needed before https://github.com/leanprover-community/mathlib4/pull/19757
333333
haveI : IsLocalHom (limit.π (walkingParallelPairOpEquiv.functor ⋙ F) zero).hom := by
@@ -370,8 +370,8 @@ def pullbackConeIsLimit {A B C : CommRingCat.{u}} (f : A ⟶ C) (g : B ⟶ C) :
370370
· intro s m e₁ e₂
371371
refine hom_ext <| RingHom.ext fun (x : s.pt) => Subtype.ext ?_
372372
change (m x).1 = (_, _)
373-
have eq1 := (congr_arg (fun f : s.pt →+* A => f x) (congrArg Hom.hom e₁) : _)
374-
have eq2 := (congr_arg (fun f : s.pt →+* B => f x) (congrArg Hom.hom e₂) : _)
373+
have eq1 := (congr_arg (fun f : s.pt →+* A => f x) (congrArg Hom.hom e₁) :)
374+
have eq2 := (congr_arg (fun f : s.pt →+* B => f x) (congrArg Hom.hom e₂) :)
375375
rw [← eq1, ← eq2]
376376
rfl
377377

0 commit comments

Comments
 (0)