@[simp]
theorem natAbs_valMinAbs_neg {n : ℕ} (a : ZMod n) : (-a).valMinAbs.natAbs = a.valMinAbs.natAbs


theorem sup'_eq_csSup_image (s : Finset ι) (H : s.Nonempty) (f : ι → α) :
    s.sup' H f = sSup (f '' s)

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLattice α]
(s : Finset ι)
(H : s.Nonempty)
(f : ι → α)


theorem normalizedFactors_eq_of_dvd (a : α) :
    ∀ᵉ (p ∈ normalizedFactors a) (q ∈ normalizedFactors a), p ∣ q → p = q

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
(a p : α)

p ∈ UniqueFactorizationMonoid.normalizedFactors a → ∀ q ∈ UniqueFactorizationMonoid.normalizedFactors a, p ∣ q → p = q


protected theorem _root_.Measurable.measurePreserving
    {f : α → β} (h : Measurable f) (μa : Measure α) : MeasurePreserving f μa (map f μa)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : α → β}
(h : Measurable f)
(μa : MeasureTheory.Measure α)

MeasureTheory.MeasurePreserving f μa (MeasureTheory.Measure.map f μa)


lemma exact_map_mkQ_range (f : M →ₗ[R] N) :
    Exact f (Submodule.mkQ (range f))

{R : Type u_8}
{M : Type u_9}
{N : Type u_10}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(f : M →ₗ[R] N)

Function.Exact ⇑f ⇑(LinearMap.range f).mkQ


theorem exists_open_nhds_disjoint_closure [T25Space X] {x y : X} (h : x ≠ y) :
    ∃ u : Set X,
      x ∈ u ∧ IsOpen u ∧ ∃ v : Set X, y ∈ v ∧ IsOpen v ∧ Disjoint (closure u) (closure v)

{X : Type u_1}
[TopologicalSpace X]
[T25Space X]
{x y : X}
(h : x ≠ y)

∃ u, x ∈ u ∧ IsOpen u ∧ ∃ v, y ∈ v ∧ IsOpen v ∧ Disjoint (closure u) (closure v)


/-- The orthogonal complement of the inner derivations is a Lie submodule of all derivations. -/
@[simps!] noncomputable def rangeAdOrthogonal : LieSubmodule R L (LieDerivation R L L)

(R : Type u_1)
(L : Type u_2)
[Field R]
[LieRing L]
[LieAlgebra R L]

↑(LieDerivation.IsKilling.rangeAdOrthogonal R L) =
  {m | ∀ (a : L), (killingForm R (LieDerivation R L L)).IsOrtho ((LieDerivation.ad R L) a) m}


theorem spectrum_eq_preimage_range (f : C(X, R)) :
    spectrum 𝕜 f = algebraMap _ _ ⁻¹' Set.range f

{X : Type u_1}
{R : Type u_3}
{𝕜 : Type u_4}
[TopologicalSpace X]
[NormedField 𝕜]
[NormedDivisionRing R]
[Algebra 𝕜 R]
[CompleteSpace R]
(f : C(X, R))

spectrum 𝕜 f = ⇑(algebraMap 𝕜 R) ⁻¹' Set.range ⇑f


lemma zpow_right₀ {a x y : G₀} (h : SemiconjBy a x y) : ∀ m : ℤ, SemiconjBy a (x ^ m) (y ^ m)

{G₀ : Type u_3}
[GroupWithZero G₀]
{a x y : G₀}
(h : SemiconjBy a x y)
(m : ℤ)


theorem zero_ne_one : (0 : Fin (n + 2)) ≠ 1


lemma smul_le_smul [PosSMulMono α β] [SMulPosMono α β] (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂)
    (h₁ : 0 ≤ a₁) (h₂ : 0 ≤ b₂) : a₁ • b₁ ≤ a₂ • b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[Zero β]
[PosSMulMono α β]
[SMulPosMono α β]
(ha : a₁ ≤ a₂)
(hb : b₁ ≤ b₂)
(h₁ : 0 ≤ a₁)
(h₂ : 0 ≤ b₂)

a₁ • b₁ ≤ a₂ • b₂


/-- Casting a scientific literal via `ℚ≥0` is the same as casting directly. -/
@[simp, norm_cast]
theorem _root_.NNRat.cast_ofScientific {K} [NNRatCast K] (m : ℕ) (s : Bool) (e : ℕ) :
    (OfScientific.ofScientific m s e : ℚ≥0) = (OfScientific.ofScientific m s e : K)

{K : Type u_1}
[NNRatCast K]
(m : ℕ)
(s : Bool)
(e : ℕ)

↑(OfScientific.ofScientific m s e) = OfScientific.ofScientific m s e


@[simp] theorem symm_trans_self (e : X ≃ᵈ Y) : e.symm.trans e = refl Y

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵈ Y)


theorem coe_decompose_mul_of_right_mem_of_not_le (b_mem : b ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[Semiring A]
[DecidableEq ι]
[CanonicallyOrderedAddCommMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
{a b : A}
{n i : ι}
(b_mem : b ∈ 𝒜 i)
(h : ¬i ≤ n)

↑(((DirectSum.decompose 𝒜) (a * b)) n) = 0


theorem normalizedFactors_prod_eq (s : Multiset α) (hs : ∀ a ∈ s, Irreducible a) :
    normalizedFactors s.prod = s.map normalize

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
(s : Multiset α)
(hs : ∀ a ∈ s, Irreducible a)

UniqueFactorizationMonoid.normalizedFactors s.prod = Multiset.map (⇑normalize) s


@[to_additive]
theorem isometry_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G] :
    Isometry (Inv.inv : G → G)

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]


/-- A split equalizer diagram consists of morphisms

```
      ι   f
    W → X ⇉ Y
          g
```

satisfying `ι ≫ f = ι ≫ g` together with morphisms

```
      r   t
    W ← X ← Y
```

satisfying `ι ≫ r = 𝟙 W`, `g ≫ t = 𝟙 X` and `f ≫ t = r ≫ ι`.

The name "equalizer" is appropriate, since any split equalizer is a equalizer, see
`CategoryTheory.IsSplitEqualizer.isEqualizer`.
Split equalizers are also absolute, since a functor preserves all the structure above.
-/
structure IsSplitEqualizer {W : C} (ι : W ⟶ X) where
  /-- A map from `X` to the equalizer -/
  leftRetraction : X ⟶ W
  /-- A map in the opposite direction to `f` and `g` -/
  rightRetraction : Y ⟶ X
  /-- Composition of `ι` with `f` and with `g` agree -/
  condition : ι ≫ f = ι ≫ g := by aesop_cat
  /-- `leftRetraction` splits `ι` -/
  ι_leftRetraction : ι ≫ leftRetraction = 𝟙 W := by aesop_cat
  /-- `rightRetraction` splits `g` -/
  bottom_rightRetraction : g ≫ rightRetraction = 𝟙 X := by aesop_cat
  /-- `f` composed with `rightRetraction` is `leftRetraction` composed with `ι` -/
  top_rightRetraction : f ≫ rightRetraction = leftRetraction ≫ ι := by aesop_cat

(self : CategoryTheory.IsSplitEqualizer f g ι)

CategoryTheory.CategoryStruct.comp f self.rightRetraction = CategoryTheory.CategoryStruct.comp self.leftRetraction ι


/-- `Equiv.mulRight` as an `OrderIso`. See also `OrderEmbedding.mulRight`. -/
@[to_additive (attr := simps! (config := { simpRhs := true }) toEquiv apply)
  "`Equiv.addRight` as an `OrderIso`. See also `OrderEmbedding.addRight`."]
def OrderIso.mulRight (a : α) : α ≃o α

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

(OrderIso.addRight a).toEquiv = Equiv.addRight a


lemma evalEval_polynomialX (x y : R) :
    W.polynomialX.evalEval x y = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(x y : R)

Polynomial.evalEval x y W.polynomialX = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄)


/-- The set of natural number powers of an element of a monoid `M` is a submonoid of `M`. -/
@[to_additive
      "The set of natural number multiples of an element of an `AddMonoid` `M` is
      an `AddSubmonoid` of `M`."]
theorem powers.isSubmonoid (x : M) : IsSubmonoid (powers x)


theorem nnnorm_def' (a : 𝓜(𝕜, A)) : ‖a‖₊ = ‖toProdMulOppositeHom a‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a : 𝓜(𝕜, A))

‖a‖₊ = ‖DoubleCentralizer.toProdMulOppositeHom a‖₊


@[simp]
theorem toMatrix_bot [DecidableEq n] [Zero α] [One α] :
    ((⊥ : PEquiv m n).toMatrix : Matrix m n α) = 0

{m : Type u_3}
{n : Type u_4}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]


@[simp]
theorem type_eq_zero_iff_isEmpty [IsWellOrder α r] : type r = 0 ↔ IsEmpty α

{α : Type u}
{r : α → α → Prop}
[IsWellOrder α r]


theorem mutuallySingular_iff (s t : SignedMeasure α) :
    s ⟂ᵥ t ↔ s.totalVariation ⟂ₘ t.totalVariation

{α : Type u_1}
[MeasurableSpace α]
(s t : MeasureTheory.SignedMeasure α)


@[symm]
theorem symm (h : v₁.IsEquiv v₂) : v₂.IsEquiv v₁

{R : Type u_3}
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[LinearOrderedAddCommMonoidWithTop Γ'₀]
[Ring R]
{v₁ : AddValuation R Γ₀}
{v₂ : AddValuation R Γ'₀}
(h : v₁.IsEquiv v₂)


/-- Auxiliary definition:
Multivariate polynomials in finitely many variables over an integral domain form an integral domain.
This fact is proven by transport of structure from the `MvPolynomial.noZeroDivisors_fin`,
and then used to prove the general case without finiteness hypotheses.
See `MvPolynomial.noZeroDivisors` for the general case. -/
theorem noZeroDivisors_of_finite (R : Type u) (σ : Type v) [CommSemiring R] [Finite σ]
    [NoZeroDivisors R] : NoZeroDivisors (MvPolynomial σ R)


theorem isLittleO_const_mul_right_iff' {g : α → R} {c : R} (hc : IsUnit c) :
    (f =o[l] fun x => c * g x) ↔ f =o[l] g

{α : Type u_1}
{E : Type u_3}
{R : Type u_13}
[Norm E]
[SeminormedRing R]
{f : α → E}
{l : Filter α}
{g : α → R}
{c : R}
(hc : IsUnit c)


lemma surjOn_of_subsingleton' [Subsingleton β] (f : α → β) (h : t.Nonempty → s.Nonempty) :
    SurjOn f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
[Subsingleton β]
(f : α → β)
(h : t.Nonempty → s.Nonempty)


@[to_additive]
lemma mulIndicator_le' (hfg : ∀ a ∈ s, f a ≤ g a) (hg : ∀ a, a ∉ s → 1 ≤ g a) :
    mulIndicator s f ≤ g

{α : Type u_2}
{M : Type u_4}
[LE M]
[One M]
{s : Set α}
{f g : α → M}
(hfg : ∀ a ∈ s, f a ≤ g a)
(hg : ∀ a ∉ s, 1 ≤ g a)


@[simp]
theorem imCLM_norm : ‖imCLM‖ = 1


lemma memPartitionSet_eq_iff {f : ℕ → Set α} {n : ℕ} (a : α) {s : Set α}
    (hs : s ∈ memPartition f n) :
    memPartitionSet f n a = s ↔ a ∈ s

{α : Type u_1}
{f : ℕ → Set α}
{n : ℕ}
(a : α)
{s : Set α}
(hs : s ∈ memPartition f n)


/-- Adjoins a `⊥` to the domain of a `SupHom`. -/
@[simps]
def withBot' [OrderBot β] (f : SupHom α β) : SupBotHom (WithBot α) β

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
[SemilatticeSup β]
[OrderBot β]
(f : SupHom α β)
(a : WithBot α)

f.withBot'.toSupHom a = Option.elim a ⊥ ⇑f


theorem prod_map_atTop_eq {α₁ α₂ β₁ β₂ : Type*} [Preorder β₁] [Preorder β₂]
    (u₁ : β₁ → α₁) (u₂ : β₂ → α₂) : map u₁ atTop ×ˢ map u₂ atTop = map (Prod.map u₁ u₂) atTop

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
[Preorder β₁]
[Preorder β₂]
(u₁ : β₁ → α₁)
(u₂ : β₂ → α₂)

Filter.map u₁ Filter.atTop ×ˢ Filter.map u₂ Filter.atTop = Filter.map (Prod.map u₁ u₂) Filter.atTop


@[to_additive]
theorem comap_iInf {ι : Sort*} (f : G →* N) (s : ι → Subgroup N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{ι : Sort u_7}
(f : G →+ N)
(s : ι → AddSubgroup N)

AddSubgroup.comap f (iInf s) = ⨅ i, AddSubgroup.comap f (s i)


@[to_additive]
theorem inv_lt_one_of_one_lt : 1 < a → a⁻¹ < 1

{α : Type u}
[OrderedAddCommGroup α]
{a : α}


theorem finsupport_subset_fintsupport : ρ.finsupport x₀ ⊆ ρ.fintsupport x₀

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
(x₀ : X)


@[simp] theorem val_succ (j : Fin n) : (j.succ : Nat) = j + 1


theorem opAlgEquiv_symm_apply (x : (A ⊗[R] B)ᵐᵒᵖ) :
    (opAlgEquiv R S A B).symm x =
      _root_.TensorProduct.map (opLinearEquiv R).toLinearMap (opLinearEquiv R).toLinearMap x.unop

(R : Type u_1)
(S : Type u_2)
(A : Type u_3)
(B : Type u_4)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra R A]
[Algebra R B]
[Algebra S A]
[IsScalarTower R S A]
(x : (A ⊗[R] B)ᵐᵒᵖ)

(Algebra.TensorProduct.opAlgEquiv R S A B).symm x =
  (TensorProduct.map ↑(MulOpposite.opLinearEquiv R) ↑(MulOpposite.opLinearEquiv R)) (MulOpposite.unop x)


theorem enum_succ_eq_top {o : Ordinal} :
    enum (· < ·) o
        (by
          rw [type_lt]
          exact lt_succ o) =
      (⊤ : (succ o).out.α)

Ordinal.enum (fun x x_1 => x < x_1) o ⋯ = ⊤


/-- The product type `X × Y` is a binary product for `X` and `Y`. -/
@[simps]
def binaryProductLimit (X Y : Type u) : IsLimit (binaryProductCone X Y)

(s : CategoryTheory.Limits.BinaryFan X Y)

(CategoryTheory.Limits.Types.binaryProductLimit X Y).lift s x = (s.fst x, s.snd x)


theorem map_update_self [DecidableEq ι] {i j : ι} (hij : i ≠ j) :
    f (Function.update v i (v j)) = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
(v : ι → M)
[DecidableEq ι]
{i j : ι}
(hij : i ≠ j)


@[simp] lemma lift_sup_comp (a b : α) : lift a ⊔ comp b = comp (b \ a)

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
(a b : α)

Booleanisation.lift a ⊔ Booleanisation.comp b = Booleanisation.comp (b \ a)


@[simp]
theorem cast_sub' [AddGroupWithOne α] : ∀ m n : Num, (sub' m n : α) = m - n

{α : Type u_1}
[AddGroupWithOne α]
(m n : Num)


@[simp]
theorem diam_image (s : Set α) : Metric.diam (h '' s) = Metric.diam s

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(h : α ≃ᵢ β)
(s : Set α)


@[simp]
theorem linearEquiv_coe_to_linearMap_comp :
    (e.compDer D : A →ₗ[R] N) = (e.toLinearMap : M →ₗ[R] N).comp (D : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
{N : Type u_5}
[AddCommMonoid N]
[Module A N]
[Module R N]
[IsScalarTower R A M]
[IsScalarTower R A N]
(e : M ≃ₗ[A] N)


/-- A side of a right-angled triangle divided by the cosine of the adjacent angle equals the
hypotenuse. -/
theorem dist_div_cos_oangle_left_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) : dist p₁ p₂ / Real.Angle.cos (∡ p₃ p₁ p₂) = dist p₁ p₃

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]

dist p₁ p₂ / (∡ p₃ p₁ p₂).cos = dist p₁ p₃


theorem sup_ker_aeval_le_ker_aeval_mul {f : M →ₗ[R] M} {p q : R[X]} :
    LinearMap.ker (aeval f p) ⊔ LinearMap.ker (aeval f q) ≤ LinearMap.ker (aeval f (p * q))

{R : Type u}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : M →ₗ[R] M}
{p q : R[X]}

LinearMap.ker ((Polynomial.aeval f) p) ⊔ LinearMap.ker ((Polynomial.aeval f) q) ≤
  LinearMap.ker ((Polynomial.aeval f) (p * q))


/-- If the index type has cardinality equal to the finite dimension, composing an alternating
map with the same linear equiv on each argument gives the same orientation if and only if the
determinant is positive. -/
theorem map_eq_iff_det_pos (x : Orientation R M ι) (f : M ≃ₗ[R] M)
    (h : Fintype.card ι = finrank R M) :
    Orientation.map ι f x = x ↔ 0 < LinearMap.det (f : M →ₗ[R] M)

(h : Fintype.card ι = FiniteDimensional.finrank R M)

(Orientation.map ι f) x = x ↔ 0 < LinearMap.det ↑f


@[reassoc (attr := simp)]
lemma idem_f (P : Karoubi (Karoubi C)) : P.p.f ≫ P.p.f = P.p.f

(P : CategoryTheory.Idempotents.Karoubi (CategoryTheory.Idempotents.Karoubi C))

CategoryTheory.CategoryStruct.comp P.p.f P.p.f = P.p.f


protected theorem Finite.isWF (hs : s.Finite) : IsWF s

{α : Type u_2}
[Preorder α]
{s : Set α}
(hs : s.Finite)


/-- Construct a `RingHomInvPair` from both directions of a ring equiv.

This is not an instance, as for equivalences that are involutions, a better instance
would be `RingHomInvPair e e`. Indeed, this declaration is not currently used in mathlib.
-/
theorem of_ringEquiv (e : R₁ ≃+* R₂) : RingHomInvPair (↑e : R₁ →+* R₂) ↑e.symm

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
(e : R₁ ≃+* R₂)


@[simp]
protected lemma neg_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (-z₁).comp z₂ h = -z₁.comp z₂ h

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)


/-- Note that the weaker `List.Subset.dedup_append_left` is proved later. -/
theorem Subset.dedup_append_right {xs ys : List α} (h : xs ⊆ ys) :
    dedup (xs ++ ys) = dedup ys

{α : Type u_1}
[DecidableEq α]
{xs ys : List α}
(h : xs ⊆ ys)


theorem cycleFactorsFinset_mul_inv_mem_eq_sdiff [DecidableEq α] [Fintype α] {f g : Perm α}
    (h : f ∈ cycleFactorsFinset g) : cycleFactorsFinset (g * f⁻¹) = cycleFactorsFinset g \ {f}

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}
(h : f ∈ g.cycleFactorsFinset)

(g * f⁻¹).cycleFactorsFinset = g.cycleFactorsFinset \ {f}


theorem Set.Nonempty.csSup_mem (h : s.Nonempty) (hs : s.Finite) : sSup s ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
(h : s.Nonempty)
(hs : s.Finite)


theorem _root_.MonotoneOn.congr (h₁ : MonotoneOn f₁ s) (h : s.EqOn f₁ f₂) : MonotoneOn f₂ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
[Preorder α]
[Preorder β]
(h₁ : MonotoneOn f₁ s)
(h : Set.EqOn f₁ f₂ s)


theorem sup_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) :
    (s ×ˢ t).sup f = t.sup fun i' => s.sup fun i => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
[OrderBot α]
(s : Finset β)
(t : Finset γ)
(f : β × γ → α)

(s ×ˢ t).sup f = t.sup fun i' => s.sup fun i => f (i, i')


theorem ae_eq_zero_restrict_of_forall_setIntegral_eq_zero {f : α → E}
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hf_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) {t : Set α}
    (ht : MeasurableSet t) (hμt : μ t ≠ ∞) : f =ᵐ[μ.restrict t] 0

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn f s μ)

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ = 0)


theorem fromGlued_openEmbedding : OpenEmbedding 𝒰.fromGlued.1.base

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)


@[reassoc (attr := simp)]
theorem map_lift_equalizerComparison [HasEqualizer f g] [HasEqualizer (G.map f) (G.map g)] {Z : C}
    {h : Z ⟶ X} (w : h ≫ f = h ≫ g) :
    G.map (equalizer.lift h w) ≫ equalizerComparison f g G =
      equalizer.lift (G.map h) (by simp only [← G.map_comp, w])

[CategoryTheory.Limits.HasEqualizer (G.map f) (G.map g)]

(w : CategoryTheory.CategoryStruct.comp h f = CategoryTheory.CategoryStruct.comp h g)

CategoryTheory.CategoryStruct.comp (G.map (CategoryTheory.Limits.equalizer.lift h w))
    (CategoryTheory.Limits.equalizerComparison f g G) =
  CategoryTheory.Limits.equalizer.lift (G.map h) ⋯


theorem data_drop : ∀ {s}, Valid s → ∀ n, (s.drop n).toString.1 = s.toString.1.drop n

s.Valid → ∀ (n : Nat), (s.drop n).toString.data = List.drop n s.toString.data


lemma LSeriesSummable.sub {f g : ℕ → ℂ} {s : ℂ} (hf : LSeriesSummable f s)
    (hg : LSeriesSummable g s) :
    LSeriesSummable (f - g) s


/-- Given a `Homotopy p₀ p₁`, we can define a `Homotopy p₁ p₀` by reversing the homotopy.
-/
@[simps!]
def symm (F : Homotopy p₀ p₁) : Homotopy p₁ p₀

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
{p₀ p₁ : Path x₀ x₁}
(F : p₀.Homotopy p₁)
(x : ↑I × ↑I)


@[field_simps] lemma eq_div_iff (hb : b ≠ 0) : c = a / b ↔ c * b = a

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hb : b ≠ 0)


/-- `e.symm` is a right inverse of `e`, written as `e (e.symm y) = y`. -/
@[to_additive (attr := simp) "`e.symm` is a right inverse of `e`, written as `e (e.symm y) = y`."]
theorem apply_symm_apply (e : M ≃* N) (y : N) : e (e.symm y) = y

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)
(y : N)


/-- Given a (completely) multiplicative function `f : ℕ → F`, where `F` is a normed field,
such that `‖f p‖ < 1` for all primes `p`, we can express the sum of `f n` over all `N`-smooth
positive integers `n` as a product of `(1 - f p)⁻¹` over the primes `p < N`. At the same time,
we show that the sum involved converges absolutely. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_geometric {f : ℕ →* F}
    (h : ∀ {p : ℕ}, p.Prime → ‖f p‖ < 1) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p ∈ N.primesBelow, (1 - f p)⁻¹)

(h : ∀ {p : ℕ}, Nat.Prime p → ‖f p‖ < 1)

(Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p ∈ N.primesBelow, (1 - f p)⁻¹)


@[simp]
theorem relMap_sum_inr {n : ℕ} (R : L₂.Relations n) :
    @RelMap (L₁.sum L₂) S _ n (Sum.inr R) = RelMap R

{L₁ : FirstOrder.Language}
{L₂ : FirstOrder.Language}
{S : Type u_3}
[L₁.Structure S]
[L₂.Structure S]
{n : ℕ}
(R : L₂.Relations n)

FirstOrder.Language.Structure.RelMap (Sum.inr R) = FirstOrder.Language.Structure.RelMap R


lemma _root_.NonUnitalAlgHom.map_adjoin (f : F) (s : Set A) :
    map f (adjoin R s) = adjoin R (f '' s)

{F : Type u_1}
(R : Type u)
(A : Type v)
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(f : F)
(s : Set A)

NonUnitalSubalgebra.map f (NonUnitalAlgebra.adjoin R s) = NonUnitalAlgebra.adjoin R (⇑f '' s)


/-- If `x` lies within an orthogonal family `v`, it can be expressed as a sum of projections. -/
theorem OrthogonalFamily.sum_projection_of_mem_iSup [Fintype ι] {V : ι → Submodule 𝕜 E}
    [∀ i, CompleteSpace (V i)] (hV : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ)
    (x : E) (hx : x ∈ iSup V) : (∑ i, (orthogonalProjection (V i) x : E)) = x

(hV : OrthogonalFamily 𝕜 (fun i => ↥(V i)) fun i => (V i).subtypeₗᵢ)

∑ i : ι, ↑((orthogonalProjection (V i)) x) = x


/-- From a lower bound on `sqrtTwoAddSeries 0 n = 2 cos (π / 2 ^ (n+1))` of the form
`2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries 0 n`, one can deduce the upper bound
`π < a` thanks to basic trigonometric formulas as expressed in `pi_lt_sqrtTwoAddSeries`. -/
theorem pi_upper_bound_start (n : ℕ) {a}
    (h : (2 : ℝ) - ((a - 1 / (4 : ℝ) ^ n) / (2 : ℝ) ^ (n + 1)) ^ 2 ≤
        sqrtTwoAddSeries ((0 : ℕ) / (1 : ℕ)) n)
    (h₂ : (1 : ℝ) / (4 : ℝ) ^ n ≤ a) : π < a


theorem pairwise_insert_of_not_mem (ha : a ∉ s) :
    (insert a s).Pairwise r ↔ s.Pairwise r ∧ ∀ b ∈ s, r a b ∧ r b a

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(ha : a ∉ s)


lemma isPrime_of_maximally_disjoint (I : Ideal α)
    (S : Submonoid α)
    (disjoint : Disjoint (I : Set α) S)
    (maximally_disjoint : ∀ (J : Ideal α), I < J → ¬ Disjoint (J : Set α) S) :
    I.IsPrime

(maximally_disjoint : ∀ (J : Ideal α), I < J → ¬Disjoint ↑J ↑S)


theorem self_act_eq_iff_eq {x y : R} : x ◃ x = y ◃ y ↔ x = y


@[simp]
theorem RingHom.asBoolAlg_comp (g : β →+* γ) (f : α →+* β) :
    (g.comp f).asBoolAlg = g.asBoolAlg.comp f.asBoolAlg

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[BooleanRing α]
[BooleanRing β]
[BooleanRing γ]
(g : β →+* γ)
(f : α →+* β)


lemma StrictAnti.image_Ioc_subset (h : StrictAnti f) : f '' Ioc a b ⊆ Ico (f b) (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictAnti f)


theorem abs_max_sub_max_le_max (a b c d : α) : |max a b - max c d| ≤ max |a - c| |b - d|

{α : Type u_1}
[LinearOrderedAddCommGroup α]
(a b c d : α)


/-- A sort of triangle inequality. -/
theorem uIcc_subset_uIcc_union_uIcc : [[a, c]] ⊆ [[a, b]] ∪ [[b, c]]

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c : α}


/-- Urysohn's lemma: if `s` and `t` are two disjoint closed sets in a normal topological space `X`,
and `a ≤ b` are two real numbers, then there exists a continuous function `f : X → ℝ` such that

* `f` equals `a` on `s`;
* `f` equals `b` on `t`;
* `a ≤ f x ≤ b` for all `x`.
-/
theorem exists_bounded_mem_Icc_of_closed_of_le {X : Type*} [TopologicalSpace X] [NormalSpace X]
    {s t : Set X} (hs : IsClosed s) (ht : IsClosed t) (hd : Disjoint s t) {a b : ℝ} (hle : a ≤ b) :
    ∃ f : X →ᵇ ℝ, EqOn f (Function.const X a) s ∧ EqOn f (Function.const X b) t ∧
    ∀ x, f x ∈ Icc a b

{X : Type u_1}
[TopologicalSpace X]
[NormalSpace X]
{s t : Set X}
(hs : IsClosed s)
(ht : IsClosed t)
(hd : Disjoint s t)
{a b : ℝ}
(hle : a ≤ b)

∃ f, Set.EqOn (⇑f) (Function.const X a) s ∧ Set.EqOn (⇑f) (Function.const X b) t ∧ ∀ (x : X), f x ∈ Set.Icc a b


@[to_additive (attr := simp)]
theorem mul_left_eq_self : a * b = b ↔ a = 1

{M : Type u}
[RightCancelMonoid M]
{a b : M}


theorem pairwise_coprime_X_sub_C {K} [Field K] {I : Type v} {s : I → K} (H : Function.Injective s) :
    Pairwise (IsCoprime on fun i : I => X - C (s i))

{K : Type u_1}
[Field K]
{I : Type v}
{s : I → K}
(H : Function.Injective s)

Pairwise (IsCoprime on fun i => Polynomial.X - Polynomial.C (s i))


@[simp]
theorem symm_apply_apply (h : X ≃ₜ Y) (x : X) : h.symm (h x) = x

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
(x : X)


/-- Sum of elements in an `IntermediateField` indexed by a `Finset` is in the `IntermediateField`.
-/
protected theorem sum_mem {ι : Type*} {t : Finset ι} {f : ι → L} (h : ∀ c ∈ t, f c ∈ S) :
    (∑ i ∈ t, f i) ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{ι : Type u_4}
{t : Finset ι}
{f : ι → L}
(h : ∀ c ∈ t, f c ∈ S)


theorem log_injOn_pos : Set.InjOn log (Set.Ioi 0)


@[simp]
theorem dual_ordConnected_iff {s : Set α} : OrdConnected (ofDual ⁻¹' s) ↔ OrdConnected s

(⇑OrderDual.ofDual ⁻¹' s).OrdConnected ↔ s.OrdConnected


/-- Any two functors to `Discrete PUnit` are isomorphic. -/
@[simps!]
def punitExt (F G : C ⥤ Discrete PUnit.{w + 1}) : F ≅ G

(F G : CategoryTheory.Functor C (CategoryTheory.Discrete PUnit.{w + 1}))


/-- If `λ` does not divide `x`, then `λ ^ 4` divides `x ^ 3 - 1` or `x ^ 3 + 1`. -/
lemma lambda_pow_four_dvd_cube_sub_one_or_add_one_of_lambda_not_dvd {x : 𝓞 K} (h : ¬ λ ∣ x) :
    λ ^ 4 ∣ x ^ 3 - 1 ∨ λ ^ 4 ∣ x ^ 3 + 1

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
{x : 𝓞 K}
(h : ¬hζ.toInteger - 1 ∣ x)

(hζ.toInteger - 1) ^ 4 ∣ x ^ 3 - 1 ∨ (hζ.toInteger - 1) ^ 4 ∣ x ^ 3 + 1


lemma Ioc_inr_inr :
    Ioc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(b₁ b₂ : β)

Finset.Ioc (Sum.inrₗ b₁) (Sum.inrₗ b₂) = Finset.map (Function.Embedding.inr.trans toLex.toEmbedding) (Finset.Ioc b₁ b₂)


@[simp]
theorem lists_nil : lists (@nil α) = [([] : List α)]


@[simp]
theorem comp_id (f : P1 →ᵃ[k] P2) : f.comp (id k P1) = f

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(f : P1 →ᵃ[k] P2)


@[to_additive (attr := simp)]
theorem comp_zero : p.comp (1 : F →* E) = 0

{E : Type u_4}
{F : Type u_5}
[AddGroup E]
[AddGroup F]
(p : AddGroupSeminorm E)


theorem measure_univ_ne_zero : μ univ ≠ 0 ↔ μ ≠ 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem closure_eq_of_le {s : Set R} {t : NonUnitalSubring R} (h₁ : s ⊆ t) (h₂ : t ≤ closure s) :
    closure s = t

{R : Type u}
[NonUnitalNonAssocRing R]
{s : Set R}
{t : NonUnitalSubring R}
(h₁ : s ⊆ ↑t)
(h₂ : t ≤ NonUnitalSubring.closure s)


@[fun_prop]
theorem continuousAt_pi' {f : X → ∀ i, π i} {x : X} (hf : ∀ i, ContinuousAt (fun y => f y i) x) :
    ContinuousAt f x

(hf : ∀ (i : ι), ContinuousAt (fun y => f y i) x)


/-- Induction principle for matrices based on transvections: if a property is true for all diagonal
matrices, all transvections, and is stable under product, then it is true for all matrices. This is
the useful way to say that matrices are generated by diagonal matrices and transvections.

We state a slightly more general version: to prove a property for a matrix `M`, it suffices to
assume that the diagonal matrices we consider have the same determinant as `M`. This is useful to
obtain similar principles for `SLₙ` or `GLₙ`. -/
theorem diagonal_transvection_induction (P : Matrix n n 𝕜 → Prop) (M : Matrix n n 𝕜)
    (hdiag : ∀ D : n → 𝕜, det (diagonal D) = det M → P (diagonal D))
    (htransvec : ∀ t : TransvectionStruct n 𝕜, P t.toMatrix) (hmul : ∀ A B, P A → P B → P (A * B)) :
    P M

(hdiag : ∀ (D : n → 𝕜), (Matrix.diagonal D).det = M.det → P (Matrix.diagonal D))

(htransvec : ∀ (t : Matrix.TransvectionStruct n 𝕜), P t.toMatrix)

(hmul : ∀ (A B : Matrix n n 𝕜), P A → P B → P (A * B))


theorem get_prodLift (f : α →. β) (g : α →. γ) (x : α) (h) :
    (f.prodLift g x).get h = ((f x).get h.1, (g x).get h.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α →. β)
(g : α →. γ)
(x : α)
(h : (f.prodLift g x).Dom)

(f.prodLift g x).get h = ((f x).get ⋯, (g x).get ⋯)


/-- The identity functor on `C`, viewed as a functor from `C` to its
monoidal opposite, upgraded to a braided functor. -/
@[simps!] def mopBraidedFunctor : BraidedFunctor C Cᴹᵒᵖ

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]

(CategoryTheory.MonoidalOpposite.mopBraidedFunctor C).ε.unmop = 𝟙 (𝟙_ C)


theorem iSup_le_le {α : Type*} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
    f k ≤ fun x ↦ ⨆ (k) (_ : k ≤ n), f k x

{α : Type u_3}
(f : ℕ → α → ℝ≥0∞)
(n k : ℕ)
(hk : k ≤ n)

f k ≤ fun x => ⨆ k, ⨆ (_ : k ≤ n), f k x


/-- Negating the second vector passed to `oangle` adds `π` to the angle. -/
theorem oangle_neg_right {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    o.oangle x (-y) = o.oangle x y + π

[Fact (FiniteDimensional.finrank ℝ V = 2)]


@[simp]
theorem restrictScalars_toSubmodule {U : Subalgebra S A} :
    Subalgebra.toSubmodule (U.restrictScalars R) = U.toSubmodule.restrictScalars R

(R : Type u)
{S : Type v}
{A : Type w}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]
{U : Subalgebra S A}

Subalgebra.toSubmodule (Subalgebra.restrictScalars R U) = Submodule.restrictScalars R (Subalgebra.toSubmodule U)


@[simp]
theorem map_smul_of_tower {R S : Type*} [Semiring S] [SMul R M₁] [Module S M₁] [SMul R M₂]
    [Module S M₂] [LinearMap.CompatibleSMul M₁ M₂ R S] (f : M₁ →L[S] M₂) (c : R) (x : M₁) :
    f (c • x) = c • f x

{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{R : Type u_9}
{S : Type u_10}
[Semiring S]
[SMul R M₁]
[Module S M₁]
[SMul R M₂]
[Module S M₂]
[LinearMap.CompatibleSMul M₁ M₂ R S]
(f : M₁ →L[S] M₂)
(c : R)
(x : M₁)


@[to_additive]
theorem noncommPiCoprod_range
    {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y} :
    (noncommPiCoprod hcomm).range = ⨆ i : ι, H i

{hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → Commute x y}

(Subgroup.noncommPiCoprod hcomm).range = ⨆ i, H i


theorem remainingBytes_le : ∀ {it}, Valid it → it.remainingBytes ≤ utf8ByteSize it.s

it.Valid → it.remainingBytes ≤ it.s.utf8ByteSize


@[simp]
theorem rcomap_compose (r : Rel α β) (s : Rel β γ) : rcomap r ∘ rcomap s = rcomap (r.comp s)

{α : Type u}
{β : Type v}
{γ : Type w}
(r : Rel α β)
(s : Rel β γ)

Filter.rcomap r ∘ Filter.rcomap s = Filter.rcomap (r.comp s)


@[simp]
theorem realize_toPrenex (φ : L.BoundedFormula α n) {v : α → M} :
    ∀ {xs : Fin n → M}, φ.toPrenex.Realize v xs ↔ φ.Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
[Nonempty M]
(φ : L.BoundedFormula α n)
{v : α → M}
{xs : Fin n → M}


/-- The canonical isomorphism `K.homology i ≅ K.opcycles i`
when the differential from `i` is zero. -/
@[simps! hom]
noncomputable def isoHomologyι : K.homology i ≅ K.opcycles i

(K.isoHomologyι i j hj h).hom = K.homologyι i


protected theorem prod_mk_left (a : α) : LipschitzWith 1 (Prod.mk a : β → α × β)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(a : α)


theorem pullback_comp {f : Y ⟶ X} {g : Z ⟶ Y} (S : Sieve X) :
    S.pullback (g ≫ f) = (S.pullback f).pullback g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
{f : Y ⟶ X}
{g : Z ⟶ Y}
(S : CategoryTheory.Sieve X)

CategoryTheory.Sieve.pullback (CategoryTheory.CategoryStruct.comp g f) S =
  CategoryTheory.Sieve.pullback g (CategoryTheory.Sieve.pullback f S)


theorem map_iff_of_injective [MonoidHomClass F M N] (hf : Injective f) :
    IsPrimitiveRoot (f ζ) k ↔ IsPrimitiveRoot ζ k

{M : Type u_1}
{N : Type u_2}
{F : Type u_6}
[CommMonoid M]
[CommMonoid N]
{k : ℕ}
{ζ : M}
{f : F}
[FunLike F M N]
[MonoidHomClass F M N]
(hf : Function.Injective ⇑f)


theorem tensorLeftHomEquiv_symm_naturality {X X' Y Y' Z : C} [ExactPairing Y Y'] (f : X ⟶ X')
    (g : X' ⟶ Y ⊗ Z) :
    (tensorLeftHomEquiv X Y Y' Z).symm (f ≫ g) =
      _ ◁ f ≫ (tensorLeftHomEquiv X' Y Y' Z).symm g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X X' Y Y' Z : C}
[CategoryTheory.ExactPairing Y Y']
(f : X ⟶ X')
(g : X' ⟶ Y ⊗ Z)

(CategoryTheory.tensorLeftHomEquiv X Y Y' Z).symm (f ≫ g) =
  Y' ◁ f ≫ (CategoryTheory.tensorLeftHomEquiv X' Y Y' Z).symm g


@[to_additive]
theorem mul_lt_mul_of_lt_of_le [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} (h₁ : a < b) (h₂ : c ≤ d) :
    a * c < b * d

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]


theorem map_comap_incl {I₁ I₂ : LieIdeal R L} : map I₁.incl (comap I₁.incl I₂) = I₁ ⊓ I₂

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I₁ I₂ : LieIdeal R L}

LieIdeal.map I₁.incl (LieIdeal.comap I₁.incl I₂) = I₁ ⊓ I₂


@[simp]
theorem smul_bot (a : α) : a • (⊥ : Subgroup G) = ⊥

{α : Type u_1}
{G : Type u_2}
[Group G]
[Monoid α]
[MulDistribMulAction α G]
(a : α)


/-- A connected object `X` of `C` is Galois if the quotient `X / Aut X` is terminal. -/
class IsGalois {C : Type u₁} [Category.{u₂, u₁} C] [GaloisCategory C] (X : C)
    extends IsConnected X : Prop where
  quotientByAutTerminal : Nonempty (IsTerminal <| colimit <| SingleObj.functor <| Aut.toEnd X)

[self : CategoryTheory.PreGaloisCategory.IsGalois X]

Nonempty
  (CategoryTheory.Limits.IsTerminal
    (CategoryTheory.Limits.colimit (CategoryTheory.SingleObj.functor (CategoryTheory.Aut.toEnd X))))


lemma deriv_fourierChar (x : ℝ) : deriv (𝐞 · : ℝ → ℂ) x = 2 * π * I * 𝐞 x

deriv (fun x => ↑(𝐞 x)) x = 2 * ↑π * Complex.I * ↑(𝐞 x)


@[to_additive]
theorem UniformGroup.ext {G : Type*} [Group G] {u v : UniformSpace G} (hu : @UniformGroup G u _)
    (hv : @UniformGroup G v _)
    (h : @nhds _ u.toTopologicalSpace 1 = @nhds _ v.toTopologicalSpace 1) : u = v

{G : Type u_3}
[Group G]
{u v : UniformSpace G}
(hu : UniformGroup G)
(hv : UniformGroup G)
(h : 𝓝 1 = 𝓝 1)


theorem u_top [OrderTop β] {l : α → β} {u : β → α} (gc : GaloisConnection l u) : u ⊤ = ⊤

{α : Type u}
{β : Type v}
[PartialOrder α]
[Preorder β]
[OrderTop α]
[OrderTop β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)


lemma Nonempty.biUnion (hs : s.Nonempty) (ht : ∀ x ∈ s, (t x).Nonempty) :
    (s.biUnion t).Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : α → Finset β}
[DecidableEq β]
(hs : s.Nonempty)
(ht : ∀ x ∈ s, (t x).Nonempty)


protected theorem find_spec : p (PNat.find h)

{p : ℕ+ → Prop}
[DecidablePred p]
(h : ∃ n, p n)


theorem get?_push {a : Array α} : (a.push x)[i]? = if i = a.size then some x else a[i]?

{α : Type u_1}
{x : α}
{i : Nat}
{a : Array α}


theorem Ultrafilter.clusterPt_iff {f : Ultrafilter X} : ClusterPt x f ↔ ↑f ≤ 𝓝 x

{X : Type u}
{x : X}
[TopologicalSpace X]
{f : Ultrafilter X}


/-- The top-left evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₁ : Square C ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square C)

CategoryTheory.Square.evaluation₁.obj sq = sq.X₁


theorem _root_.Continuous.prod_mapL {f : X → M₁ →L[𝕜] M₂} {g : X → M₃ →L[𝕜] M₄} (hf : Continuous f)
    (hg : Continuous g) : Continuous fun x => (f x).prodMap (g x)

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{M₁ : Type u_5}
{M₂ : Type u_6}
{M₃ : Type u_7}
{M₄ : Type u_8}
[SeminormedAddCommGroup M₁]
[NormedSpace 𝕜 M₁]
[SeminormedAddCommGroup M₂]
[NormedSpace 𝕜 M₂]
[SeminormedAddCommGroup M₃]
[NormedSpace 𝕜 M₃]
[SeminormedAddCommGroup M₄]
[NormedSpace 𝕜 M₄]
{X : Type u_9}
[TopologicalSpace X]
{f : X → M₁ →L[𝕜] M₂}
{g : X → M₃ →L[𝕜] M₄}
(hf : Continuous f)
(hg : Continuous g)


/-- An intersection with a meagre set is meagre. -/
lemma IsMeagre.inter {s t : Set X} (hs : IsMeagre s) : IsMeagre (s ∩ t)

{X : Type u_5}
[TopologicalSpace X]
{s t : Set X}
(hs : IsMeagre s)


/-- The second projection on a domain in a product is `C^∞`. -/
theorem contDiffOn_snd {s : Set (E × F)} : ContDiffOn 𝕜 n (Prod.snd : E × F → F) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set (E × F)}


theorem adjugate_eq_one_of_card_eq_one {A : Matrix n n α} (h : Fintype.card n = 1) :
    adjugate A = 1

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
{A : Matrix n n α}
(h : Fintype.card n = 1)


/-- We have lots of lemmas describing how to simplify `colimit.ι F j ≫ _`,
and combined with `colimit.ext` we rely on these lemmas for many calculations.

However, since `Category.assoc` is a `@[simp]` lemma, often expressions are
right associated, and it's hard to apply these lemmas about `colimit.ι`.

We thus use `reassoc` to define additional `@[simp]` lemmas, with an arbitrary extra morphism.
(see `Tactic/reassoc_axiom.lean`)
 -/
@[reassoc (attr := simp)]
theorem colimit.ι_desc {F : J ⥤ C} [HasColimit F] (c : Cocone F) (j : J) :
    colimit.ι F j ≫ colimit.desc F c = c.ι.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
(c : CategoryTheory.Limits.Cocone F)
(j : J)

CategoryTheory.Limits.colimit.ι F j ≫ CategoryTheory.Limits.colimit.desc F c = c.ι.app j


@[to_additive]
theorem isUnit_iff_exists_inv' [CommMonoid M] {a : M} : IsUnit a ↔ ∃ b, b * a = 1

{M : Type u_1}
[AddCommMonoid M]
{a : M}


theorem unop_injective : Function.Injective (unop : αᵒᵖ → α)


theorem sub_le_self (a b : Ordinal) : a - b ≤ a


theorem lim_mul (f : CauSeq β abv) (x : β) : lim f * x = lim (f * const abv x)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
[CauSeq.IsComplete β abv]
(f : CauSeq β abv)
(x : β)

f.lim * x = (f * CauSeq.const abv x).lim


/-- Auxiliary definition for `extFunctor`. -/
@[simps]
noncomputable def extFunctorObj (X : C) (n : ℕ) : C ⥤ AddCommGrp.{w}

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(X : C)
(n : ℕ)
(Y : C)

(CategoryTheory.Abelian.extFunctorObj X n).obj Y = AddCommGrp.of (CategoryTheory.Abelian.Ext X Y n)


theorem csupr_ne_top [SupSet α] (f : ℝ≥0∞ → α) : ⨆ x : { x // x ≠ ∞ }, f x = ⨆ x : ℝ≥0, f x

{α : Type u_1}
[SupSet α]
(f : ℝ≥0∞ → α)


/-- The isomorphism `S₁.rightHomology ≅ S₂.rightHomology` induced by an isomorphism of
short complexes `S₁ ≅ S₂`. -/
@[simps]
noncomputable def rightHomologyMapIso (e : S₁ ≅ S₂) [S₁.HasRightHomology]
    [S₂.HasRightHomology] : S₁.rightHomology ≅ S₂.rightHomology

(CategoryTheory.ShortComplex.rightHomologyMapIso e).hom = CategoryTheory.ShortComplex.rightHomologyMap e.hom


theorem nat_iff {f : ℕ → ℕ} : Primrec f ↔ Nat.Primrec f


theorem image_comp_eq {g : β → γ} : image (g ∘ f) = image g ∘ image f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{g : β → γ}

Set.image (g ∘ f) = Set.image g ∘ Set.image f


protected theorem map₂_eq_mapAccumr₂ :
    map₂ f xs ys = (mapAccumr₂ (fun x y (_ : Unit) ↦ ((), f x y)) xs ys ()).snd

{α : Type}
{n : ℕ}
{β : Type}
{xs : Mathlib.Vector α n}
{ys : Mathlib.Vector β n}

∀ {α_1 : Type} {f : α → β → α_1},
  Mathlib.Vector.map₂ f xs ys = (Mathlib.Vector.mapAccumr₂ (fun x y x_1 => ((), f x y)) xs ys ()).2


@[to_additive (attr := simp)]
theorem mrange_lift (f : M →* P) (g : N →* P) :
    MonoidHom.mrange (lift f g) = MonoidHom.mrange f ⊔ MonoidHom.mrange g

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[Monoid P]
(f : M →* P)
(g : N →* P)

MonoidHom.mrange (Monoid.Coprod.lift f g) = MonoidHom.mrange f ⊔ MonoidHom.mrange g


lemma deleteEdges_anti (h : s₁ ⊆ s₂) : G.deleteEdges s₂ ≤ G.deleteEdges s₁

{V : Type u}
{G : SimpleGraph V}
{s₁ s₂ : Set (Sym2 V)}
(h : s₁ ⊆ s₂)


theorem wbtw_iff_right_eq_or_left_mem_image_Ici {x y z : P} :
    Wbtw R x y z ↔ z = y ∨ x ∈ lineMap z y '' Set.Ici (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}

Wbtw R x y z ↔ z = y ∨ x ∈ ⇑(AffineMap.lineMap z y) '' Set.Ici 1


@[to_additive (attr := simp, norm_cast)]
theorem val_eq_one {a : αˣ} : (a : α) = 1 ↔ a = 1


theorem surjective_respectsIso : RespectsIso surjective

RingHom.RespectsIso fun {X Y} [CommRing X] [CommRing Y] f => Function.Surjective ⇑f


/-- A time-reversed version of `ODE_solution_unique_of_mem_Icc_right`. Uniqueness is shown in a
closed interval `Icc a b`, where `b` is the "initial" time. -/
theorem ODE_solution_unique_of_mem_Icc_left
    (hf : ContinuousOn f (Icc a b))
    (hf' : ∀ t ∈ Ioc a b, HasDerivWithinAt f (v t (f t)) (Iic t) t)
    (hfs : ∀ t ∈ Ioc a b, f t ∈ s t)
    (hg : ContinuousOn g (Icc a b))
    (hg' : ∀ t ∈ Ioc a b, HasDerivWithinAt g (v t (g t)) (Iic t) t)
    (hgs : ∀ t ∈ Ioc a b, g t ∈ s t)
    (hb : f b = g b) :
    EqOn f g (Icc a b)

(hv : ∀ (t : ℝ), LipschitzOnWith K (v t) (s t))

(hf' : ∀ t ∈ Set.Ioc a b, HasDerivWithinAt f (v t (f t)) (Set.Iic t) t)

(hg' : ∀ t ∈ Set.Ioc a b, HasDerivWithinAt g (v t (g t)) (Set.Iic t) t)


@[to_additive]
theorem map_mul [Mul β] [Mul γ] {g : β → γ} (hg : ∀ x y, g (x * y) = g x * g y) (f₁ f₂ : α →ₛ β) :
    (f₁ * f₂).map g = f₁.map g * f₂.map g

(hg : ∀ (x y : β), g (x + y) = g x + g y)

MeasureTheory.SimpleFunc.map g (f₁ + f₂) = MeasureTheory.SimpleFunc.map g f₁ + MeasureTheory.SimpleFunc.map g f₂


/-- Ad hoc class stating that the closure of an upper set is an upper set. This is used to state
lemmas that do not mention algebraic operations for both the additive and multiplicative versions
simultaneously. If you find a satisfying replacement for this typeclass, please remove it! -/
class HasUpperLowerClosure (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  isUpperSet_closure : ∀ s : Set α, IsUpperSet s → IsUpperSet (closure s)
  isLowerSet_closure : ∀ s : Set α, IsLowerSet s → IsLowerSet (closure s)
  isOpen_upperClosure : ∀ s : Set α, IsOpen s → IsOpen (upperClosure s : Set α)
  isOpen_lowerClosure : ∀ s : Set α, IsOpen s → IsOpen (lowerClosure s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : HasUpperLowerClosure α]
(s : Set α)


theorem ae_eq_trim_of_measurable {α E} {m m0 : MeasurableSpace α} {μ : Measure α}
    [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E] [MeasurableSub₂ E]
    (hm : m ≤ m0) {f g : α → E} (hf : Measurable[m] f) (hg : Measurable[m] g) (hfg : f =ᵐ[μ] g) :
    f =ᵐ[μ.trim hm] g

{α : Type u_4}
{E : Type u_5}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSpace E]
[AddGroup E]
[MeasurableSingletonClass E]
[MeasurableSub₂ E]
(hm : m ≤ m0)
{f g : α → E}
(hf : Measurable f)
(hg : Measurable g)
(hfg : f =ᵐ[μ] g)


/-- In a cancellative monoid of exponent two, all elements commute. -/
@[to_additive]
lemma mul_comm_of_exponent_two [IsCancelMul G] (hG : Monoid.exponent G = 2) (a b : G) :
    a * b = b * a

{G : Type u}
[AddMonoid G]
[IsCancelAdd G]
(hG : AddMonoid.exponent G = 2)
(a b : G)


@[simp]
theorem comapDomain_zero [∀ i, Zero (β i)] (h : κ → ι) (hh : Function.Injective h) :
    comapDomain h hh (0 : Π₀ i, β i) = 0

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[(i : ι) → Zero (β i)]
(h : κ → ι)
(hh : Function.Injective h)


theorem candidatesBDist_mem_candidatesB : candidatesBDist X Y ∈ candidatesB X Y

{X : Type u}
{Y : Type v}
[MetricSpace X]
[CompactSpace X]
[Nonempty X]
[MetricSpace Y]
[CompactSpace Y]
[Nonempty Y]

GromovHausdorff.candidatesBDist X Y ∈ GromovHausdorff.candidatesB X Y


@[simp]
theorem degree_toSubring : (toSubring p T hp).degree = p.degree

{R : Type u}
[Ring R]
(p : R[X])
(T : Subring R)
(hp : ↑p.coeffs ⊆ ↑T)


theorem forget_bddLat_lat_eq_forget_distLat_lat :
    forget₂ BddDistLat BddLat ⋙ forget₂ BddLat Lat =
      forget₂ BddDistLat DistLat ⋙ forget₂ DistLat Lat

CategoryTheory.forget₂ BddDistLat BddLat ⋙ CategoryTheory.forget₂ BddLat Lat =
  CategoryTheory.forget₂ BddDistLat DistLat ⋙ CategoryTheory.forget₂ DistLat Lat


@[to_additive (attr := simp)]
theorem mul_bot : f * ⊥ = ⊥


theorem mkRat_add_mkRat (n₁ n₂ : Int) {d₁ d₂} (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    mkRat n₁ d₁ + mkRat n₂ d₂ = mkRat (n₁ * d₂ + n₂ * d₁) (d₁ * d₂)

(n₁ n₂ : Int)
{d₁ d₂ : Nat}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)

mkRat n₁ d₁ + mkRat n₂ d₂ = mkRat (n₁ * ↑d₂ + n₂ * ↑d₁) (d₁ * d₂)


/-- Given a cone `c` over `F`, we can interpret the legs of `c` as structured arrows
    `c.pt ⟶ F.obj -`. -/
@[simps]
def Cone.toStructuredArrow {F : J ⥤ C} (c : Cone F) : J ⥤ StructuredArrow c.pt F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cone F)

∀ {X Y : J} (f : X ⟶ Y), c.toStructuredArrow.map f = CategoryTheory.StructuredArrow.homMk f ⋯


@[simp]
theorem mk_prod_swap_eq {p : α × α} : Sym2.mk p.swap = Sym2.mk p


/-- Translation in the domain does not change the derivative. -/
lemma HasDerivAt.comp_add_const {𝕜 : Type*} [NontriviallyNormedField 𝕜] (x a : 𝕜) {𝕜' : Type*}
    [NormedAddCommGroup 𝕜'] [NormedSpace 𝕜 𝕜'] {h : 𝕜 → 𝕜'} {h' : 𝕜'}
    (hh : HasDerivAt h h' (x + a)) :
    HasDerivAt (fun x ↦ h (x + a)) h' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(x a : 𝕜)
{𝕜' : Type u_2}
[NormedAddCommGroup 𝕜']
[NormedSpace 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
(hh : HasDerivAt h h' (x + a))


@[simp, norm_cast]
theorem toFinsupp_apply (i : ℕ) : (l.toFinsupp : ℕ → M) i = l.getD i 0

{M : Type u_1}
[Zero M]
(l : List M)
[DecidablePred fun x => l.getD x 0 ≠ 0]
(i : ℕ)


theorem Ico_succ_left_of_not_isMax (ha : ¬IsMax a) : Ico (succ a) b = Ioo a b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(ha : ¬IsMax a)


@[simp]
theorem graph_inj {f g : α →₀ M} : f.graph = g.graph ↔ f = g

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f g : α →₀ M}


@[simp] lemma ground_subset_closure_iff : M.E ⊆ M.closure X ↔ M.closure X = M.E

{α : Type u_2}
{M : Matroid α}
{X : Set α}


@[to_additive nsmul_pos_iff]
theorem one_lt_pow_iff {x : M} {n : ℕ} (hn : n ≠ 0) : 1 < x ^ n ↔ 1 < x

[CovariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


/-- The inductively defined smallest congruence relation containing a binary relation `r` equals
    the infimum of the set of congruence relations containing `r`. -/
@[to_additive addConGen_eq "The inductively defined smallest additive congruence relation
containing a binary relation `r` equals the infimum of the set of additive congruence relations
containing `r`."]
theorem conGen_eq (r : M → M → Prop) : conGen r = sInf { s : Con M | ∀ x y, r x y → s x y }

{M : Type u_1}
[Mul M]
(r : M → M → Prop)

conGen r = sInf {s | ∀ (x y : M), r x y → s x y}


/-- Asserts that `¬⟦c⟧_v` implies `p`. -/
structure Clause.reify (v : Valuation) (c : Clause) (p : Prop) : Prop where
  prop : ¬ v.satisfies c → p

{v : Sat.Valuation}
{c : Sat.Clause}
{p : Prop}
(self : Sat.Clause.reify v c p)


theorem minimalPeriod_snd_dvd : minimalPeriod g x.2 ∣ minimalPeriod (Prod.map f g) x

{α : Type u_1}
{β : Type u_2}
{f : α → α}
{g : β → β}
{x : α × β}

Function.minimalPeriod g x.2 ∣ Function.minimalPeriod (Prod.map f g) x


@[simp]
theorem fst_sub [Sub R] [Sub M] (x₁ x₂ : tsze R M) : (x₁ - x₂).fst = x₁.fst - x₂.fst

{R : Type u}
{M : Type v}
[Sub R]
[Sub M]
(x₁ x₂ : tsze R M)


theorem cancel_factors_eq_div {α} [Field α] {n e e' : α}
    (h : n * e = e') (h2 : n ≠ 0) : e = e' / n

{α : Type u_1}
[Field α]
{n e e' : α}
(h : n * e = e')
(h2 : n ≠ 0)


theorem mem_span_singleton_self (x : M) : x ∈ R ∙ x

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


/-- The map `Square C → Square Cᵒᵖ` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def op (sq : Square C) : Square Cᵒᵖ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square C)


@[simp]
theorem dlookup_cons_eq (l) (a : α) (b : β a) : dlookup a (⟨a, b⟩ :: l) = some b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(l : List (Sigma β))
(a : α)
(b : β a)


/-- If `a ≤ b + c`, `b ≠ ∞`, and `c ≠ ∞`, then
`ENNReal.toReal a ≤ ENNReal.toReal b + ENNReal.toReal c`. This lemma is useful to transfer
triangle-like inequalities from `ENNReal`s to `Real`s. -/
theorem toReal_le_add (hle : a ≤ b + c) (hb : b ≠ ∞) (hc : c ≠ ∞) :
    a.toReal ≤ b.toReal + c.toReal

{a b c : ℝ≥0∞}
(hle : a ≤ b + c)
(hb : b ≠ ⊤)
(hc : c ≠ ⊤)


theorem AntisymmRel.wcovBy (h : AntisymmRel (· ≤ ·) a b) : a ⩿ b

(h : AntisymmRel (fun x x_1 => x ≤ x_1) a b)


theorem mul_le_mul_right {M N P : AddSubmonoid R} (h : N ≤ P) : M * N ≤ M * P

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
{M N P : AddSubmonoid R}
(h : N ≤ P)


@[to_additive card_nsmul_le_sum]
lemma pow_card_le_prod [Preorder M] [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] (l : List M) (n : M) (h : ∀ x ∈ l, n ≤ x) :
    n ^ l.length ≤ l.prod

[CovariantClass M M (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem comp_assoc (f : E₃ →ₛₗᵢ[σ₃₄] E₄) (g : E₂ →ₛₗᵢ[σ₂₃] E₃) (h : E →ₛₗᵢ[σ₁₂] E₂) :
    (f.comp g).comp h = f.comp (g.comp h)

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{R₄ : Type u_4}
{E : Type u_5}
{E₂ : Type u_6}
{E₃ : Type u_7}
{E₄ : Type u_8}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[Semiring R₄]
{σ₁₂ : R →+* R₂}
{σ₁₃ : R →+* R₃}
{σ₁₄ : R →+* R₄}
{σ₂₃ : R₂ →+* R₃}
{σ₂₄ : R₂ →+* R₄}
{σ₃₄ : R₃ →+* R₄}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomCompTriple σ₁₂ σ₂₄ σ₁₄]
[RingHomCompTriple σ₂₃ σ₃₄ σ₂₄]
[RingHomCompTriple σ₁₃ σ₃₄ σ₁₄]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[SeminormedAddCommGroup E₃]
[SeminormedAddCommGroup E₄]
[Module R E]
[Module R₂ E₂]
[Module R₃ E₃]
[Module R₄ E₄]
(f : E₃ →ₛₗᵢ[σ₃₄] E₄)
(g : E₂ →ₛₗᵢ[σ₂₃] E₃)
(h : E →ₛₗᵢ[σ₁₂] E₂)


theorem split_eq_scale_split' : ∀ {o o' m} [NF o], split' o = (o', m) → split o = (scale 1 o', m)

o.split' = (o', m) → o.split = (ONote.scale 1 o', m)


protected lemma Filter.Tendsto.dist {f g : β → α} {x : Filter β} {a b : α}
    (hf : Tendsto f x (𝓝 a)) (hg : Tendsto g x (𝓝 b)) :
    Tendsto (fun x => dist (f x) (g x)) x (𝓝 (dist a b))

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
{f g : β → α}
{x : Filter β}
{a b : α}
(hf : Filter.Tendsto f x (𝓝 a))
(hg : Filter.Tendsto g x (𝓝 b))

Filter.Tendsto (fun x => dist (f x) (g x)) x (𝓝 (dist a b))


@[to_additive (attr := simp)]
theorem inv_pure : (pure a)⁻¹ = pure a⁻¹

{α : Type u_2}
[OrderedCommGroup α]
(a : α)

(NonemptyInterval.pure a)⁻¹ = NonemptyInterval.pure a⁻¹


@[simp, norm_cast] lemma coe_compls : (↑sᶜˢ : Set α) = compl '' ↑s

{α : Type u_2}
[BooleanAlgebra α]
(s : Finset α)


@[reassoc (attr := simp)]
theorem sigma_condition : I.fstSigmaMap ≫ Sigma.desc K.π = I.sndSigmaMap ≫ Sigma.desc K.π

{I : CategoryTheory.Limits.MultispanIndex C}

(K : CategoryTheory.Limits.Multicofork I)

CategoryTheory.CategoryStruct.comp I.fstSigmaMap (CategoryTheory.Limits.Sigma.desc K.π) =
  CategoryTheory.CategoryStruct.comp I.sndSigmaMap (CategoryTheory.Limits.Sigma.desc K.π)


theorem nnnorm_mul_toNNReal (x : ℝ) {y : ℝ} (hy : 0 ≤ y) : ‖x‖₊ * y.toNNReal = ‖x * y‖₊


{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{t : Set α}


theorem dvd_iff_isRoot : X - C a ∣ p ↔ IsRoot p a

{R : Type u}
{a : R}
[CommRing R]
{p : R[X]}

Polynomial.X - Polynomial.C a ∣ p ↔ p.IsRoot a


@[simp]
theorem coe_equivMapOfInjective_apply (f : F) (i : Injective f) (p : Submodule R M) (x : p) :
    (equivMapOfInjective f i p x : M₂) = f x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)
(i : Function.Injective ⇑f)
(p : Submodule R M)
(x : ↥p)

↑((Submodule.equivMapOfInjective f i p) x) = f ↑x


@[to_additive]
theorem inv_unique (hy : x * y = 1) (hz : x * z = 1) : y = z

{M : Type u_4}
[CommMonoid M]
{x y z : M}
(hy : x * y = 1)
(hz : x * z = 1)


@[simp]
theorem coe_eq_nil (l : List α) : (l : Cycle α) = nil ↔ l = []


theorem Ideal.prod_le_prime {ι : Type*} {s : Finset ι} {f : ι → Ideal R} {P : Ideal R}
    [hP : P.IsPrime] : ∏ i ∈ s, f i ≤ P ↔ ∃ i ∈ s, f i ≤ P

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
{ι : Type u_4}
{s : Finset ι}
{f : ι → Ideal R}
{P : Ideal R}
[hP : P.IsPrime]


@[to_additive (attr := simp)]
theorem smul_finset_subset_smul_finset_iff : a • s ⊆ a • t ↔ s ⊆ t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[Group α]
[MulAction α β]
{s t : Finset β}
{a : α}


/-- The members of `l.ranges` are pairwise disjoint -/
theorem ranges_disjoint (l : List ℕ) :
    Pairwise Disjoint (ranges l)


theorem trailingDegree_eq_natTrailingDegree (hp : p ≠ 0) :
    trailingDegree p = (natTrailingDegree p : ℕ∞)

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p ≠ 0)


@[to_additive sum_eq_zero_iff_of_nonneg]
theorem prod_eq_one_iff_of_one_le' :
    (∀ i ∈ s, 1 ≤ f i) → ((∏ i ∈ s, f i) = 1 ↔ ∀ i ∈ s, f i = 1)

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
{f : ι → N}
{s : Finset ι}

(∀ i ∈ s, 1 ≤ f i) → (∏ i ∈ s, f i = 1 ↔ ∀ i ∈ s, f i = 1)


@[simp]
theorem coe_liftHom (x : S) (hfx : aeval x f = 0) :
    (liftHom f x hfx : AdjoinRoot f →+* S) = lift (algebraMap R S) x hfx

{R : Type u}
{S : Type v}
[CommRing R]
(f : R[X])
[CommRing S]
[Algebra R S]
(x : S)
(hfx : (Polynomial.aeval x) f = 0)

↑(AdjoinRoot.liftHom f x hfx) = AdjoinRoot.lift (algebraMap R S) x hfx


theorem submatrix_one [Zero α] [One α] [DecidableEq m] [DecidableEq l] (e : l → m)
    (he : Function.Injective e) : (1 : Matrix m m α).submatrix e e = 1

{l : Type u_1}
{m : Type u_2}
{α : Type v}
[Zero α]
[One α]
[DecidableEq m]
[DecidableEq l]
(e : l → m)
(he : Function.Injective e)


@[gcongr]
theorem toNNReal_strict_mono (hb : b ≠ ∞) (h : a < b) : a.toNNReal < b.toNNReal


theorem sub_const_eq_X_mul_shift (φ : R⟦X⟧) :
    φ - C R (constantCoeff R φ) = X * mk fun p ↦ coeff R (p + 1) φ

{R : Type u_1}
[Ring R]
(φ : PowerSeries R)

φ - (PowerSeries.C R) ((PowerSeries.constantCoeff R) φ) =
  PowerSeries.X * PowerSeries.mk fun p => (PowerSeries.coeff R (p + 1)) φ


@[simp]
theorem eval_algebraMap {S : Type*} [CommSemiring S] [Algebra S K[X]] (p : S) :
    eval f a (algebraMap _ _ p) = (algebraMap _ K[X] p).eval₂ f a

{K : Type u}
[Field K]
{L : Type u}
[Field L]
(f : K →+* L)
(a : L)
{S : Type u_1}
[CommSemiring S]
[Algebra S (Polynomial K)]
(p : S)

RatFunc.eval f a ((algebraMap S (RatFunc K)) p) = Polynomial.eval₂ f a ((algebraMap S (Polynomial K)) p)


@[reassoc (attr := simp)]
lemma isoHomologyι_inv_hom_id :
    (K.isoHomologyι i j hj h).inv ≫ K.homologyι i = 𝟙 _

(K.isoHomologyι i j hj h).inv ≫ K.homologyι i = 𝟙 (K.opcycles i)


theorem degree_eq_natDegree (hp : p ≠ 0) : degree p = (natDegree p : WithBot ℕ)


theorem map_ofNat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
    (f : F) (n : ℕ) [n.AtLeastTwo] :
    f (OfNat.ofNat n) = f 0 + (OfNat.ofNat n : ℕ) • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddMonoidWithOne G]
[AddMonoid H]
[AddConstMapClass F G H 1 b]
(f : F)
(n : ℕ)
[n.AtLeastTwo]

f (OfNat.ofNat n) = f 0 + OfNat.ofNat n • b


theorem image_coe_Ioi : (some : α → WithTop α) '' Ioi a = Ioo (a : WithTop α) ⊤

WithTop.some '' Set.Ioi a = Set.Ioo ↑a ⊤


/-- The `v`-adic valuation of a sum is bounded above by the maximum of the valuations. -/
theorem intValuation.map_add_le_max' (x y : R) :
    v.intValuationDef (x + y) ≤ max (v.intValuationDef x) (v.intValuationDef y)

(v : IsDedekindDomain.HeightOneSpectrum R)


/-- The upper part of the second column of the snake diagram is exact. -/
lemma exact_C₂_up : (ShortComplex.mk S.v₀₁.τ₂ S.v₁₂.τ₂
    (by rw [← comp_τ₂, S.w₀₂, zero_τ₂])).Exact

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.ShortComplex.mk S.v₀₁.τ₂ S.v₁₂.τ₂ ⋯).Exact


protected theorem mul_right_comm (a b c : Int) : a * b * c = a * c * b


/-- If a linear order has no elements `x < y < z`, then it has at most two elements. -/
lemma eq_or_eq_or_eq_of_forall_not_lt_lt [LinearOrder α]
    (h : ∀ ⦃x y z : α⦄, x < y → y < z → False) (x y z : α) : x = y ∨ y = z ∨ x = z


theorem biproduct.map_eq_map' {f g : J → C} [HasBiproduct f] [HasBiproduct g] (p : ∀ b, f b ⟶ g b) :
    biproduct.map p = biproduct.map' p

CategoryTheory.Limits.biproduct.map p = CategoryTheory.Limits.biproduct.map' p


/-- We say that a type has `MeasurableSup` if `(c ⊔ ·)` and `(· ⊔ c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· ⊔ ·)` see `MeasurableSup₂`. -/
class MeasurableSup (M : Type*) [MeasurableSpace M] [Sup M] : Prop where
  measurable_const_sup : ∀ c : M, Measurable (c ⊔ ·)
  measurable_sup_const : ∀ c : M, Measurable (· ⊔ c)

{M : Type u_1}
[MeasurableSpace M]
[Sup M]
[self : MeasurableSup M]
(c : M)


theorem _root_.OrderIso.apply_bliminf [CompleteLattice γ] (e : α ≃o γ) :
    e (bliminf u f p) = bliminf (e ∘ u) f p

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u : β → α}
[CompleteLattice γ]
(e : α ≃o γ)

e (Filter.bliminf u f p) = Filter.bliminf (⇑e ∘ u) f p


theorem Orthonormal.orthogonalFamily {v : ι → E} (hv : Orthonormal 𝕜 v) :
    OrthogonalFamily 𝕜 (fun _i : ι => 𝕜) fun i => LinearIsometry.toSpanSingleton 𝕜 E (hv.1 i)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)

OrthogonalFamily 𝕜 (fun _i => 𝕜) fun i => LinearIsometry.toSpanSingleton 𝕜 E ⋯


theorem colorable_chromaticNumber_of_fintype (G : SimpleGraph V) [Finite V] :
    G.Colorable (ENat.toNat G.chromaticNumber)

{V : Type u}
(G : SimpleGraph V)
[Finite V]


theorem einfsep_iUnion_mem_option {ι : Type*} (o : Option ι) (s : ι → Set α) :
    (⋃ i ∈ o, s i).einfsep = ⨅ i ∈ o, (s i).einfsep

{α : Type u_1}
[EDist α]
{ι : Type u_3}
(o : Option ι)
(s : ι → Set α)


/-- The unit isomorphism of the equivalence -/
@[simps!]
def unitIso : 𝟭 (Karoubi C) ≅ toKaroubi (Karoubi C) ⋙ inverse C

(X : CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.KaroubiKaroubi.unitIso C).inv.app X).f = X.p


@[to_additive]
theorem isUnit_iff_mulRight_bijective {a : M} :
    IsUnit a ↔ Function.Bijective (· * a)

IsUnit a ↔ Function.Bijective fun x => x * a


/-- Change a cone on `F : J ⥤ Cᵒᵖ` to a cocone on `F.leftOp : Jᵒᵖ ⥤ C`. -/
@[simps!]
def coconeLeftOpOfCone (c : Cone F) : Cocone F.leftOp

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ Cᵒᵖ}
(c : CategoryTheory.Limits.Cone F)
(X : Jᵒᵖ)

(CategoryTheory.Limits.coconeLeftOpOfCone c).ι.app X = (c.π.app (Opposite.unop X)).unop


/-- Variant of `f.extend_left_inv I`, stated in terms of images. -/
lemma extend_left_inv' (ht : t ⊆ f.source) : ((f.extend I).symm ∘ (f.extend I)) '' t = t

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{t : Set M}
(ht : t ⊆ f.source)

↑(f.extend I).symm ∘ ↑(f.extend I) '' t = t


theorem derivSeries_apply_diag (n : ℕ) (x : E) :
    derivSeries p n (fun _ ↦ x) x = (n + 1) • p (n + 1) fun _ ↦ x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(n : ℕ)
(x : E)

((p.derivSeries n) fun x_1 => x) x = (n + 1) • (p (n + 1)) fun x_1 => x


theorem quasiSeparatedSpace_iff_affine (X : Scheme) :
    QuasiSeparatedSpace X ↔ ∀ U V : X.affineOpens, IsCompact (U ∩ V : Set X)

QuasiSeparatedSpace ↑↑X.toPresheafedSpace ↔ ∀ (U V : ↑X.affineOpens), IsCompact (↑↑U ∩ ↑↑V)


theorem sInf (hS : ∀ s, s ∈ S → ClosedUnder f s) : ClosedUnder f (sInf S)

(hS : ∀ s ∈ S, FirstOrder.Language.ClosedUnder f s)

FirstOrder.Language.ClosedUnder f (sInf S)


theorem quotient_mk_eq_mk [Monoid α] (a : α) : ⟦a⟧ = Associates.mk a


/-- Convergence in Lp implies uniform integrability. -/
theorem unifIntegrable_of_tendsto_Lp (hp : 1 ≤ p) (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
    (hg : Memℒp g p μ) (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)) :
    UnifIntegrable f p μ

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.Memℒp (f n) p μ)

(hfg : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (𝓝 0))


theorem IsSeparating.mono {𝒢 : Set C} (h𝒢 : IsSeparating 𝒢) {ℋ : Set C} (h𝒢ℋ : 𝒢 ⊆ ℋ) :
    IsSeparating ℋ

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{𝒢 : Set C}
(h𝒢 : CategoryTheory.IsSeparating 𝒢)
{ℋ : Set C}
(h𝒢ℋ : 𝒢 ⊆ ℋ)


/-- The supremum of `insert a s` is the maximum of `a` and the supremum of `s`, if `s` is
nonempty and bounded above. -/
theorem csSup_insert (hs : BddAbove s) (sne : s.Nonempty) : sSup (insert a s) = a ⊔ sSup s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(hs : BddAbove s)
(sne : s.Nonempty)


@[simp]
theorem mk_eq_bot_iff [OrderBot α] [OrderBot (Subtype p)] (hbot : p ⊥) {x : α} (hx : p x) :
    (⟨x, hx⟩ : Subtype p) = ⊥ ↔ x = ⊥

{α : Type u}
{p : α → Prop}
[PartialOrder α]
[OrderBot α]
[OrderBot (Subtype p)]
(hbot : p ⊥)
{x : α}
(hx : p x)


theorem succ_ne_zero (o : Ordinal) : succ o ≠ 0


/-- Isomorphism between `M ∗ PUnit` and `M`. -/
@[simps! (config := .asFn)]
def coprodPUnit : M ∗ PUnit ≃* M

⇑(Monoid.MulEquiv.coprodPUnit M).symm = ⇑Monoid.Coprod.inl


theorem IsSt.not_infinite {x : ℝ*} {r : ℝ} (h : IsSt x r) : ¬Infinite x


/-- The preimage of a convex set under an affine map is convex. -/
theorem Convex.affine_preimage (f : E →ᵃ[𝕜] F) {s : Set F} (hs : Convex 𝕜 s) : Convex 𝕜 (f ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
(f : E →ᵃ[𝕜] F)
{s : Set F}
(hs : Convex 𝕜 s)


@[to_additive]
theorem UniformGroup.uniformity_countably_generated [(𝓝 (1 : α)).IsCountablyGenerated] :
    (𝓤 α).IsCountablyGenerated

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
[(𝓝 1).IsCountablyGenerated]


theorem liftProp_inclusion {Q : (H → H) → Set H → H → Prop} (hG : LocalInvariantProp G G Q)
    (hQ : ∀ y, Q id univ y) {U V : Opens M} (hUV : U ≤ V) :
    LiftProp Q (Set.inclusion hUV : U → V)

{H : Type u_1}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{G : StructureGroupoid H}
{Q : (H → H) → Set H → H → Prop}
(hG : G.LocalInvariantProp G Q)
(hQ : ∀ (y : H), Q id Set.univ y)
{U V : TopologicalSpace.Opens M}
(hUV : U ≤ V)

ChartedSpace.LiftProp Q (Set.inclusion hUV)


theorem integralNormalization_coeff_natDegree {f : R[X]} (hf : f ≠ 0) :
    (integralNormalization f).coeff (natDegree f) = 1

{R : Type u}
[Semiring R]
{f : R[X]}
(hf : f ≠ 0)

f.integralNormalization.coeff f.natDegree = 1


@[simp]
theorem Valuation.extendToLocalization_apply_map_apply (a : A) :
    v.extendToLocalization hS B (algebraMap A B a) = v a

{A : Type u_1}
[CommRing A]
{Γ : Type u_2}
[LinearOrderedCommGroupWithZero Γ]
(v : Valuation A Γ)
{S : Submonoid A}
(hS : S ≤ v.supp.primeCompl)
(B : Type u_3)
[CommRing B]
[Algebra A B]
[IsLocalization S B]
(a : A)

(v.extendToLocalization hS B) ((algebraMap A B) a) = v a


/-- If `f` is multilinear, then `f (Σ_{j₁ ∈ A₁} g₁ j₁, ..., Σ_{jₙ ∈ Aₙ} gₙ jₙ)` is the sum of
`f (g₁ (r 1), ..., gₙ (r n))` where `r` ranges over all functions with `r 1 ∈ A₁`, ...,
`r n ∈ Aₙ`. This follows from multilinearity by expanding successively with respect to each
coordinate. -/
theorem map_sum_finset [DecidableEq ι] [Fintype ι] :
    (f fun i => ∑ j ∈ A i, g i j) = ∑ r ∈ piFinset A, f fun i => g i (r i)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
{α : ι → Type u_1}
(g : (i : ι) → α i → M₁ i)
(A : (i : ι) → Finset (α i))
[DecidableEq ι]
[Fintype ι]

(f fun i => ∑ j ∈ A i, g i j) = ∑ r ∈ Fintype.piFinset A, f fun i => g i (r i)


/-- If `ξ` is an irrational real number, then there are infinitely many good
rational approximations to `ξ`. -/
theorem infinite_rat_abs_sub_lt_one_div_den_sq_of_irrational {ξ : ℝ} (hξ : Irrational ξ) :
    {q : ℚ | |ξ - q| < 1 / (q.den : ℝ) ^ 2}.Infinite

{q | |ξ - ↑q| < 1 / ↑q.den ^ 2}.Infinite


@[simp]
theorem deriv_ccos (hc : DifferentiableAt ℂ f x) :
    deriv (fun x => Complex.cos (f x)) x = -Complex.sin (f x) * deriv f x

{f : ℂ → ℂ}
{x : ℂ}
(hc : DifferentiableAt ℂ f x)


/-- This lemma justifies the terminology "invariant" for trace forms. -/
@[simp] lemma lie_traceForm_eq_zero (x : L) : ⁅x, traceForm R L M⁆ = 0

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)


/-- A dependent version of `Subsemigroup.closure_induction`.  -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubsemigroup.closure_induction`. "]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy)) {x} (hx : x ∈ closure s) :
    p x hx

{p : (x : M) → x ∈ AddSubsemigroup.closure s → Prop}

(mul :
  ∀ (x : M) (hx : x ∈ AddSubsemigroup.closure s) (y : M) (hy : y ∈ AddSubsemigroup.closure s),
    p x hx → p y hy → p (x + y) ⋯)


@[to_additive (attr := simp)]
theorem inv_apply [∀ i, Inv <| f i] : x⁻¹ i = (x i)⁻¹

{I : Type u}
{f : I → Type v₁}
(x : (i : I) → f i)
(i : I)
[(i : I) → Inv (f i)]


/-- Pull a subring back to an opposite subring along `MulOpposite.unop` -/
@[simps toSubsemiring]
protected def op (S : Subring R) : Subring Rᵐᵒᵖ


theorem eq_algebraMap_or_inv_eq_algebraMap (hv : Integers v O) (x : F) :
    ∃ a : O, x = algebraMap O F a ∨ x⁻¹ = algebraMap O F a

{F : Type u}
{Γ₀ : Type v}
[Field F]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation F Γ₀}
{O : Type w}
[CommRing O]
[Algebra O F]
(hv : v.Integers O)
(x : F)

∃ a, x = (algebraMap O F) a ∨ x⁻¹ = (algebraMap O F) a


theorem sq_add_sq (p : ℕ) [hp : Fact p.Prime] (x : ZMod p) : ∃ a b : ZMod p, a ^ 2 + b ^ 2 = x

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(x : ZMod p)


@[simp] lemma map_map (r : α → β → Prop) (f₁ : α → γ) (g₁ : β → δ) (f₂ : γ → ε) (g₂ : δ → ζ) :
    Relation.Map (Relation.Map r f₁ g₁) f₂ g₂ = Relation.Map r (f₂ ∘ f₁) (g₂ ∘ g₁)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{ε : Type u_5}
{ζ : Type u_6}
(r : α → β → Prop)
(f₁ : α → γ)
(g₁ : β → δ)
(f₂ : γ → ε)
(g₂ : δ → ζ)


theorem coe_biSup : (↑(⨆ i, ⨆ (_ : p i), f i) : α) = ⨆ i, ⨆ (_ : p i), (f i : α)

{ι : Sort u_1}
{α : Type u_2}
[CompleteLattice α]
{a : α}
(f : ι → ↑(Set.Iic a))
(p : ι → Prop)


@[to_additive (attr := simp)]
theorem card_one : (1 : Finset α).card = 1


@[reassoc]
lemma pullback.condition : pullback.fst f g ≫ f = pullback.snd f g ≫ g

{X Y B : Profinite}
(f : X ⟶ B)
(g : Y ⟶ B)

CategoryTheory.CategoryStruct.comp (Profinite.pullback.fst f g) f =
  CategoryTheory.CategoryStruct.comp (Profinite.pullback.snd f g) g


@[simp]
lemma image_subtype_val_Ioc_Ici {a b : α} (c : Ioc a b) : Subtype.val '' Ici c = Icc c.1 b

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Ioc a b))

Subtype.val '' Set.Ici c = Set.Icc (↑c) b


theorem Monic.isRegular {R : Type*} [Ring R] {p : R[X]} (hp : Monic p) : IsRegular p

{R : Type u_1}
[Ring R]
{p : R[X]}
(hp : p.Monic)


/-- The canonical isomorphism
`Triangle.shiftFunctor C n ≅ Triangle.shiftFunctor C a ⋙ Triangle.shiftFunctor C b`
when `a + b = n`. -/
@[simps!]
noncomputable def Triangle.shiftFunctorAdd' (a b n : ℤ) (h : a + b = n) :
    Triangle.shiftFunctor C n ≅ Triangle.shiftFunctor C a ⋙ Triangle.shiftFunctor C b

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Pretriangulated.Triangle.shiftFunctorAdd' C a b n h).hom.app X).hom₃ =
  (CategoryTheory.shiftFunctorAdd' C a b n h).hom.app X.obj₃


theorem count_injective_image' {f : β → α} (hf : Function.Injective f) {s : Set β}
    (s_mble : MeasurableSet s) (fs_mble : MeasurableSet (f '' s)) : count (f '' s) = count s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Function.Injective f)
{s : Set β}
(s_mble : MeasurableSet s)
(fs_mble : MeasurableSet (f '' s))

MeasureTheory.Measure.count (f '' s) = MeasureTheory.Measure.count s


@[simp]
theorem coe_coe_orderAddMonoidHom (f : α →+*o β) : ⇑(f : α →+o β) = f

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α →+*o β)


theorem involute_involutive : Function.Involutive (involute : _ → CliffordAlgebra Q)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}


theorem ContDiffOn.div [CompleteSpace 𝕜] {f g : E → 𝕜} {n} (hf : ContDiffOn 𝕜 n f s)
    (hg : ContDiffOn 𝕜 n g s) (h₀ : ∀ x ∈ s, g x ≠ 0) : ContDiffOn 𝕜 n (f / g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
[CompleteSpace 𝕜]
{f g : E → 𝕜}
{n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)
(hg : ContDiffOn 𝕜 n g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


theorem integrable_kernel_prod_mk_left (a : α) {s : Set (β × γ)} (hs : MeasurableSet s)
    (h2s : (κ ⊗ₖ η) a s ≠ ∞) : Integrable (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a)

{η : ProbabilityTheory.Kernel (α × β) γ}

MeasureTheory.Integrable (fun b => ((η (a, b)) (Prod.mk b ⁻¹' s)).toReal) (κ a)


theorem iInf_ker_truncate : ⨅ i : ℕ, RingHom.ker (@WittVector.truncate p _ i R _) = ⊥

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]

⨅ i, RingHom.ker (WittVector.truncate i) = ⊥


/-- The product of two nontrivial rings is not a domain -/
theorem false_of_nontrivial_of_product_domain (R S : Type*) [Ring R] [Ring S] [IsDomain (R × S)]
    [Nontrivial R] [Nontrivial S] : False

(R : Type u_9)
(S : Type u_10)
[Ring R]
[Ring S]
[IsDomain (R × S)]
[Nontrivial R]
[Nontrivial S]


@[simp] protected theorem lt_add_one (n : Nat) : n < n + 1


theorem norm_mul_invInterpStrip_le_one_of_mem_verticalClosedStrip (f : ℂ → E) (ε : ℝ) (hε : 0 < ε)
    (z : ℂ) (hd : DiffContOnCl ℂ f (verticalStrip 0 1))
    (hB : BddAbove ((norm ∘ f) '' (verticalClosedStrip 0 1))) (hz : z ∈ verticalClosedStrip 0 1) :
    ‖F f ε z‖ ≤ 1

(hd : DiffContOnCl ℂ f (Complex.HadamardThreeLines.verticalStrip 0 1))

(hB : BddAbove (norm ∘ f '' Complex.HadamardThreeLines.verticalClosedStrip 0 1))

(hz : z ∈ Complex.HadamardThreeLines.verticalClosedStrip 0 1)

‖Complex.HadamardThreeLines.F f ε z‖ ≤ 1


@[to_additive]
theorem mul_right_cancel : a * b = c * b → a = c

{G : Type u_1}
[Add G]
[IsRightCancelAdd G]
{a b c : G}


/-- `Pi.mulSingle i x` is continuous in `x`. -/
-- Porting note (#11215): TODO: restore @[continuity]
@[to_additive "`Pi.single i x` is continuous in `x`."]
theorem continuous_mulSingle [∀ i, One (π i)] [DecidableEq ι] (i : ι) :
    Continuous fun x => (Pi.mulSingle i x : ∀ i, π i)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
[(i : ι) → One (π i)]
[DecidableEq ι]
(i : ι)


/-- Transport dependent functions through an equivalence of the base space.
-/
@[simps]
def piCongrLeft' (P : α → Sort*) (e : α ≃ β) : (∀ a, P a) ≃ ∀ b, P (e.symm b)

{α : Sort u_2}
{β : Sort u_3}
(P : α → Sort u_1)
(e : α ≃ β)
(f : (b : β) → P (e.symm b))
(x : α)

(Equiv.piCongrLeft' P e).symm f x = ⋯ ▸ f (e x)


@[to_additive]
protected lemma MulAction.injective (g : α) : Function.Injective (g • · : β → β)

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(g : α)


lemma map_infs (f : F) (hf) (s t : Finset α) :
    map ⟨f, hf⟩ (s ⊼ t) = map ⟨f, hf⟩ s ⊼ map ⟨f, hf⟩ t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[SemilatticeInf α]
[SemilatticeInf β]
[FunLike F α β]
[InfHomClass F α β]
(f : F)
(hf : Function.Injective ⇑f)
(s t : Finset α)

Finset.map { toFun := ⇑f, inj' := hf } (s ⊼ t) =
  Finset.map { toFun := ⇑f, inj' := hf } s ⊼ Finset.map { toFun := ⇑f, inj' := hf } t


/-- Reinterpret a bot homomorphism as a top homomorphism between the dual lattices. -/
@[simps]
protected def dual :
    BotHom α β ≃ TopHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[LE α]
[OrderBot α]
[LE β]
[OrderBot β]
(f : BotHom α β)
(a : α)


/-- **Fundamental theorem of calculus-1**, local version for any measure.

Let filters `l` and `l'` be related by `[intervalIntegral.FTCFilter a l l']`; let `μ` be a locally
finite measure.  If `f` has a finite limit `c` at `l' ⊓ ae μ`, then
`∫ x in u..v, f x ∂μ = ∫ x in u..v, c ∂μ + o(∫ x in u..v, 1 ∂μ)` as both `u` and `v` tend to `l`.

See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae'` for a version that also works, e.g.,
for `l = l' = Filter.atTop`.

We use integrals of constants instead of measures because this way it is easier to formulate
a statement that works in both cases `u ≤ v` and `v ≤ u`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae
    (hfm : StronglyMeasurableAtFilter f l' μ) (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
    (hu : Tendsto u lt l) (hv : Tendsto v lt l) :
    (fun t => (∫ x in u t..v t, f x ∂μ) - ∫ _ in u t..v t, c ∂μ) =o[lt] fun t =>
      ∫ _ in u t..v t, (1 : ℝ) ∂μ

(hf : Filter.Tendsto f (l' ⊓ MeasureTheory.ae μ) (𝓝 c))

(fun t => ∫ (x : ℝ) in u t..v t, f x ∂μ - ∫ (x : ℝ) in u t..v t, c ∂μ) =o[lt] fun t => ∫ (x : ℝ) in u t..v t, 1 ∂μ


/-- The Yoneda embedding for preadditive categories sends an object `X` to the copresheaf sending an
object `Y` to the group of morphisms `X ⟶ Y`. At each point, we get an additional `End X`-module
structure, see `preadditiveCoyonedaObj`.
-/
@[simps]
def preadditiveCoyoneda : Cᵒᵖ ⥤ C ⥤ AddCommGrp.{v}

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(X : Cᵒᵖ)

CategoryTheory.preadditiveCoyoneda.obj X =
  (CategoryTheory.preadditiveCoyonedaObj X).comp (CategoryTheory.forget₂ (ModuleCat (CategoryTheory.End X)) AddCommGrp)


@[simp 900]
theorem le_inv_iff_mul_le : a ≤ b⁻¹ ↔ a * b ≤ 1


theorem has_antideriv_at_fourier_neg (hT : Fact (0 < T)) {n : ℤ} (hn : n ≠ 0) (x : ℝ) :
    HasDerivAt (fun y : ℝ => (T : ℂ) / (-2 * π * I * n) * fourier (-n) (y : AddCircle T))
      (fourier (-n) (x : AddCircle T)) x

HasDerivAt (fun y => ↑T / (-2 * ↑π * Complex.I * ↑n) * (fourier (-n)) ↑y) ((fourier (-n)) ↑x) x


@[simp]
theorem coeff_monomial [DecidableEq σ] (m n) (a) :
    coeff m (monomial n a : MvPolynomial σ R) = if n = m then a else 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(m n : σ →₀ ℕ)
(a : R)

MvPolynomial.coeff m ((MvPolynomial.monomial n) a) = if n = m then a else 0


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps!]
def unitIso :
    𝟭 (LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C) ≅ laxMonoidalToMon C ⋙ monToLaxMonoidal C

(X : CategoryTheory.LaxMonoidalFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C)

∀ (X_1 : CategoryTheory.Discrete PUnit.{u + 1}),
  ((Mon_.EquivLaxMonoidalFunctorPUnit.unitIso C).hom.app X).app X_1 = 𝟙 (X.obj X_1)


@[reassoc (attr := simp)]
lemma p_fromOpcycles : S.pOpcycles ≫ S.fromOpcycles = S.g

CategoryTheory.CategoryStruct.comp S.pOpcycles S.fromOpcycles = S.g


theorem add_left_cancel_iff [IsLeftCancelAdd α] (ha : a ≠ ⊤) : a + b = a + c ↔ b = c

{α : Type u}
[Add α]
{a b c : WithTop α}
[IsLeftCancelAdd α]
(ha : a ≠ ⊤)


lemma isSplitMono_f (s : S.Splitting) : IsSplitMono S.f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(s : S.Splitting)


/-- The definition of `x ≤ 0` on pre-games, in terms of `⧏ 0`. -/
theorem le_zero_lf {x : PGame} : x ≤ 0 ↔ ∀ i, x.moveLeft i ⧏ 0

x ≤ 0 ↔ ∀ (i : x.LeftMoves), (x.moveLeft i).LF 0


@[simp, norm_cast]
theorem coe_coe : ((I : WithBot (Box ι)) : Set (ι → ℝ)) = I


/-- The braiding isomorphism `X ⊗ Y ≅ Y ⊗ X` in `Dial C`. -/
@[simps!] def braiding (X Y : Dial C) : tensorObj X Y ≅ tensorObj Y X

(X.braiding Y).hom.F =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)


/-- An n-ary version of `Set.mul_mem_mul`. -/
@[to_additive " An n-ary version of `Set.add_mem_add`. "]
theorem multiset_prod_mem_multiset_prod (t : Multiset ι) (f : ι → Set α) (g : ι → α)
    (hg : ∀ i ∈ t, g i ∈ f i) : (t.map g).prod ∈ (t.map f).prod

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
(t : Multiset ι)
(f : ι → Set α)
(g : ι → α)
(hg : ∀ i ∈ t, g i ∈ f i)

(Multiset.map g t).sum ∈ (Multiset.map f t).sum


theorem ExtensionOfMaxAdjoin.extensionToFun_wd (h : Module.Baer R Q) {y : N}
    (x : supExtensionOfMaxSingleton i f y) (a : (extensionOfMax i f).domain)
    (r : R) (eq1 : ↑x = ↑a + r • y) :
    ExtensionOfMaxAdjoin.extensionToFun i f h x =
      (extensionOfMax i f).toLinearPMap a + ExtensionOfMaxAdjoin.extendIdealTo i f h y r

(x : ↥(Module.Baer.supExtensionOfMaxSingleton i f y))

(a : ↥(Module.Baer.extensionOfMax i f).domain)

Module.Baer.ExtensionOfMaxAdjoin.extensionToFun i f h x =
  ↑(Module.Baer.extensionOfMax i f).toLinearPMap a + (Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) r


@[refl]
theorem Lex.refl_left (r : α → α → Prop) (s : β → β → Prop) [IsRefl α r] : ∀ x, Prod.Lex r s x x

{α : Type u_1}
{β : Type u_2}
(r : α → α → Prop)
(s : β → β → Prop)
[IsRefl α r]
(x : α × β)


theorem continuousAt_star {x : R} : ContinuousAt star x

{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]
{x : R}


/-- The `Matrix` version of `inv_add_inv'` -/
theorem inv_add_inv {A B : Matrix n n α} (h : IsUnit A ↔ IsUnit B) :
    A⁻¹ + B⁻¹ = A⁻¹ * (A + B) * B⁻¹

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B : Matrix n n α}
(h : IsUnit A ↔ IsUnit B)


/-- A monic irreducible polynomial over a field `F` of exponential characteristic `q` has
separable degree one if and only if it is of the form `Polynomial.expand F (q ^ n) (X - C y)`
for some `n : ℕ` and `y : F`. -/
theorem natSepDegree_eq_one_iff_of_monic' (q : ℕ) [ExpChar F q] (hm : f.Monic)
    (hi : Irreducible f) : f.natSepDegree = 1 ↔
    ∃ (n : ℕ) (y : F), f = expand F (q ^ n) (X - C y)

{F : Type u}
[Field F]
{f : F[X]}
(q : ℕ)
[ExpChar F q]
(hm : f.Monic)
(hi : Irreducible f)

f.natSepDegree = 1 ↔ ∃ n y, f = (Polynomial.expand F (q ^ n)) (Polynomial.X - Polynomial.C y)


theorem adjoin_eq_range_algebraMap_adjoin :
    (adjoin F S : Set E) = Set.range (algebraMap (adjoin F S) E)

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : Set E)

↑(IntermediateField.adjoin F S) = Set.range ⇑(algebraMap (↥(IntermediateField.adjoin F S)) E)


/-- The linearization of a type `X` on which `G` acts trivially is the trivial `G`-representation
on `k[X]`. -/
@[simps!]
noncomputable def linearizationTrivialIso (X : Type u) :
    (linearization k G).obj (Action.mk X 1) ≅ trivial k G (X →₀ k)

(a : ↑((Rep.linearization k G).obj { V := X, ρ := 1 }).V)

(Rep.linearizationTrivialIso k G X).inv.hom a = a


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.mul [MeasurableMul₂ M] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => f a * g a) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f g : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableMul₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


theorem isPreconnected_univ_pi [∀ i, TopologicalSpace (π i)] {s : ∀ i, Set (π i)}
    (hs : ∀ i, IsPreconnected (s i)) : IsPreconnected (pi univ s)

{ι : Type u_1}
{π : ι → Type u_2}
[(i : ι) → TopologicalSpace (π i)]
{s : (i : ι) → Set (π i)}
(hs : ∀ (i : ι), IsPreconnected (s i))


/-- If `α` and `β` are infinite types, then the cardinality of `α × β` is the maximum
of the cardinalities of `α` and `β`. -/
theorem mul_eq_max {a b : Cardinal} (ha : ℵ₀ ≤ a) (hb : ℵ₀ ≤ b) : a * b = max a b

{a b : Cardinal.{u_1}}
(ha : ℵ₀ ≤ a)
(hb : ℵ₀ ≤ b)


@[to_additive] lemma oneLePart_eq_ite : a⁺ᵐ = if 1 ≤ a then a else 1

{α : Type u_1}
[LinearOrder α]
[AddGroup α]
{a : α}


@[reassoc]
lemma triangleMapOfHomotopy_comm₂ :
    inr φ₁ ≫ mapOfHomotopy H = b ≫ inr φ₂

{φ₁ : K₁ ⟶ L₁}

{φ₂ : K₂ ⟶ L₂}

CochainComplex.mappingCone.inr φ₁ ≫ CochainComplex.mappingCone.mapOfHomotopy H = b ≫ CochainComplex.mappingCone.inr φ₂


private theorem adE_of_eq_eq_zero (i : B) (h : A i i = 2) : adE R A ⟨i, i⟩ = 0

(R : Type u)
{B : Type v}
[CommRing R]
(A : Matrix B B ℤ)
(i : B)
(h : A i i = 2)

CartanMatrix.Relations.adE R A (i, i) = 0


@[congr]
theorem map_congr {f g : α → β} {s : Sym α n} (h : ∀ x ∈ s, f x = g x) : map f s = map g s

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
{f g : α → β}
{s : Sym α n}
(h : ∀ x ∈ s, f x = g x)


theorem toReal_ofReal' {r : ℝ} : (ENNReal.ofReal r).toReal = max r 0


theorem ord_proj_mul {a b : ℕ} (p : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
    ord_proj[p] (a * b) = ord_proj[p] a * ord_proj[p] b

p ^ (a * b).factorization p = p ^ a.factorization p * p ^ b.factorization p


@[simp]
lemma _root_.Equiv.symm_simpleGraph (e : V ≃ W) : e.simpleGraph.symm = e.symm.simpleGraph

{V : Type u_1}
{W : Type u_2}
(e : V ≃ W)


lemma nonsingular_iff (P : Fin 3 → R) : W'.Nonsingular P ↔ W'.Equation P ∧
    (W'.a₁ * P y * P z - (3 * P x ^ 2 + 2 * W'.a₂ * P x * P z ^ 2 + W'.a₄ * P z ^ 4) ≠ 0 ∨
      2 * P y + W'.a₁ * P x * P z + W'.a₃ * P z ^ 3 ≠ 0 ∨
      W'.a₁ * P x * P y + 3 * W'.a₃ * P y * P z ^ 2
        - (2 * W'.a₂ * P x ^ 2 * P z + 4 * W'.a₄ * P x * P z ^ 3 + 6 * W'.a₆ * P z ^ 5) ≠ 0)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)


@[simp]
theorem fst_imJ_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) :
    (dualNumberEquiv.symm d).imJ.fst = d.fst.imJ

{R : Type u_1}
[CommRing R]
(d : DualNumber (Quaternion R))

TrivSqZeroExt.fst (Quaternion.dualNumberEquiv.symm d).imJ = (TrivSqZeroExt.fst d).imJ


/-- $aba$ is a vector. -/
theorem ι_mul_ι_mul_ι (a b : M) :
    ι Q a * ι Q b * ι Q a = ι Q (QuadraticMap.polar Q a b • a - Q a • b)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(a b : M)

(CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a =
  (CliffordAlgebra.ι Q) (QuadraticMap.polar (⇑Q) a b • a - Q a • b)


@[simp]
theorem rank_punit : Module.rank R PUnit = 0


lemma pushforward_forget (f : X ⟶ Y) :
    pushforward C f ⋙ forget C Y = forget C X ⋙ Presheaf.pushforward C f

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)

TopCat.Sheaf.pushforward C f ⋙ TopCat.Sheaf.forget C Y = TopCat.Sheaf.forget C X ⋙ TopCat.Presheaf.pushforward C f


theorem prod_map_atBot_eq {α₁ α₂ β₁ β₂ : Type*} [Preorder β₁] [Preorder β₂]
    (u₁ : β₁ → α₁) (u₂ : β₂ → α₂) : map u₁ atBot ×ˢ map u₂ atBot = map (Prod.map u₁ u₂) atBot

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
[Preorder β₁]
[Preorder β₂]
(u₁ : β₁ → α₁)
(u₂ : β₂ → α₂)

Filter.map u₁ Filter.atBot ×ˢ Filter.map u₂ Filter.atBot = Filter.map (Prod.map u₁ u₂) Filter.atBot


@[simps!]
instance : Category (Augmented C)

(C : Type u)
[CategoryTheory.Category.{v, u} C]

∀ {X Y Z : CategoryTheory.Comma (𝟭 (CategoryTheory.SimplicialObject C)) (CategoryTheory.SimplicialObject.const C)}
  (f : X ⟶ Y) (g : Y ⟶ Z) (X_1 : SimplexCategoryᵒᵖ), (f ≫ g).left.app X_1 = f.left.app X_1 ≫ g.left.app X_1


theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.natDegree.Prime) :
    p.natDegree ∣ Fintype.card p.Gal

{F : Type u_1}
[Field F]
{p : F[X]}
[CharZero F]
(p_irr : Irreducible p)
(p_deg : Nat.Prime p.natDegree)


lemma condexpKernel_ae_eq_trim_condexp [IsFiniteMeasure μ]
    (hm : m ≤ mΩ) {s : Set Ω} (hs : MeasurableSet s) :
    (fun ω ↦ (condexpKernel μ m ω s).toReal) =ᵐ[μ.trim hm] μ⟦s | m⟧

{Ω : Type u_1}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hm : m ≤ mΩ)
{s : Set Ω}
(hs : MeasurableSet s)

(fun ω => (((ProbabilityTheory.condexpKernel μ m) ω) s).toReal) =ᵐ[μ.trim hm] μ[s.indicator fun ω => 1|m]


/-- A subgroup `H` of `G` determines a subgroup `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "An additive subgroup `H` of `G` determines an additive subgroup
`H.op` of the opposite additive group `Gᵃᵒᵖ`."]
def opEquiv : Subgroup G ≃o Subgroup Gᵐᵒᵖ

{G : Type u_2}
[AddGroup G]
(H : AddSubgroup Gᵃᵒᵖ)

(RelIso.symm AddSubgroup.opEquiv) H = H.unop


/-- A dilation maps balls to balls and scales the radius by `ratio f`. -/
theorem mapsTo_ball (x : α) (r' : ℝ) :
    MapsTo (f : α → β) (Metric.ball x r') (Metric.ball (f x) (ratio f * r'))

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)
(x : α)
(r' : ℝ)

Set.MapsTo (⇑f) (Metric.ball x r') (Metric.ball (f x) (↑(Dilation.ratio f) * r'))


theorem rel_of_forall {m1 m2 : Multiset α} {r : α → α → Prop} (h : ∀ a b, a ∈ m1 → b ∈ m2 → r a b)
    (hc : card m1 = card m2) : m1.Rel r m2

(h : ∀ (a b : α), a ∈ m1 → b ∈ m2 → r a b)

(hc : Multiset.card m1 = Multiset.card m2)


/-- The reversed version of **Tonelli's Theorem**. In this version `f` is in curried form, which
makes it easier for the elaborator to figure out `f` automatically. -/
theorem lintegral_lintegral ⦃f : α → β → ℝ≥0∞⦄ (hf : AEMeasurable (uncurry f) (μ.prod ν)) :
    ∫⁻ x, ∫⁻ y, f x y ∂ν ∂μ = ∫⁻ z, f z.1 z.2 ∂μ.prod ν

⦃f : α → β → ℝ≥0∞⦄

(hf : AEMeasurable (Function.uncurry f) (μ.prod ν))

∫⁻ (x : α), ∫⁻ (y : β), f x y ∂ν ∂μ = ∫⁻ (z : α × β), f z.1 z.2 ∂μ.prod ν


theorem _root_.IsCompact.compl_mem_cocompact (hs : IsCompact s) : sᶜ ∈ Filter.cocompact X

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsCompact s)


@[simp]
theorem coe_forget_to_partOrd (X : SemilatSupCat) :
    ↥((forget₂ SemilatSupCat PartOrd).obj X) = ↥X

↑((CategoryTheory.forget₂ SemilatSupCat PartOrd).obj X) = X.X


theorem span_le_span_iff [Nontrivial R] {s t u : Set M} (hl : LinearIndependent R ((↑) : u → M))
    (hsu : s ⊆ u) (htu : t ⊆ u) : span R s ≤ span R t ↔ s ⊆ t

(hl : LinearIndependent (ι := { x // x ∈ u }) R Subtype.val)

Submodule.span R s ≤ Submodule.span R t ↔ s ⊆ t


/-- If a polynomial splits over `E`, then its separable degree is equal to
the number of distinct roots of it over `E`. -/
theorem natSepDegree_eq_of_splits (h : f.Splits (algebraMap F E)) :
    f.natSepDegree = (f.aroots E).toFinset.card

(h : Polynomial.Splits (algebraMap F E) f)


theorem norm_expSeries_summable_of_mem_ball' (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => ‖(n !⁻¹ : 𝕂) • x ^ n‖

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

Summable fun n => ‖(↑n.factorial)⁻¹ • x ^ n‖


@[simp]
theorem clusterPt_lift'_closure_iff {F : Filter X} :
    ClusterPt x (F.lift' closure) ↔ ClusterPt x F

{X : Type u}
{x : X}
[TopologicalSpace X]
{F : Filter X}


theorem mul_equiv_mul {f1 f2 g1 g2 : CauSeq β abv} (hf : f1 ≈ f2) (hg : g1 ≈ g2) :
    f1 * g1 ≈ f2 * g2

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f1 f2 g1 g2 : CauSeq β abv}
(hf : f1 ≈ f2)
(hg : g1 ≈ g2)


theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ

(hf : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (f i) μ)

(hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤)

∫ (a : α), ∑' (i : ι), f i a ∂μ = ∑' (i : ι), ∫ (a : α), f i a ∂μ


theorem dvd_mul {a b : α} : p ∣ a * b ↔ p ∣ a ∨ p ∣ b

{α : Type u_1}
[CommMonoidWithZero α]
{p : α}
(hp : Prime p)
{a b : α}


/-- If `a` is in the `u, v`-compression but `v ≤ a`, then `a` must have been in the original
family. -/
theorem mem_of_mem_compression (ha : a ∈ 𝓒 u v s) (hva : v ≤ a) (hvu : v = ⊥ → u = ⊥) :
    a ∈ s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(ha : a ∈ UV.compression u v s)
(hva : v ≤ a)
(hvu : v = ⊥ → u = ⊥)


theorem not_fermat_42 {a b c : ℤ} (ha : a ≠ 0) (hb : b ≠ 0) : a ^ 4 + b ^ 4 ≠ c ^ 2


/-- A subset of the triangles constructed in a weird way to make them easy to count. -/
private lemma triangle_split_helper [DecidableEq α] :
    (s \ (badVertices G ε s t ∪ badVertices G ε s u)).biUnion
      (fun x ↦ (G.interedges (t.filter $ G.Adj x) (u.filter $ G.Adj x)).image (x, ·)) ⊆
      (s ×ˢ t ×ˢ u).filter (fun (x, y, z) ↦ G.Adj x y ∧ G.Adj x z ∧ G.Adj y z)

{α : Type u_1}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : ℝ}
{s t u : Finset α}
[DecidableEq α]

((s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)).biUnion fun x =>
    Finset.image (fun x_1 => (x, x_1)) (G.interedges (Finset.filter (G.Adj x) t) (Finset.filter (G.Adj x) u))) ⊆
  Finset.filter
    (fun x =>
      match x with
      | (x, y, z) => G.Adj x y ∧ G.Adj x z ∧ G.Adj y z)
    (s ×ˢ t ×ˢ u)


lemma coe_ideal_map (I : Ideal A) :
    Ideal.map f I = Ideal.map (f : A →+* B) I

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(I : Ideal A)


@[nolint unusedArguments]
theorem second_iso {X Y : Submodule R M} (_ : X ⋖ X ⊔ Y) :
    Iso (X,X ⊔ Y) (X ⊓ Y,Y)

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{X Y : Submodule R M}

X ⋖ X ⊔ Y → JordanHolderModule.Iso (X, X ⊔ Y) (X ⊓ Y, Y)


/--
If `k.right` is an epimorphism, then `k` is an epimorphism. In other words, `Under.forget X`
reflects epimorphisms.
The converse of `CategoryTheory.Under.epi_right_of_epi`.

This lemma is not an instance, to avoid loops in type class inference.
-/
theorem epi_of_epi_right {f g : Under X} (k : f ⟶ g) [hk : Epi k.right] : Epi k

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{f g : CategoryTheory.Under X}
(k : f ⟶ g)
[hk : CategoryTheory.Epi k.right]


/-- Given three collinear points, two on a sphere and one not outside it, the one not outside it
is weakly between the other two points. -/
theorem wbtw_of_collinear_of_dist_center_le_radius {s : Sphere P} {p₁ p₂ p₃ : P}
    (h : Collinear ℝ ({p₁, p₂, p₃} : Set P)) (hp₁ : p₁ ∈ s) (hp₂ : dist p₂ s.center ≤ s.radius)
    (hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : Wbtw ℝ p₁ p₂ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : EuclideanGeometry.Sphere P}
{p₁ p₂ p₃ : P}
(h : Collinear ℝ {p₁, p₂, p₃})
(hp₁ : p₁ ∈ s)
(hp₂ : dist p₂ s.center ≤ s.radius)
(hp₃ : p₃ ∈ s)
(hp₁p₃ : p₁ ≠ p₃)


theorem pow_succ_padicValNat_not_dvd {n : ℕ} [hp : Fact p.Prime] (hn : n ≠ 0) :
    ¬p ^ (padicValNat p n + 1) ∣ n

{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hn : n ≠ 0)


theorem eq_of_prod_eq_prod [Nontrivial α] {a b : FactorSet α} (h : a.prod = b.prod) : a = b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[Nontrivial α]
{a b : Associates.FactorSet α}
(h : a.prod = b.prod)


/-- The polynomial `X ^ n` lifts. -/
theorem X_pow_mem_lifts (f : R →+* S) (n : ℕ) : (X ^ n : S[X]) ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
(f : R →+* S)
(n : ℕ)


@[simp, norm_cast]
theorem coe_centralizer (s : Set A) : (centralizer R s : Set A) = (s ∪ star s).centralizer

(R : Type u)
{A : Type v}
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(s : Set A)

↑(NonUnitalStarSubalgebra.centralizer R s) = (s ∪ star s).centralizer


@[simp]
theorem unop_op (S : Subalgebra R A) : S.op.unop = S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


theorem map_incl_top : (⊤ : LieSubmodule R L N).map N.incl = N

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)


@[simp]
theorem mem_sigma {a : Σi, α i} : a ∈ s.sigma t ↔ a.1 ∈ s ∧ a.2 ∈ t a.1

{ι : Type u_1}
{α : ι → Type u_2}
{s : Finset ι}
{t : (i : ι) → Finset (α i)}
{a : (i : ι) × α i}

a ∈ s.sigma t ↔ a.fst ∈ s ∧ a.snd ∈ t a.fst


/-- A function from a locally finite preorder is strictly monotone if and only if it is strictly
monotone when restricted to pairs satisfying `a ⋖ b`. -/
lemma strictMono_iff_forall_covBy [Preorder α] [LocallyFiniteOrder α] [Preorder β]
    (f : α → β) : StrictMono f ↔ ∀ a b : α, a ⋖ b → f a < f b

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[LocallyFiniteOrder α]
[Preorder β]
(f : α → β)

StrictMono f ↔ ∀ (a b : α), a ⋖ b → f a < f b


@[to_additive]
theorem measure_preimage_inv (μ : Measure G) [IsInvInvariant μ] (A : Set G) :
    μ (Inv.inv ⁻¹' A) = μ A

{G : Type u_2}
[MeasurableSpace G]
[InvolutiveInv G]
[MeasurableInv G]
(μ : MeasureTheory.Measure G)
[μ.IsInvInvariant]
(A : Set G)


theorem exists_pos_sum_of_countable {ε : ℝ≥0} (hε : ε ≠ 0) (ι) [Countable ι] :
    ∃ ε' : ι → ℝ≥0, (∀ i, 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε

{ε : ℝ≥0}
(hε : ε ≠ 0)
(ι : Type u_4)
[Countable ι]

∃ ε', (∀ (i : ι), 0 < ε' i) ∧ ∃ c, HasSum ε' c ∧ c < ε


protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
(f : α ≃ₜ β)

(MeasureTheory.Measure.map (⇑f) μ).Regular ↔ μ.Regular


/-- The set of Liouville numbers in dense. -/
theorem dense_liouville : Dense { x | Liouville x }


/-- A Lipschitz function is uniformly continuous. -/
protected theorem uniformContinuous (hf : LipschitzWith K f) : UniformContinuous f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)


theorem iInf_mul_left' {ι} {f : ι → ℝ≥0∞} {a : ℝ≥0∞} (h : a = ∞ → ⨅ i, f i = 0 → ∃ i, f i = 0)
    (h0 : a = 0 → Nonempty ι) : ⨅ i, a * f i = a * ⨅ i, f i

{f : ι → ℝ≥0∞}

(h : a = ⊤ → ⨅ i, f i = 0 → ∃ i, f i = 0)


theorem eval_maximal₁ {σ} {f : σ → Option σ} {a b} (h : b ∈ eval f a) (c) : ¬Reaches₁ f b c

{σ : Type u_1}
{f : σ → Option σ}
{a b : σ}
(h : b ∈ Turing.eval f a)
(c : σ)


@[simp, norm_cast]
theorem cpow_intCast (x : ℂ) (n : ℤ) : x ^ (n : ℂ) = x ^ n


theorem xy_modEq_yn (n) :
    ∀ k, xn a1 (n * k) ≡ xn a1 n ^ k [MOD yn a1 n ^ 2] ∧ yn a1 (n * k) ≡
        k * xn a1 n ^ (k - 1) * yn a1 n [MOD yn a1 n ^ 3]

Pell.xn a1 (n * k) ≡ Pell.xn a1 n ^ k [MOD Pell.yn a1 n ^ 2] ∧
  Pell.yn a1 (n * k) ≡ k * Pell.xn a1 n ^ (k - 1) * Pell.yn a1 n [MOD Pell.yn a1 n ^ 3]


theorem map_add_self (x : M) : Q (x + x) = 4 • Q x

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)
(x : M)


@[simp, nolint simpNF]
theorem homEquiv_naturality_right_symm (f : X ⟶ G.obj Y) (g : Y ⟶ Y') :
    (adj.homEquiv X Y').symm (f ≫ G.map g) = (adj.homEquiv X Y).symm f ≫ g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{X : C}
{Y Y' : D}
(f : X ⟶ G.obj Y)
(g : Y ⟶ Y')

(adj.homEquiv X Y').symm (CategoryTheory.CategoryStruct.comp f (G.map g)) =
  CategoryTheory.CategoryStruct.comp ((adj.homEquiv X Y).symm f) g


lemma mem_inf [DecidableEq α] {s : Finset ι} {f : ι → Finset α} {a : α} :
    a ∈ s.inf f ↔ ∀ i ∈ s, a ∈ f i

{ι : Type u_1}
{α : Type u_2}
[Fintype α]
[DecidableEq α]
{s : Finset ι}
{f : ι → Finset α}
{a : α}


theorem ofReal_mul {p q : ℝ} (hp : 0 ≤ p) :
    ENNReal.ofReal (p * q) = ENNReal.ofReal p * ENNReal.ofReal q


/-- See `not_isSuccLimit_iff` for a version that states that `a` is a successor of a value other
than itself. -/
theorem mem_range_succ_of_not_isSuccLimit (h : ¬IsSuccLimit a) : a ∈ range (@succ α _ _)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
(h : ¬Order.IsSuccLimit a)


theorem IsRat.nonneg_to_eq {α} [DivisionRing α] {n d} :
    {a n' d' : α} → IsRat a (.ofNat n) d → n = n' → d = d' → a = n' / d'

{α : Type u_1}
[DivisionRing α]
{n d : ℕ}
{a n' d' : α}

Mathlib.Meta.NormNum.IsRat a (Int.ofNat n) d → ↑n = n' → ↑d = d' → a = n' / d'


theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurable fun m => bind m g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{g : α → MeasureTheory.Measure β}
(hg : Measurable g)


theorem Set.Finite.isClosed_biUnion {s : Set α} {f : α → Set X} (hs : s.Finite)
    (h : ∀ i ∈ s, IsClosed (f i)) :
    IsClosed (⋃ i ∈ s, f i)

{X : Type u}
{α : Type u_1}
[TopologicalSpace X]
{s : Set α}
{f : α → Set X}
(hs : s.Finite)
(h : ∀ i ∈ s, IsClosed (f i))


@[simp]
theorem integral_Iic_inv_one_add_sq {i : ℝ} :
    ∫ (x : ℝ) in Set.Iic i, (1 + x ^ 2)⁻¹ = arctan i + (π / 2)

∫ (x : ℝ) in Set.Iic i, (1 + x ^ 2)⁻¹ = Real.arctan i + π / 2


@[to_additive (attr := simp)]
theorem ofMulEquivOfLocalizations_id : f.ofMulEquivOfLocalizations (MulEquiv.refl N) = f

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)


theorem adjoin_toSubalgebra (s : Set A) :
    (adjoin R s).toSubalgebra = Algebra.adjoin R (s ∪ star s)

(R : Type u_2)
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(s : Set A)

(StarAlgebra.adjoin R s).toSubalgebra = Algebra.adjoin R (s ∪ star s)


/-- A module has dimension 1 iff there is some nonzero `v : V` so every vector is a multiple of `v`.
-/
theorem finrank_eq_one_iff' [Module.Free K V] :
    finrank K V = 1 ↔ ∃ v ≠ 0, ∀ w : V, ∃ c : K, c • v = w

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

FiniteDimensional.finrank K V = 1 ↔ ∃ v, v ≠ 0 ∧ ∀ (w : V), ∃ c, c • v = w


lemma truncGE'_d_eq {i j : ι} (hij : c.Rel i j)  {i' j' : ι'}
    (hi' : e.f i = i') (hj' : e.f j = j')  (hi : ¬ e.BoundaryGE i) :
    (K.truncGE' e).d i j = (K.truncGE'XIso e hi' hi).hom ≫ K.d i' j' ≫
      (K.truncGE'XIso e hj' (e.not_boundaryGE_next hij)).inv

(K.truncGE' e).d i j = (K.truncGE'XIso e hi' hi).hom ≫ K.d i' j' ≫ (K.truncGE'XIso e hj' ⋯).inv


theorem Subset.congr_left : ∀ {x y z : PSet}, Equiv x y → (x ⊆ z ↔ y ⊆ z)


@[simp]
theorem lift_of {N} [Monoid N] (fi : ∀ i, M i →* N) {i} (m : M i) : lift fi (of m) = fi i m

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{N : Type u_4}
[Monoid N]
(fi : (i : ι) → M i →* N)
{i : ι}
(m : M i)

(Monoid.CoprodI.lift fi) (Monoid.CoprodI.of m) = (fi i) m


/-- The norm of the projection is smaller or equal to the norm of the original element. -/
theorem quotient_norm_mk_le (S : AddSubgroup M) (m : M) : ‖mk' S m‖ ≤ ‖m‖

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(m : M)


lemma tendsto_densityProcess_fst_atTop_univ_of_monotone (κ : Kernel α (γ × β)) (n : ℕ) (a : α)
    (x : γ) (seq : ℕ → Set β) (hseq : Monotone seq) (hseq_iUnion : ⋃ i, seq i = univ) :
    Tendsto (fun m ↦ densityProcess κ (fst κ) n a x (seq m)) atTop
      (𝓝 (densityProcess κ (fst κ) n a x univ))

(κ : ProbabilityTheory.Kernel α (γ × β))

Filter.Tendsto (fun m => κ.densityProcess κ.fst n a x (seq m)) Filter.atTop (𝓝 (κ.densityProcess κ.fst n a x Set.univ))


@[to_additive (attr := simp)]
theorem unop_op (S : Submonoid M) : S.op.unop = S

{M : Type u_2}
[AddZeroClass M]
(S : AddSubmonoid M)


theorem add_iInf {a : ℝ≥0∞} : a + iInf f = ⨅ b, a + f b

{ι : Sort u_1}
{f : ι → ℝ≥0∞}
{a : ℝ≥0∞}