Skip to content

Commit

Permalink
refactor: decapitalize names in @[mk_iff] (#9378)
Browse files Browse the repository at this point in the history
* `@[mk_iff] class MyPred` now generates `myPred_iff`, not `MyPred_iff`
* add `Lean.Name.decapitalize`
* fix indentation and a few typos in the docs/comments.

Partially addresses issue #9129
  • Loading branch information
urkud committed Jan 1, 2024
1 parent 4ae4613 commit 5192777
Show file tree
Hide file tree
Showing 38 changed files with 135 additions and 136 deletions.
2 changes: 1 addition & 1 deletion Archive/Imo/Imo1981Q3.lean
Expand Up @@ -207,5 +207,5 @@ theorem imo1981_q3 : IsGreatest (specifiedSet 1981) 3524578 := by
apply this
· decide
· decide
· norm_num [ProblemPredicate_iff]; decide
· norm_num [problemPredicate_iff]; decide
#align imo1981_q3 imo1981_q3
2 changes: 1 addition & 1 deletion Mathlib/Algebra/CharP/Basic.lean
Expand Up @@ -103,7 +103,7 @@ For instance, endowing `{0, 1}` with addition given by `max` (i.e. `1` is absorb
`CharZero {0, 1}` does not hold and yet `CharP {0, 1} 0` does.
This example is formalized in `Counterexamples/CharPZeroNeCharZero.lean`.
-/
@[mk_iff charP_iff]
@[mk_iff]
class CharP [AddMonoidWithOne R] (p : ℕ) : Prop where
cast_eq_zero_iff' : ∀ x : ℕ, (x : R) = 0 ↔ p ∣ x
#align char_p CharP
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean
Expand Up @@ -43,7 +43,7 @@ class LocallyOfFiniteType (f : X ⟶ Y) : Prop where

theorem locallyOfFiniteType_eq : @LocallyOfFiniteType = affineLocally @RingHom.FiniteType := by
ext X Y f
rw [LocallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
rw [locallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
exact RingHom.finiteType_respectsIso
#align algebraic_geometry.locally_of_finite_type_eq AlgebraicGeometry.locallyOfFiniteType_eq

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean
Expand Up @@ -96,7 +96,7 @@ theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set
theorem quasiCompact_iff_forall_affine :
QuasiCompact f ↔
∀ U : Opens Y.carrier, IsAffineOpen U → IsCompact (f.1.base ⁻¹' (U : Set Y.carrier)) := by
rw [QuasiCompact_iff]
rw [quasiCompact_iff]
refine' ⟨fun H U hU => H U U.isOpen hU.isCompact, _⟩
intro H U hU hU'
obtain ⟨S, hS, rfl⟩ := (isCompact_open_iff_eq_finset_affine_union U).mp ⟨hU', hU⟩
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean
Expand Up @@ -56,7 +56,7 @@ def QuasiSeparated.affineProperty : AffineTargetMorphismProperty := fun X _ _ _

theorem quasiSeparatedSpace_iff_affine (X : Scheme) :
QuasiSeparatedSpace X.carrier ↔ ∀ U V : X.affineOpens, IsCompact (U ∩ V : Set X.carrier) := by
rw [QuasiSeparatedSpace_iff]
rw [quasiSeparatedSpace_iff]
constructor
· intro H U V; exact H U V U.1.2 U.2.isCompact V.1.2 V.2.isCompact
· intro H
Expand Down Expand Up @@ -115,7 +115,7 @@ theorem quasi_compact_affineProperty_iff_quasiSeparatedSpace {X Y : Scheme} [IsA
#align algebraic_geometry.quasi_compact_affine_property_iff_quasi_separated_space AlgebraicGeometry.quasi_compact_affineProperty_iff_quasiSeparatedSpace

theorem quasiSeparated_eq_diagonal_is_quasiCompact :
@QuasiSeparated = MorphismProperty.diagonal @QuasiCompact := by ext; exact QuasiSeparated_iff _
@QuasiSeparated = MorphismProperty.diagonal @QuasiCompact := by ext; exact quasiSeparated_iff _
#align algebraic_geometry.quasi_separated_eq_diagonal_is_quasi_compact AlgebraicGeometry.quasiSeparated_eq_diagonal_is_quasiCompact

theorem quasi_compact_affineProperty_diagonal_eq :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean
Expand Up @@ -43,7 +43,7 @@ class UniversallyClosed (f : X ⟶ Y) : Prop where
#align algebraic_geometry.universally_closed AlgebraicGeometry.UniversallyClosed

theorem universallyClosed_eq : @UniversallyClosed = universally (topologically @IsClosedMap) := by
ext X Y f; rw [UniversallyClosed_iff]
ext X Y f; rw [universallyClosed_iff]
#align algebraic_geometry.universally_closed_eq AlgebraicGeometry.universallyClosed_eq

theorem universallyClosed_respectsIso : RespectsIso @UniversallyClosed :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Calculus/TangentCone.lean
Expand Up @@ -56,7 +56,7 @@ The main role of this property is to ensure that the differential within `s` at
hence this name. The uniqueness it asserts is proved in `UniqueDiffWithinAt.eq` in `Fderiv.Basic`.
To avoid pathologies in dimension 0, we also require that `x` belongs to the closure of `s` (which
is automatic when `E` is not `0`-dimensional). -/
@[mk_iff uniqueDiffWithinAt_iff]
@[mk_iff]
structure UniqueDiffWithinAt (s : Set E) (x : E) : Prop where
dense_tangentCone : Dense (Submodule.span 𝕜 (tangentConeAt 𝕜 s x) : Set E)
mem_closure : x ∈ closure s
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Acyclic.lean
Expand Up @@ -134,7 +134,7 @@ theorem isAcyclic_iff_path_unique : G.IsAcyclic ↔ ∀ ⦃v w : V⦄ (p q : G.P
theorem isTree_iff_existsUnique_path :
G.IsTree ↔ Nonempty V ∧ ∀ v w : V, ∃! p : G.Walk v w, p.IsPath := by
classical
rw [IsTree_iff, isAcyclic_iff_path_unique]
rw [isTree_iff, isAcyclic_iff_path_unique]
constructor
· rintro ⟨hc, hu⟩
refine ⟨hc.nonempty, ?_⟩
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Connectivity.lean
Expand Up @@ -2037,7 +2037,7 @@ This follows the convention observed by mathlib that something is connected iff
exactly one connected component.
There is a `CoeFun` instance so that `h u v` can be used instead of `h.Preconnected u v`. -/
@[mk_iff connected_iff]
@[mk_iff]
structure Connected : Prop where
protected preconnected : G.Preconnected
protected [nonempty : Nonempty V]
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Data/Multiset/Basic.lean
Expand Up @@ -2744,7 +2744,7 @@ inductive Rel (r : α → β → Prop) : Multiset α → Multiset β → Prop
| zero : Rel r 0 0
| cons {a b as bs} : r a b → Rel r as bs → Rel r (a ::ₘ as) (b ::ₘ bs)
#align multiset.rel Multiset.Rel
#align multiset.rel_iff Multiset.Rel_iff
#align multiset.rel_iff Multiset.rel_iff

variable {δ : Type*} {r : α → β → Prop} {p : γ → δ → Prop}

Expand Down Expand Up @@ -2796,11 +2796,11 @@ theorem rel_flip_eq {s t : Multiset α} : Rel (fun a b => b = a) s t ↔ s = t :
#align multiset.rel_flip_eq Multiset.rel_flip_eq

@[simp]
theorem rel_zero_left {b : Multiset β} : Rel r 0 b ↔ b = 0 := by rw [Rel_iff]; simp
theorem rel_zero_left {b : Multiset β} : Rel r 0 b ↔ b = 0 := by rw [rel_iff]; simp
#align multiset.rel_zero_left Multiset.rel_zero_left

@[simp]
theorem rel_zero_right {a : Multiset α} : Rel r a 0 ↔ a = 0 := by rw [Rel_iff]; simp
theorem rel_zero_right {a : Multiset α} : Rel r a 0 ↔ a = 0 := by rw [rel_iff]; simp
#align multiset.rel_zero_right Multiset.rel_zero_right

theorem rel_cons_left {a as bs} :
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/GroupTheory/Subsemigroup/Center.lean
Expand Up @@ -56,9 +56,7 @@ structure IsMulCentral [Mul M] (z : M) : Prop where
/-- associative property for right multiplication -/
right_assoc (a b : M) : (a * b) * z = a * (b * z)

-- TODO: these should have explicit arguments (mathlib4#9129)
attribute [mk_iff isMulCentral_iff] IsMulCentral
attribute [mk_iff isAddCentral_iff] IsAddCentral
attribute [mk_iff] IsMulCentral IsAddCentral
attribute [to_additive existing] isMulCentral_iff

namespace IsMulCentral
Expand Down
6 changes: 6 additions & 0 deletions Mathlib/Lean/Name.lean
Expand Up @@ -55,3 +55,9 @@ def getModule (name : Name) (s := "") : Name :=
| .anonymous => s
| .num _ _ => panic s!"panic in `getModule`: did not expect numerical name: {name}."
| .str pre s => getModule pre s

/-- Decapitalize the last component of a name. -/
def Lean.Name.decapitalize (n : Name) : Name :=
n.modifyBase fun
| .str p s => .str p s.decapitalize
| n => n
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Dimension/DivisionRing.lean
Expand Up @@ -302,7 +302,7 @@ theorem rank_submodule_le_one_iff' (s : Submodule K V) :

theorem Submodule.rank_le_one_iff_isPrincipal (W : Submodule K V) :
Module.rank K W ≤ 1 ↔ W.IsPrincipal := by
simp only [rank_le_one_iff, Submodule.IsPrincipal_iff, le_antisymm_iff, le_span_singleton_iff,
simp only [rank_le_one_iff, Submodule.isPrincipal_iff, le_antisymm_iff, le_span_singleton_iff,
span_singleton_le_iff_mem]
constructor
· rintro ⟨⟨m, hm⟩, hm'⟩
Expand Down
5 changes: 2 additions & 3 deletions Mathlib/Logic/Relation.lean
Expand Up @@ -256,16 +256,15 @@ inductive ReflTransGen (r : α → α → Prop) (a : α) : α → Prop
attribute [refl] ReflTransGen.refl

/-- `ReflGen r`: reflexive closure of `r` -/
@[mk_iff reflGen_iff]
@[mk_iff]
inductive ReflGen (r : α → α → Prop) (a : α) : α → Prop
| refl : ReflGen r a a
| single {b} : r a b → ReflGen r a b
#align relation.refl_gen Relation.ReflGen

#align relation.refl_gen_iff Relation.reflGen_iff

/-- `TransGen r`: transitive closure of `r` -/
@[mk_iff transGen_iff]
@[mk_iff]
inductive TransGen (r : α → α → Prop) (a : α) : α → Prop
| single {b} : r a b → TransGen r a b
| tail {b c} : TransGen r a b → r b c → TransGen r a c
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Logic/UnivLE.lean
Expand Up @@ -59,5 +59,5 @@ instance univLE_of_max [UnivLE.{max u v, v}] : UnivLE.{u, v} := @UnivLE.trans un
-- example (α : Type u) (β : Type v) [UnivLE.{u, v}] : Small.{v} (α → β) := inferInstance

example : ¬ UnivLE.{u+1, u} := by
simp only [Small_iff, not_forall, not_exists, not_nonempty_iff]
simp only [small_iff, not_forall, not_exists, not_nonempty_iff]
exact ⟨Type u, fun α => ⟨fun f => Function.not_surjective_Type.{u, u} f.symm f.symm.surjective⟩⟩
22 changes: 11 additions & 11 deletions Mathlib/NumberTheory/Cyclotomic/Basic.lean
Expand Up @@ -103,18 +103,18 @@ theorem iff_adjoin_eq_top :
theorem iff_singleton :
IsCyclotomicExtension {n} A B ↔
(∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} :=
by simp [IsCyclotomicExtension_iff]
by simp [isCyclotomicExtension_iff]
#align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton

/-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/
theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by
simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h
simpa [Algebra.eq_top_iff, isCyclotomicExtension_iff] using h
#align is_cyclotomic_extension.empty IsCyclotomicExtension.empty

/-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/
theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ :=
Algebra.eq_top_iff.2 fun x => by
simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x
simpa [adjoin_singleton_one] using ((isCyclotomicExtension_iff _ _ _).1 h).2 x
#align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one

variable {A B}
Expand All @@ -137,16 +137,16 @@ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTow
(h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by
refine' ⟨fun hn => _, fun x => _⟩
· cases' hn with hn hn
· obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn
· obtain ⟨b, hb⟩ := ((isCyclotomicExtension_iff _ _ _).1 hS).1 hn
refine' ⟨algebraMap B C b, _⟩
exact hb.map_of_injective h
· exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn
· refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x)
· exact ((isCyclotomicExtension_iff _ _ _).1 hT).1 hn
· refine' adjoin_induction (((isCyclotomicExtension_iff T B _).1 hT).2 x)
(fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _)
(fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy
· let f := IsScalarTower.toAlgHom A B C
have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f :=
⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩
⟨b, ((isCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩
rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb
refine' adjoin_mono (fun y hy => _) hb
obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy
Expand Down Expand Up @@ -185,8 +185,8 @@ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] :
· rintro x (⟨n, hn⟩ | ⟨n, hn⟩)
· exact ⟨n, Or.inl hn.1, hn.2
· exact ⟨n, Or.inr hn.1, hn.2
refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩
replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b
refine' ⟨fun hn => ((isCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩
replace h := ((isCyclotomicExtension_iff _ _ _).1 h).2 b
rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h
#align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right

Expand All @@ -196,7 +196,7 @@ given by roots of unity of order in `S`. -/
theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) :
IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by
refine' ⟨@fun n hn => _, fun b => _⟩
· obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn)
· obtain ⟨b, hb⟩ := ((isCyclotomicExtension_iff _ _ _).1 h).1 (hS hn)
refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩
rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk]
· convert mem_top (R := A) (x := b)
Expand Down Expand Up @@ -443,7 +443,7 @@ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) :
Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by
rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow,
Polynomial.map_X]
obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS
obtain ⟨z, hz⟩ := ((isCyclotomicExtension_iff _ _ _).1 H).1 hS
exact X_pow_sub_one_splits hz
set_option linter.uppercaseLean3 false in
#align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Order/Atoms.lean
Expand Up @@ -265,15 +265,15 @@ class IsAtomic [OrderBot α] : Prop where
/--Every element other than `⊥` has an atom below it. -/
eq_bot_or_exists_atom_le : ∀ b : α, b = ⊥ ∨ ∃ a : α, IsAtom a ∧ a ≤ b
#align is_atomic IsAtomic
#align is_atomic_iff IsAtomic_iff
#align is_atomic_iff isAtomic_iff

/-- A lattice is coatomic iff every element other than `⊤` has a coatom above it. -/
@[mk_iff]
class IsCoatomic [OrderTop α] : Prop where
/--Every element other than `⊤` has an atom above it. -/
eq_top_or_exists_le_coatom : ∀ b : α, b = ⊤ ∨ ∃ a : α, IsCoatom a ∧ b ≤ a
#align is_coatomic IsCoatomic
#align is_coatomic_iff IsCoatomic_iff
#align is_coatomic_iff isCoatomic_iff

export IsAtomic (eq_bot_or_exists_atom_le)

Expand Down Expand Up @@ -915,7 +915,7 @@ theorem isSimpleOrder [BoundedOrder α] [BoundedOrder β] [h : IsSimpleOrder β]

protected theorem isAtomic_iff [OrderBot α] [OrderBot β] (f : α ≃o β) :
IsAtomic α ↔ IsAtomic β := by
simp only [IsAtomic_iff, f.surjective.forall, f.surjective.exists, ← map_bot f, f.eq_iff_eq,
simp only [isAtomic_iff, f.surjective.forall, f.surjective.exists, ← map_bot f, f.eq_iff_eq,
f.le_iff_le, f.isAtom_iff]
#align order_iso.is_atomic_iff OrderIso.isAtomic_iff

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Order/PrimeIdeal.lean
Expand Up @@ -129,10 +129,10 @@ theorem IsPrime.mem_or_mem (hI : IsPrime I) {x y : P} : x ⊓ y ∈ I → x ∈

theorem IsPrime.of_mem_or_mem [IsProper I] (hI : ∀ {x y : P}, x ⊓ y ∈ I → x ∈ I ∨ y ∈ I) :
IsPrime I := by
rw [IsPrime_iff]
rw [isPrime_iff]
use ‹_›
refine .of_def ?_ ?_ ?_
· exact Set.nonempty_compl.2 (I.IsProper_iff.1 ‹_›)
· exact Set.nonempty_compl.2 (I.isProper_iff.1 ‹_›)
· intro x hx y hy
exact ⟨x ⊓ y, fun h => (hI h).elim hx hy, inf_le_left, inf_le_right⟩
· exact @mem_compl_of_ge _ _ _
Expand Down Expand Up @@ -195,7 +195,7 @@ theorem isPrime_iff_mem_or_compl_mem [IsProper I] : IsPrime I ↔ ∀ {x : P}, x
#align order.ideal.is_prime_iff_mem_or_compl_mem Order.Ideal.isPrime_iff_mem_or_compl_mem

instance (priority := 100) IsPrime.isMaximal [IsPrime I] : IsMaximal I := by
simp only [IsMaximal_iff, Set.eq_univ_iff_forall, IsPrime.toIsProper, true_and]
simp only [isMaximal_iff, Set.eq_univ_iff_forall, IsPrime.toIsProper, true_and]
intro J hIJ x
rcases Set.exists_of_ssubset hIJ with ⟨y, hyJ, hyI⟩
suffices ass : x ⊓ y ⊔ x ⊓ yᶜ ∈ J by rwa [sup_inf_inf_compl] at ass
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Order/RelClasses.lean
Expand Up @@ -276,7 +276,7 @@ instance (priority := 100) isStrictTotalOrder_of_isStrictTotalOrder [IsStrictTot
/-- The relation is `WellFounded`, as a proposition. -/
wf : WellFounded r
#align is_well_founded IsWellFounded
#align is_well_founded_iff IsWellFounded_iff
#align is_well_founded_iff isWellFounded_iff

#align has_well_founded WellFoundedRelation
set_option linter.uppercaseLean3 false in
Expand Down
5 changes: 2 additions & 3 deletions Mathlib/RingTheory/Etale.lean
Expand Up @@ -71,9 +71,8 @@ variable {R A}

theorem FormallyEtale.iff_unramified_and_smooth :
FormallyEtale R A ↔ FormallyUnramified R A ∧ FormallySmooth R A := by
rw [FormallyUnramified_iff, FormallySmooth_iff, FormallyEtale_iff]
simp_rw [← forall_and]
rfl
rw [formallyUnramified_iff, formallySmooth_iff, formallyEtale_iff]
simp_rw [← forall_and, Function.Bijective]
#align algebra.formally_etale.iff_unramified_and_smooth Algebra.FormallyEtale.iff_unramified_and_smooth

instance (priority := 100) FormallyEtale.to_unramified [h : FormallyEtale R A] :
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Ideal/Cotangent.lean
Expand Up @@ -252,8 +252,8 @@ lemma finrank_cotangentSpace_eq_zero (R) [Field R] :
open Submodule in
theorem finrank_cotangentSpace_le_one_iff [IsNoetherianRing R] :
finrank (ResidueField R) (CotangentSpace R) ≤ 1 ↔ (maximalIdeal R).IsPrincipal := by
rw [Module.finrank_le_one_iff_top_isPrincipal, IsPrincipal_iff,
(maximalIdeal R).toCotangent_surjective.exists, IsPrincipal_iff]
rw [Module.finrank_le_one_iff_top_isPrincipal, isPrincipal_iff,
(maximalIdeal R).toCotangent_surjective.exists, isPrincipal_iff]
simp_rw [← Set.image_singleton, eq_comm (a := ⊤), CotangentSpace.span_image_eq_top_iff,
← (map_injective_of_injective (injective_subtype _)).eq_iff, map_span, Set.image_singleton,
Submodule.map_top, range_subtype, eq_comm (a := maximalIdeal R)]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Nilpotent.lean
Expand Up @@ -122,7 +122,7 @@ theorem Commute.IsNilpotent.add_isUnit [Ring R] {r : R} {u : Rˣ} (hnil : IsNilp
simp

/-- A structure that has zero and pow is reduced if it has no nonzero nilpotent elements. -/
@[mk_iff isReduced_iff]
@[mk_iff]
class IsReduced (R : Type*) [Zero R] [Pow R ℕ] : Prop where
/-- A reduced structure has no nonzero nilpotent elements. -/
eq_zero : ∀ x : R, IsNilpotent x → x = 0
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean
Expand Up @@ -64,7 +64,7 @@ variable [CommSemiring R] {𝓟 : Ideal R} {f : R[X]} (hf : f.IsWeaklyEisenstein


theorem map {A : Type v} [CommRing A] (φ : R →+* A) : (f.map φ).IsWeaklyEisensteinAt (𝓟.map φ) := by
refine' (IsWeaklyEisensteinAt_iff _ _).2 fun hn => _
refine' (isWeaklyEisensteinAt_iff _ _).2 fun hn => _
rw [coeff_map]
exact mem_map_of_mem _ (hf.mem (lt_of_lt_of_le hn (natDegree_map_le _ _)))
#align polynomial.is_weakly_eisenstein_at.map Polynomial.IsWeaklyEisensteinAt.map
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/PrincipalIdealDomain.lean
Expand Up @@ -69,7 +69,7 @@ instance top_isPrincipal : (⊤ : Submodule R R).IsPrincipal :=
variable (R)

/-- A ring is a principal ideal ring if all (left) ideals are principal. -/
@[mk_iff isPrincipalIdealRing_iff]
@[mk_iff]
class IsPrincipalIdealRing (R : Type u) [Ring R] : Prop where
principal : ∀ S : Ideal R, S.IsPrincipal
#align is_principal_ideal_ring IsPrincipalIdealRing
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/SetTheory/Game/PGame.lean
Expand Up @@ -1256,7 +1256,7 @@ theorem neg_ofLists (L R : List PGame) :
#align pgame.neg_of_lists SetTheory.PGame.neg_ofLists

theorem isOption_neg {x y : PGame} : IsOption x (-y) ↔ IsOption (-x) y := by
rw [IsOption_iff, IsOption_iff, or_comm]
rw [isOption_iff, isOption_iff, or_comm]
cases y;
apply or_congr <;>
· apply exists_congr
Expand Down

0 comments on commit 5192777

Please sign in to comment.