Skip to content

Commit

Permalink
chore: adapt to multiple goal linter 4 (#12381)
Browse files Browse the repository at this point in the history
This PR was reduced by approximately half of its original size: the other half of this PR is now the content of #12560.

This PR was reduced by approximately half of its halved size: the other half of the halved PR is now the content of #12834.

A PR analogous to the merged PRs #12338, #12361 and #12372: reformatting proofs following the multiple goals linter of #12339.

This should be the last of the adaptations.
  • Loading branch information
adomani committed May 13, 2024
1 parent a5eb48c commit c551dcc
Show file tree
Hide file tree
Showing 41 changed files with 163 additions and 141 deletions.
8 changes: 4 additions & 4 deletions Mathlib/RingTheory/AdjoinRoot.lean
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,10 @@ theorem minpoly_root (hf : f ≠ 0) : minpoly K (root f) = f * C f.leadingCoeff
· simp only [RingHom.comp_apply, mk_X, lift_root]
rw [degree_eq_natDegree f'_monic.ne_zero, degree_eq_natDegree q_monic.ne_zero,
Nat.cast_le, natDegree_mul hf, natDegree_C, add_zero]
apply natDegree_le_of_dvd
· have : mk f q = 0 := by rw [← commutes, RingHom.comp_apply, mk_self, RingHom.map_zero]
exact mk_eq_zero.1 this
· exact q_monic.ne_zero
· apply natDegree_le_of_dvd
· have : mk f q = 0 := by rw [← commutes, RingHom.comp_apply, mk_self, RingHom.map_zero]
exact mk_eq_zero.1 this
· exact q_monic.ne_zero
· rwa [Ne, C_eq_zero, inv_eq_zero, leadingCoeff_eq_zero]
#align adjoin_root.minpoly_root AdjoinRoot.minpoly_root

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Algebraic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ theorem inv_eq_of_aeval_divX_ne_zero {x : L} {p : K[X]} (aeval_ne : aeval x (div
x⁻¹ = aeval x (divX p) / (aeval x p - algebraMap _ _ (p.coeff 0)) := by
rw [inv_eq_iff_eq_inv, inv_div, eq_comm, div_eq_iff, sub_eq_iff_eq_add, mul_comm]
conv_lhs => rw [← divX_mul_X_add p]
rw [AlgHom.map_add, AlgHom.map_mul, aeval_X, aeval_C]
exact aeval_ne
· rw [AlgHom.map_add, AlgHom.map_mul, aeval_X, aeval_C]
· exact aeval_ne
set_option linter.uppercaseLean3 false in
#align inv_eq_of_aeval_div_X_ne_zero inv_eq_of_aeval_divX_ne_zero

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/RingTheory/ClassGroup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ theorem ClassGroup.mk_eq_mk_of_coe_ideal {I J : (FractionalIdeal R⁰ <| Fractio
exact ⟨_, _, sec_fst_ne_zero (R := R) le_rfl x.ne_zero,
sec_snd_ne_zero (R := R) le_rfl (x : FractionRing R), hJ⟩
· rintro ⟨x, y, hx, hy, h⟩
constructor
have : IsUnit (mk' (FractionRing R) x ⟨y, mem_nonZeroDivisors_of_ne_zero hy⟩) := by
simpa only [isUnit_iff_ne_zero, ne_eq, mk'_eq_zero_iff_eq_zero] using hx
refine ⟨this.unit, ?_⟩
rw [mul_comm, ← Units.eq_iff, Units.val_mul, coe_toPrincipalIdeal]
convert
(mk'_mul_coeIdeal_eq_coeIdeal (FractionRing R) <| mem_nonZeroDivisors_of_ne_zero hy).2 h
apply (Ne.isUnit _).unit_spec
rwa [Ne, mk'_eq_zero_iff_eq_zero]
#align class_group.mk_eq_mk_of_coe_ideal ClassGroup.mk_eq_mk_of_coe_ideal

theorem ClassGroup.mk_eq_one_of_coe_ideal {I : (FractionalIdeal R⁰ <| FractionRing R)ˣ}
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/RingTheory/DedekindDomain/AdicValuation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,18 @@ theorem IntValuation.map_add_le_max' (x y : R) :
have h_dvd_x : x ∈ v.asIdeal ^ nmin := by
rw [← Associates.le_singleton_iff x nmin _,
Associates.prime_pow_dvd_iff_le (Associates.mk_ne_zero'.mpr hx) _]
exact min_le_left _ _
· exact min_le_left _ _
apply v.associates_irreducible
have h_dvd_y : y ∈ v.asIdeal ^ nmin := by
rw [← Associates.le_singleton_iff y nmin _,
Associates.prime_pow_dvd_iff_le (Associates.mk_ne_zero'.mpr hy) _]
exact min_le_right _ _
· exact min_le_right _ _
apply v.associates_irreducible
have h_dvd_xy : Associates.mk v.asIdeal ^ nmin ≤ Associates.mk (Ideal.span {x + y}) := by
rw [Associates.le_singleton_iff]
exact Ideal.add_mem (v.asIdeal ^ nmin) h_dvd_x h_dvd_y
rw [Associates.prime_pow_dvd_iff_le (Associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy
exact h_dvd_xy
· exact h_dvd_xy
apply v.associates_irreducible
#align is_dedekind_domain.height_one_spectrum.int_valuation.map_add_le_max' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max'

Expand Down
8 changes: 4 additions & 4 deletions Mathlib/RingTheory/DedekindDomain/Ideal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,8 @@ theorem irreducible_pow_sup_of_ge (hI : I ≠ ⊥) (hJ : Irreducible J) (n : ℕ
(hn : multiplicity J I ≤ n) :
J ^ n ⊔ I = J ^ (multiplicity J I).get (PartENat.dom_of_le_natCast hn) := by
rw [irreducible_pow_sup hI hJ, min_eq_left]
congr
· rw [← PartENat.natCast_inj, PartENat.natCast_get,
· congr
rw [← PartENat.natCast_inj, PartENat.natCast_get,
multiplicity_eq_count_normalizedFactors hJ hI, normalize_eq J]
· rwa [multiplicity_eq_count_normalizedFactors hJ hI, PartENat.coe_le_coe, normalize_eq J] at hn
#align irreducible_pow_sup_of_ge irreducible_pow_sup_of_ge
Expand Down Expand Up @@ -1042,7 +1042,7 @@ theorem iInf_localization_eq_bot [Algebra R K] [hK : IsFractionRing R K] :
ext x
rw [Algebra.mem_iInf]
constructor
by_cases hR : IsField R
on_goal 1 => by_cases hR : IsField R
· rcases Function.bijective_iff_has_inverse.mp
(IsField.localization_map_bijective (Rₘ := K) (flip nonZeroDivisors.ne_zero rfl : 0 ∉ R⁰) hR)
with ⟨algebra_map_inv, _, algebra_map_right_inv⟩
Expand Down Expand Up @@ -1474,7 +1474,7 @@ theorem multiplicity_eq_multiplicity_span [DecidableRel ((· ∣ ·) : R → R
refine (multiplicity.unique
(show Ideal.span {a} ^ (multiplicity a b).get h ∣ Ideal.span {b} from ?_) ?_).symm <;>
rw [Ideal.span_singleton_pow, span_singleton_dvd_span_singleton_iff_dvd]
exact pow_multiplicity_dvd h
· exact pow_multiplicity_dvd h
· exact multiplicity.is_greatest
((PartENat.lt_coe_iff _ _).mpr (Exists.intro (finite_iff_dom.mp h) (Nat.lt_succ_self _)))
· suffices ¬Finite (Ideal.span ({a} : Set R)) (Ideal.span ({b} : Set R)) by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/DiscreteValuationRing/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ theorem iff_pid_with_one_nonzero_prime (R : Type u) [CommRing R] [IsDomain R] :
· intro RDVR
rcases id RDVR with ⟨Rlocal⟩
constructor
assumption
· assumption
use LocalRing.maximalIdeal R
constructor
exact ⟨Rlocal, inferInstance⟩
· exact ⟨Rlocal, inferInstance⟩
· rintro Q ⟨hQ1, hQ2⟩
obtain ⟨q, rfl⟩ := (IsPrincipalIdealRing.principal Q).1
have hq : q ≠ 0 := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Filtration.lean
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ theorem Stable.exists_forall_le (h : F.Stable) (e : F.N 0 ≤ F'.N 0) :
intro n
induction' n with n hn
· refine' (F.antitone _).trans e; simp
· rw [Nat.add_right_comm, ← hF]
exact (smul_mono_right _ hn).trans (F'.smul_le _)
· rw [add_right_comm, ← hF]
· exact (smul_mono_right _ hn).trans (F'.smul_le _)
simp
#align ideal.filtration.stable.exists_forall_le Ideal.Filtration.Stable.exists_forall_le

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/IsAdjoinRoot.lean
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ def basis (h : IsAdjoinRootMonic S f) : Basis (Fin (natDegree f)) R S :=
ext i
simp only [h.modByMonicHom_map, Finsupp.comapDomain_apply, Polynomial.toFinsupp_apply]
rw [(Polynomial.modByMonic_eq_self_iff h.Monic).mpr, Polynomial.coeff]
dsimp only -- Porting note (#10752): added `dsimp only`
rw [Finsupp.mapDomain_apply Fin.val_injective]
· dsimp only -- Porting note (#10752): added `dsimp only`
rw [Finsupp.mapDomain_apply Fin.val_injective]
rw [degree_eq_natDegree h.Monic.ne_zero, degree_lt_iff_coeff_zero]
intro m hm
rw [Polynomial.coeff]
Expand Down
20 changes: 10 additions & 10 deletions Mathlib/RingTheory/Jacobson.lean
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
· refine' fun h => ⟨⟨fun hJ => h.1.ne_top (eq_top_iff.2 _), fun I hI => _⟩⟩
· rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
· have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt hI), ?_⟩)
rwa [map_comap (powers y) S I, map_top] at this
· rwa [map_comap (powers y) S I, map_top] at this
refine' fun hI' => hI.right _
rw [← map_comap (powers y) S I, ← map_comap (powers y) S J]
exact map_mono hI'
Expand Down Expand Up @@ -665,15 +665,15 @@ private lemma aux_IH {R : Type u} {S : Type v} {T : Type w}
AlgEquiv.coe_ringEquiv, Function.comp_apply, AlgEquiv.commutes]
rw [h_eq]
apply RingHom.IsIntegral.trans
apply RingHom.IsIntegral.trans
· apply IH
apply Polynomial.isMaximal_comap_C_of_isJacobson'
exact hQ
· suffices w'.toRingHom = Ideal.quotientMap Q (Polynomial.C) le_rfl by
rw [this]
rw [isIntegral_quotientMap_iff _]
apply Polynomial.quotient_mk_comp_C_isIntegral_of_jacobson
rfl
· apply RingHom.IsIntegral.trans
· apply IH
apply Polynomial.isMaximal_comap_C_of_isJacobson'
exact hQ
· suffices w'.toRingHom = Ideal.quotientMap Q (Polynomial.C) le_rfl by
rw [this]
rw [isIntegral_quotientMap_iff _]
apply Polynomial.quotient_mk_comp_C_isIntegral_of_jacobson
rfl
· apply RingHom.isIntegral_of_surjective
exact w.surjective

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Localization/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ variable (M S)

theorem map_eq_zero_iff (r : R) : algebraMap R S r = 0 ↔ ∃ m : M, ↑m * r = 0 := by
constructor
intro h
· obtain ⟨m, hm⟩ := (IsLocalization.eq_iff_exists M S).mp ((algebraMap R S).map_zero.trans h.symm)
· intro h
obtain ⟨m, hm⟩ := (IsLocalization.eq_iff_exists M S).mp ((algebraMap R S).map_zero.trans h.symm)
exact ⟨m, by simpa using hm.symm⟩
· rintro ⟨m, hm⟩
rw [← (IsLocalization.map_units S m).mul_right_inj, mul_zero, ← RingHom.map_mul, hm,
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/RingTheory/Localization/Integral.lean
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
intro n
rw [Polynomial.coeff_scaleRoots]
by_cases h₁ : n ∈ p.support
by_cases h₂ : n = p.natDegree
on_goal 1 => by_cases h₂ : n = p.natDegree
· rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
· have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
Expand All @@ -284,8 +284,8 @@ theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [
-- Porting note: obtain doesn't support side goals
have :=
lifts_and_natDegree_eq_and_monic (IsLocalization.scaleRoots_commonDenom_mem_lifts M p ?_) ?_
obtain ⟨p', hp'₁, -, hp'₂⟩ := this
· refine' ⟨IsLocalization.commonDenom M p.support p.coeff, p', hp'₂, _⟩
· obtain ⟨p', hp'₁, -, hp'₂⟩ := this
refine' ⟨IsLocalization.commonDenom M p.support p.coeff, p', hp'₂, _⟩
rw [IsScalarTower.algebraMap_eq R Rₘ S, ← Polynomial.eval₂_map, hp'₁, Submonoid.smul_def,
Algebra.smul_def, IsScalarTower.algebraMap_apply R Rₘ S]
exact Polynomial.scaleRoots_eval₂_eq_zero _ hp₂
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ theorem natDegree_cyclotomic' {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) :
(cyclotomic' n R).natDegree = Nat.totient n := by
rw [cyclotomic']
rw [natDegree_prod (primitiveRoots n R) fun z : R => X - C z]
simp only [IsPrimitiveRoot.card_primitiveRoots h, mul_one, natDegree_X_sub_C, Nat.cast_id,
Finset.sum_const, nsmul_eq_mul]
· simp only [IsPrimitiveRoot.card_primitiveRoots h, mul_one, natDegree_X_sub_C, Nat.cast_id,
Finset.sum_const, nsmul_eq_mul]
intro z _
exact X_sub_C_ne_zero z
#align polynomial.nat_degree_cyclotomic' Polynomial.natDegree_cyclotomic'
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/Polynomial/GaussLemma.lean
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ theorem Monic.dvd_of_fraction_map_dvd_fraction_map [IsIntegrallyClosed R] {p q :
obtain ⟨r, hr⟩ := h
obtain ⟨d', hr'⟩ := IsIntegrallyClosed.eq_map_mul_C_of_dvd K hp (dvd_of_mul_left_eq _ hr.symm)
rw [Monic.leadingCoeff, C_1, mul_one] at hr'
rw [← hr', ← Polynomial.map_mul] at hr
exact dvd_of_mul_right_eq _ (Polynomial.map_injective _ (IsFractionRing.injective R K) hr.symm)
· rw [← hr', ← Polynomial.map_mul] at hr
exact dvd_of_mul_right_eq _ (Polynomial.map_injective _ (IsFractionRing.injective R K) hr.symm)
· exact Monic.of_mul_monic_left (hq.map (algebraMap R K)) (by simpa [← hr] using hp.map _)
#align polynomial.monic.dvd_of_fraction_map_dvd_fraction_map Polynomial.Monic.dvd_of_fraction_map_dvd_fraction_map

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/RingTheory/RootsOfUnity/Complex.lean
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
(div_nonneg (by simp [Real.pi_pos.le]) <| by simp)
rw [← mul_rotate', mul_div_assoc, neg_lt, ← mul_neg, mul_lt_iff_lt_one_right Real.pi_pos, ←
neg_div, ← neg_mul, neg_sub, div_lt_iff, one_mul, sub_mul, sub_lt_comm, ← mul_sub_one]
norm_num
exact mod_cast not_le.mp h₂
· norm_num
exact mod_cast not_le.mp h₂
· exact Nat.cast_pos.mpr hn.bot_lt
#align is_primitive_root.arg IsPrimitiveRoot.arg
9 changes: 3 additions & 6 deletions Mathlib/RingTheory/Valuation/ValuationRing.lean
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def valuation : Valuation K (ValueGroup A K) where
have : (algebraMap A K) ya ≠ 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hya
have : (algebraMap A K) yb ≠ 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors hyb
obtain ⟨c, h | h⟩ := ValuationRing.cond (xa * yb) (xb * ya)
dsimp
· apply le_trans _ (le_max_left _ _)
· dsimp
apply le_trans _ (le_max_left _ _)
use c + 1
rw [Algebra.smul_def]
field_simp
Expand Down Expand Up @@ -366,10 +366,7 @@ instance (priority := 100) [LocalRing R] [IsBezout R] : ValuationRing R := by
· simp [h]
have : x * a + y * b = 1 := by
apply mul_left_injective₀ h; convert e' using 1 <;> ring
cases' LocalRing.isUnit_or_isUnit_of_add_one this with h' h'
left
swap
right
cases' LocalRing.isUnit_or_isUnit_of_add_one this with h' h' <;> [left; right]
all_goals exact mul_dvd_mul_right (isUnit_iff_forall_dvd.mp (isUnit_of_mul_isUnit_right h') _) _

theorem iff_local_bezout_domain : ValuationRing R ↔ LocalRing R ∧ IsBezout R :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Valuation/ValuationSubring.lean
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S} :=
dsimp at h
have := idealOfLE_le_of_le A _ _ ?_ ?_ h
iterate 2 erw [idealOfLE_ofPrime] at this
exact this
· exact this
all_goals exact le_ofPrime A (PrimeSpectrum.asIdeal _),
fun h => by apply ofPrime_le_of_le; exact h⟩ }
#align valuation_subring.prime_spectrum_order_equiv ValuationSubring.primeSpectrumOrderEquiv
Expand Down
5 changes: 4 additions & 1 deletion Mathlib/RingTheory/WittVector/Verschiebung.lean
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ theorem verschiebung_isPoly : IsPoly p fun R _Rcr => @verschiebung p R hp _Rcr :
/-- verschiebung is a natural transformation -/
@[simp]
theorem map_verschiebung (f : R →+* S) (x : 𝕎 R) :
map f (verschiebung x) = verschiebung (map f x) := by ext ⟨-, -⟩; exact f.map_zero; rfl
map f (verschiebung x) = verschiebung (map f x) := by
ext ⟨-, -⟩
· exact f.map_zero
· rfl
#align witt_vector.map_verschiebung WittVector.map_verschiebung

@[ghost_simps]
Expand Down
12 changes: 6 additions & 6 deletions Mathlib/SetTheory/Cardinal/Cofinality.lean
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ theorem cof_succ (o) : cof (succ o) = 1 := by
· refine' inductionOn o fun α r _ => _
change cof (type _) ≤ _
rw [← (_ : #_ = 1)]
apply cof_type_le
· refine' fun a => ⟨Sum.inr PUnit.unit, Set.mem_singleton _, _⟩
· apply cof_type_le
refine' fun a => ⟨Sum.inr PUnit.unit, Set.mem_singleton _, _⟩
rcases a with (a | ⟨⟨⟨⟩⟩⟩) <;> simp [EmptyRelation]
· rw [Cardinal.mk_fintype, Set.card_singleton]
simp
Expand Down Expand Up @@ -605,8 +605,8 @@ theorem trans {a o o' : Ordinal.{u}} {f : ∀ b < o, Ordinal.{u}} (hf : IsFundam
· rw [hf.cof_eq]
exact hg.1.trans (ord_cof_le o)
· rw [@blsub_comp.{u, u, u} o _ f (@IsFundamentalSequence.monotone _ _ f hf)]
exact hf.2.2
exact hg.2.2
· exact hf.2.2
· exact hg.2.2
#align ordinal.is_fundamental_sequence.trans Ordinal.IsFundamentalSequence.trans

end IsFundamentalSequence
Expand Down Expand Up @@ -1148,8 +1148,8 @@ theorem nfpFamily_lt_ord_lift_of_isRegular {ι} {f : ι → Ordinal → Ordinal}
(hι : Cardinal.lift.{v, u} #ι < c) (hc' : c ≠ ℵ₀) (hf : ∀ (i), ∀ b < c.ord, f i b < c.ord) {a}
(ha : a < c.ord) : nfpFamily.{u, v} f a < c.ord := by
apply nfpFamily_lt_ord_lift.{u, v} _ _ hf ha <;> rw [hc.cof_eq]
exact lt_of_le_of_ne hc.1 hc'.symm
exact hι
· exact lt_of_le_of_ne hc.1 hc'.symm
· exact hι
#align cardinal.nfp_family_lt_ord_lift_of_is_regular Cardinal.nfpFamily_lt_ord_lift_of_isRegular

theorem nfpFamily_lt_ord_of_isRegular {ι} {f : ι → Ordinal → Ordinal} {c} (hc : IsRegular c)
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/SetTheory/Cardinal/Divisibility.lean
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
cases hbc <;> contradiction
wlog hℵ₀b : ℵ₀ ≤ b
refine' (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> try assumption
rwa [mul_comm] at hbc
rwa [mul_comm] at h'
exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hℵ₀b) hℵ₀b)
· rwa [mul_comm] at hbc
· rwa [mul_comm] at h'
· exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hℵ₀b) hℵ₀b)
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff

theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime := by
Expand Down
16 changes: 8 additions & 8 deletions Mathlib/SetTheory/Cardinal/Ordinal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ theorem mul_eq_left_iff {a b : Cardinal} : a * b = a ↔ max ℵ₀ b ≤ a ∧
left
rw [← h, mul_lt_aleph0_iff, lt_aleph0, lt_aleph0] at ha
rcases ha with (rfl | rfl | ⟨⟨n, rfl⟩, ⟨m, rfl⟩⟩)
contradiction
contradiction
· contradiction
· contradiction
rw [← Ne] at h2a
rw [← one_le_iff_ne_zero] at h2a hb
norm_cast at h2a hb h ⊢
Expand All @@ -707,7 +707,7 @@ theorem mul_eq_left_iff {a b : Cardinal} : a * b = a ↔ max ℵ₀ b ≤ a ∧
apply fun h2b => ne_of_gt _ h
conv_rhs => left; rw [← mul_one n]
rw [mul_lt_mul_left]
exact id
· exact id
apply Nat.lt_of_succ_le h2a
· rintro (⟨⟨ha, hab⟩, hb⟩ | rfl | rfl)
· rw [mul_eq_max_of_aleph0_le_left ha hb, max_eq_left hab]
Expand Down Expand Up @@ -1293,9 +1293,9 @@ theorem mk_bounded_set_le (α : Type u) (c : Cardinal) :
#{ t : Set α // #t ≤ c } ≤ max #α ℵ₀ ^ c := by
trans #{ t : Set (Sum (ULift.{u} ℕ) α) // #t ≤ c }
· refine' ⟨Embedding.subtypeMap _ _⟩
apply Embedding.image
use Sum.inr
apply Sum.inr.inj
· apply Embedding.image
use Sum.inr
apply Sum.inr.inj
intro s hs
exact mk_image_le.trans hs
apply (mk_bounded_set_le_of_infinite (Sum (ULift.{u} ℕ) α) c).trans
Expand All @@ -1306,8 +1306,8 @@ theorem mk_bounded_subset_le {α : Type u} (s : Set α) (c : Cardinal.{u}) :
#{ t : Set α // t ⊆ s ∧ #t ≤ c } ≤ max #s ℵ₀ ^ c := by
refine' le_trans _ (mk_bounded_set_le s c)
refine' ⟨Embedding.codRestrict _ _ _⟩
use fun t => (↑) ⁻¹' t.1
· rintro ⟨t, ht1, ht2⟩ ⟨t', h1t', h2t'⟩ h
· use fun t => (↑) ⁻¹' t.1
rintro ⟨t, ht1, ht2⟩ ⟨t', h1t', h2t'⟩ h
apply Subtype.eq
dsimp only at h ⊢
refine' (preimage_eq_preimage' _ _).1 h <;> rw [Subtype.range_coe] <;> assumption
Expand Down
Loading

0 comments on commit c551dcc

Please sign in to comment.