/-- The odd terms of `expSeries` are real, and correspond to the series for
$\frac{q}{‖q‖} \sin ‖q‖$. -/
theorem expSeries_odd_of_imaginary {q : Quaternion ℝ} (hq : q.re = 0) (n : ℕ) :
    expSeries ℝ (Quaternion ℝ) (2 * n + 1) (fun _ => q) =
      (((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n + 1) / (2 * n + 1)!) / ‖q‖) • q

((NormedSpace.expSeries ℝ ℍ (2 * n + 1)) fun x => q) = ((-1) ^ n * ‖q‖ ^ (2 * n + 1) / ↑(2 * n + 1)! / ‖q‖) • q


theorem isIrreducible_singleton {x} : IsIrreducible ({x} : Set X)

{X : Type u_1}
[TopologicalSpace X]
{x : X}


@[simp]
theorem intDegree_one : intDegree (1 : RatFunc K) = 0


theorem C_0 : C 0 = (0 : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]


@[to_additive (attr := simp)]
theorem div_eq_inv_self : a / b = b⁻¹ ↔ a = 1


theorem disjoint_iSup_iff {f : ι → α} : Disjoint a (⨆ i, f i) ↔ ∀ i, Disjoint a (f i)

{α : Type u}
{ι : Sort w}
[Order.Frame α]
{a : α}
{f : ι → α}

Disjoint a (⨆ i, f i) ↔ ∀ (i : ι), Disjoint a (f i)


theorem mem_pointwise_smul_iff_inv_smul_mem₀ {a : α} (ha : a ≠ 0) (S : Subgroup G) (x : G) :
    x ∈ a • S ↔ a⁻¹ • x ∈ S

{α : Type u_1}
{G : Type u_2}
[Group G]
[GroupWithZero α]
[MulDistribMulAction α G]
{a : α}
(ha : a ≠ 0)
(S : Subgroup G)
(x : G)

x ∈ a • S ↔ a⁻¹ • x ∈ S


@[simp] theorem bind_pure_unit [Monad m] [LawfulMonad m] {x : m PUnit} : (x >>= fun _ => pure ⟨⟩) = x

{m : Type u_1 → Type u_2}
[Monad m]
[LawfulMonad m]
{x : m PUnit}


theorem Memℒp.im (hf : Memℒp f p μ) : Memℒp (fun x => RCLike.im (f x)) p μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : α → 𝕜}
(hf : MeasureTheory.Memℒp f p μ)

MeasureTheory.Memℒp (fun x => RCLike.im (f x)) p μ


lemma spec (g : L ≃+* L) {t : Lˣ} (ht : t ∈ rootsOfUnity n L) :
    g t = t ^ ((ModularCyclotomicCharacter L hn g) : ZMod n).val

(hn : Fintype.card ↥(rootsOfUnity n L) = ↑n)

g ↑t = ↑t ^ (↑((ModularCyclotomicCharacter L hn) g)).val


@[simp]
theorem hexagon_forward (X Y Z : ModuleCat.{u} R) :
    (α_ X Y Z).hom ≫ (braiding X _).hom ≫ (α_ Y Z X).hom =
      (braiding X Y).hom ▷ Z ≫ (α_ Y X Z).hom ≫ Y ◁ (braiding X Z).hom

{R : Type u}
[CommRing R]
(X Y Z : ModuleCat R)

(α_ X Y Z).hom ≫ (X.braiding (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom =
  (X.braiding Y).hom ▷ Z ≫ (α_ Y X Z).hom ≫ Y ◁ (X.braiding Z).hom


@[to_additive boole_nsmul]
lemma pow_boole (P : Prop) [Decidable P] (a : M) :
    (a ^ if P then 1 else 0) = if P then a else 1

{M : Type u_4}
[AddMonoid M]
(P : Prop)
[Decidable P]
(a : M)

(if P then 1 else 0) • a = if P then a else 0


@[simp]
theorem top_add_coe (x : ℝ) : (⊤ : EReal) + x = ⊤


/-- The distance between two functions is controlled by the supremum of the pointwise distances. -/
theorem dist_le (C0 : (0 : ℝ) ≤ C) : dist f g ≤ C ↔ ∀ x : α, dist (f x) (g x) ≤ C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
{C : ℝ}
(C0 : 0 ≤ C)

dist f g ≤ C ↔ ∀ (x : α), dist (f x) (g x) ≤ C


/-- Given a costructured arrow `S(Y) ⟶ X`, and an arrow `Y' ⟶ Y'`, we can construct a morphism of
    costructured arrows given by `(S(Y) ⟶ X) ⟶ (S(Y') ⟶ S(Y) ⟶ X)`. -/
@[simps]
def homMk' (f : CostructuredArrow S T) (g : Y' ⟶ f.left) : mk (S.map g ≫ f.hom) ⟶ f

(f : CategoryTheory.CostructuredArrow S T)

(f.homMk' g).right =
  CategoryTheory.CategoryStruct.id
    (CategoryTheory.CostructuredArrow.mk (CategoryTheory.CategoryStruct.comp (S.map g) f.hom)).right


/-- A `StrictOrderedSemiring` is a nontrivial semiring with a partial order such that addition is
strictly monotone and multiplication by a positive number is strictly monotone. -/
class StrictOrderedSemiring (α : Type u) extends Semiring α, OrderedCancelAddCommMonoid α,
    Nontrivial α where
  /-- In a strict ordered semiring, `0 ≤ 1`. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- Left multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_left : ∀ a b c : α, a < b → 0 < c → c * a < c * b
  /-- Right multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_right : ∀ a b c : α, a < b → 0 < c → a * c < b * c

{α : Type u}
[self : StrictOrderedSemiring α]
(a b c : α)


theorem add_eq_top_iff {a b : PartENat} : a + b = ⊤ ↔ a = ⊤ ∨ b = ⊤


@[simp]
theorem smul_mem_smul_finset_iff₀ (ha : a ≠ 0) : a • b ∈ a • s ↔ b ∈ s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
{s : Finset β}
{a : α}
{b : β}
(ha : a ≠ 0)


/-- Suppose `f` is locally integrable on `(0, ∞)`, is `O(x ^ (-a))` as `x → ∞`, and is
`O(x ^ (-b))` as `x → 0`. Then its Mellin transform is differentiable on the domain `b < re s < a`,
with derivative equal to the Mellin transform of `log • f`. -/
theorem mellin_hasDerivAt_of_isBigO_rpow [NormedSpace ℂ E] {a b : ℝ}
    {f : ℝ → E} {s : ℂ} (hfc : LocallyIntegrableOn f (Ioi 0)) (hf_top : f =O[atTop] (· ^ (-a)))
    (hs_top : s.re < a) (hf_bot : f =O[𝓝[>] 0] (· ^ (-b))) (hs_bot : b < s.re) :
    MellinConvergent (fun t => log t • f t) s ∧
      HasDerivAt (mellin f) (mellin (fun t => log t • f t) s) s

(hfc : MeasureTheory.LocallyIntegrableOn f (Set.Ioi 0) MeasureTheory.volume)

(hf_top : f =O[Filter.atTop] fun x => x ^ (-a))

MellinConvergent (fun t => Real.log t • f t) s ∧ HasDerivAt (mellin f) (mellin (fun t => Real.log t • f t) s) s


@[to_additive]
theorem multipliable_nat_add_iff {f : ℕ → G} (k : ℕ) :
    (Multipliable fun n ↦ f (n + k)) ↔ Multipliable f

{G : Type u_2}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{f : ℕ → G}
(k : ℕ)

(Summable fun n => f (n + k)) ↔ Summable f


theorem single_mem_gradeBy {R} [CommSemiring R] (f : M → ι) (m : M) (r : R) :
    Finsupp.single m r ∈ gradeBy R f (f m)

{M : Type u_1}
{ι : Type u_2}
{R : Type u_4}
[CommSemiring R]
(f : M → ι)
(m : M)
(r : R)

Finsupp.single m r ∈ AddMonoidAlgebra.gradeBy R f (f m)


protected lemma pow [DecidableEq n] {M : Matrix n n R} (hM : M.PosSemidef) (k : ℕ) :
    PosSemidef (M ^ k)

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
[DecidableEq n]
{M : Matrix n n R}
(hM : M.PosSemidef)
(k : ℕ)


@[to_additive]
theorem lt_def : p < q ↔ (p : E → ℝ) < q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupSeminorm E}


theorem Filter.Eventually.prod_nhds {p : X → Prop} {q : Y → Prop} {x : X} {y : Y}
    (hx : ∀ᶠ x in 𝓝 x, p x) (hy : ∀ᶠ y in 𝓝 y, q y) : ∀ᶠ z : X × Y in 𝓝 (x, y), p z.1 ∧ q z.2

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{p : X → Prop}
{q : Y → Prop}
{x : X}
{y : Y}
(hx : ∀ᶠ (x : X) in 𝓝 x, p x)
(hy : ∀ᶠ (y : Y) in 𝓝 y, q y)

∀ᶠ (z : X × Y) in 𝓝 (x, y), p z.1 ∧ q z.2


/-- An involution commutes across an equality. Compare to `Function.Injective.eq_iff`. -/
protected theorem eq_iff {x y : α} : f x = y ↔ x = f y

{α : Sort u}
{f : α → α}
(h : Function.Involutive f)
{x y : α}


theorem coe_det [DecidableEq M] :
    ⇑(LinearMap.det : (M →ₗ[A] M) →* A) =
      if H : ∃ s : Finset M, Nonempty (Basis s A M) then
        LinearMap.detAux (Trunc.mk H.choose_spec.some)
      else 1

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
[DecidableEq M]

⇑LinearMap.det = ⇑(if H : ∃ s, Nonempty (Basis { x // x ∈ s } A M) then LinearMap.detAux (Trunc.mk ⋯.some) else 1)


theorem le_add_of_sub_le {a b c : Nat} (h : a - b ≤ c) : a ≤ c + b


lemma isZero₃_iff_isIso₁ : IsZero T.obj₃ ↔ IsIso T.mor₁

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.Limits.IsZero T.obj₃ ↔ CategoryTheory.IsIso T.mor₁


lemma isNilRegular_iff_coeff_polyCharpoly_nilRank_ne_zero :
    IsNilRegular φ x ↔
    MvPolynomial.eval (b.repr x)
      ((polyCharpoly φ b).coeff (nilRank φ)) ≠ 0

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)
[Module.Finite R L]
[Module.Free R L]
(x : L)

φ.IsNilRegular x ↔ (MvPolynomial.eval ⇑(b.repr x)) ((φ.polyCharpoly b).coeff φ.nilRank) ≠ 0


lemma eq_add_nullHomotopic (h : Homotopy φ₁ φ₂) :
    φ₁ = φ₂ + nullHomotopic _ _ h.h₀ h.h₀_f h.h₁ h.h₂ h.h₃ h.g_h₃

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

φ₁ = φ₂ + S₁.nullHomotopic S₂ h.h₀ ⋯ h.h₁ h.h₂ h.h₃ ⋯


@[ext]
theorem ext {f g : PseudoEpimorphism α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{f g : PseudoEpimorphism α β}
(h : ∀ (a : α), f a = g a)


theorem le_ofReal_iff_toReal_le {a : ℝ≥0∞} {b : ℝ} (ha : a ≠ ∞) (hb : 0 ≤ b) :
    a ≤ ENNReal.ofReal b ↔ ENNReal.toReal a ≤ b

{a : ℝ≥0∞}
{b : ℝ}
(ha : a ≠ ⊤)
(hb : 0 ≤ b)


theorem flip₁_continuous' (f : ∀ x : α, γ → β x) (a : α) (hf : Continuous' fun x y => f y x) :
    Continuous' (f a)

[(x : α) → OmegaCompletePartialOrder (β x)]

(hf : OmegaCompletePartialOrder.Continuous' fun x y => f y x)


theorem support_trinomial {k m n : ℕ} (hkm : k < m) (hmn : m < n) {x y z : R} (hx : x ≠ 0)
    (hy : y ≠ 0) (hz : z ≠ 0) :
    support (C x * X ^ k + C y * X ^ m + C z * X ^ n) = {k, m, n}

{R : Type u}
[Semiring R]
{k m n : ℕ}
(hkm : k < m)
(hmn : m < n)
{x y z : R}
(hx : x ≠ 0)
(hy : y ≠ 0)
(hz : z ≠ 0)

(Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m + Polynomial.C z * Polynomial.X ^ n).support =
  {k, m, n}


/-- A point belongs to the closure of `s` iff its infimum distance to this set vanishes. -/
theorem mem_closure_iff_infDist_zero (h : s.Nonempty) : x ∈ closure s ↔ infDist x s = 0

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}
(h : s.Nonempty)


theorem eq_iff_mul_eq_mul {p q : ℚ} : p = q ↔ p.num * q.den = q.num * p.den


theorem nadd_right_comm : ∀ a b c, a ♯ b ♯ c = a ♯ c ♯ b


lemma zeroLocus_isClosed {U : X.Opens} (s : Set Γ(X, U)) :
    IsClosed (X.zeroLocus s)

(s : Set ↑(X.presheaf.obj (Opposite.op U)))


@[to_additive]
theorem oreDiv_mul_oreDiv {r₁ : R} {r₂ : R} {s₁ s₂ : S} :
    (r₁ /ₒ s₁) * (r₂ /ₒ s₂) = oreNum r₁ s₂ * r₂ /ₒ (oreDenom r₁ s₂ * s₁)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r₁ r₂ : R}
{s₁ s₂ : ↥S}

r₁ /ₒ s₁ * (r₂ /ₒ s₂) = OreLocalization.oreNum r₁ s₂ * r₂ /ₒ (OreLocalization.oreDenom r₁ s₂ * s₁)


private theorem weight_add_weight_pairMap {k : ℕ} (t : Finset σ × σ) (h : t ∈ pairs σ k) :
    weight σ R k t + weight σ R k (pairMap σ t) = 0

(h : t ∈ MvPolynomial.NewtonIdentities.pairs σ k)

MvPolynomial.NewtonIdentities.weight σ R k t +
    MvPolynomial.NewtonIdentities.weight σ R k (MvPolynomial.NewtonIdentities.pairMap σ t) =
  0


theorem TransGen.mono {p : α → α → Prop} :
    (∀ a b, r a b → p a b) → TransGen r a b → TransGen p a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
{p : α → α → Prop}

(∀ (a b : α), r a b → p a b) → Relation.TransGen r a b → Relation.TransGen p a b


theorem le_glueDist_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x y) :
    ε ≤ glueDist Φ Ψ ε (.inr x) (.inl y)

{X : Type u}
{Y : Type v}
{Z : Type w}
[MetricSpace X]
[MetricSpace Y]
(Φ : Z → X)
(Ψ : Z → Y)
(ε : ℝ)
(x : Y)
(y : X)

ε ≤ Metric.glueDist Φ Ψ ε (Sum.inr x) (Sum.inl y)


@[to_additive]
lemma continuous_mulIndicator (hs : ∀ a ∈ frontier s, f a = 1) (hf : ContinuousOn f (closure s)) :
    Continuous (mulIndicator s f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[One β]
{f : α → β}
{s : Set α}
(hs : ∀ a ∈ frontier s, f a = 1)
(hf : ContinuousOn f (closure s))


theorem prod_image_seq_comm (s : Set α) (t : Set β) :
    (Prod.mk '' s).seq t = seq ((fun b a => (a, b)) '' t) s

{α : Type u_1}
{β : Type u_2}
(s : Set α)
(t : Set β)

(Prod.mk '' s).seq t = ((fun b a => (a, b)) '' t).seq s


theorem map_subtype_embedding_Icc (hp : ∀ ⦃a b x⦄, a ≤ x → x ≤ b → p a → p b → p x):
    (Icc a b).map (Embedding.subtype p) = (Icc a b : Finset α)

(hp : ∀ ⦃a b x : α⦄, a ≤ x → x ≤ b → p a → p b → p x)

Finset.map (Function.Embedding.subtype p) (Finset.Icc a b) = Finset.Icc ↑a ↑b


lemma conductor_le_conductor_mem_conductorSet {d : ℕ} (hd : d ∈ conductorSet χ) :
    χ.conductor ≤ (Classical.choose hd.2).conductor

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
{χ : DirichletCharacter R n}
{d : ℕ}
(hd : d ∈ χ.conductorSet)

χ.conductor ≤ (Classical.choose ⋯).conductor


theorem exists_finset_piecewise_mem_of_mem_nhds [DecidableEq ι] {s : Set (∀ a, π a)} {x : ∀ a, π a}
    (hs : s ∈ 𝓝 x) (y : ∀ a, π a) : ∃ I : Finset ι, I.piecewise x y ∈ s

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
[DecidableEq ι]
{s : Set ((a : ι) → π a)}
{x : (a : ι) → π a}
(hs : s ∈ 𝓝 x)
(y : (a : ι) → π a)


/-- The convex hull of an affine basis is the intersection of the half-spaces defined by the
corresponding barycentric coordinates. -/
theorem AffineBasis.convexHull_eq_nonneg_coord {ι : Type*} (b : AffineBasis ι R E) :
    convexHull R (range b) = { x | ∀ i, 0 ≤ b.coord i x }

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{ι : Type u_8}
(b : AffineBasis ι R E)

(convexHull R) (Set.range ⇑b) = {x | ∀ (i : ι), 0 ≤ (b.coord i) x}


theorem ContDiffWithinAt.comp_contMDiffWithinAt {g : F → F'} {f : M → F} {s : Set M} {t : Set F}
    {x : M} (hg : ContDiffWithinAt 𝕜 n g t (f x)) (hf : ContMDiffWithinAt I 𝓘(𝕜, F) n f s x)
    (h : s ⊆ f ⁻¹' t) : ContMDiffWithinAt I 𝓘(𝕜, F') n (g ∘ f) s x


lemma setIntegral_condKernel_univ_right {s : Set β} (hs : MeasurableSet s)
    (hf : IntegrableOn f (s ×ˢ Set.univ) ρ) :
    ∫ b in s, ∫ ω, f (b, ω) ∂(ρ.condKernel b) ∂ρ.fst = ∫ x in s ×ˢ Set.univ, f x ∂ρ

(hf : MeasureTheory.IntegrableOn f (s ×ˢ Set.univ) ρ)

∫ (b : β) in s, ∫ (ω : Ω), f (b, ω) ∂ρ.condKernel b ∂ρ.fst = ∫ (x : β × Ω) in s ×ˢ Set.univ, f x ∂ρ


/-- The canonical isomorphism `(F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle`. -/
@[simps!]
def mapTriangleCompIso : (F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((F.mapTriangleCompIso G).hom.app X).hom₃ = CategoryTheory.CategoryStruct.id (G.obj (F.obj X.obj₃))


theorem mul_kroneckerTMul_mul [Fintype m] [Fintype m'] (A : Matrix l m α) (B : Matrix m n α)
    (A' : Matrix l' m' β) (B' : Matrix m' n' β) :
    (A * B) ⊗ₖₜ[R] (A' * B') = A ⊗ₖₜ[R] A' * B ⊗ₖₜ[R] B'

(R : Type u_1)
{α : Type u_2}
{β : Type u_4}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{l' : Type u_14}
{m' : Type u_15}
{n' : Type u_16}
[CommSemiring R]
[Semiring α]
[Semiring β]
[Algebra R α]
[Algebra R β]
[Fintype m]
[Fintype m']
(A : Matrix l m α)
(B : Matrix m n α)
(A' : Matrix l' m' β)
(B' : Matrix m' n' β)

Matrix.kroneckerMap (TensorProduct.tmul R) (A * B) (A' * B') =
  Matrix.kroneckerMap (TensorProduct.tmul R) A A' * Matrix.kroneckerMap (TensorProduct.tmul R) B B'


@[simp]
theorem dual_Ici : Ici (toDual a) = ofDual ⁻¹' Iic a

Set.Ici (OrderDual.toDual a) = ⇑OrderDual.ofDual ⁻¹' Set.Iic a


/-- If `e : C ≌ D` is an equivalence of categories, and `iso : e.functor ≅ G` is
an isomorphism, then there is an equivalence of categories whose functor is `G`. -/
@[simps!]
def changeFunctor (e : C ≌ D) {G : C ⥤ D} (iso : e.functor ≅ G) : C ≌ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{G : CategoryTheory.Functor C D}
(iso : e.functor ≅ G)
(X : D)

(e.changeFunctor iso).counitIso.inv.app X =
  CategoryTheory.CategoryStruct.comp (e.counitIso.inv.app X) (iso.hom.app (e.inverse.obj X))


theorem orderOf_cycleOf_dvd_orderOf (f : Perm α) (x : α) : orderOf (cycleOf f x) ∣ orderOf f

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(f : Equiv.Perm α)
(x : α)


theorem Finite.eq_of_subset_of_encard_le (ht : t.Finite) (hst : s ⊆ t) (hts : t.encard ≤ s.encard) :
    s = t

{α : Type u_1}
{s t : Set α}
(ht : t.Finite)
(hst : s ⊆ t)
(hts : t.encard ≤ s.encard)


/-- A multiplicative morphism between monoids gives a monoidal functor between the corresponding
discrete monoidal categories.
-/
@[to_additive (attr := simps) Discrete.addMonoidalFunctor]
def Discrete.monoidalFunctor (F : M →* N) : MonoidalFunctor (Discrete M) (Discrete N)

{M : Type u}
[AddMonoid M]
{N : Type u'}
[AddMonoid N]
(F : M →+ N)
(X : CategoryTheory.Discrete M)

((CategoryTheory.Discrete.addMonoidalFunctor F).obj X).as = F X.as


/-- If `a ^ n = 1`, `n ≠ 0`, then `a` is a unit. -/
@[to_additive (attr := simps!) "If `n • x = 0`, `n ≠ 0`, then `x` is an additive unit."]
def Units.ofPowEqOne (a : M) (n : ℕ) (ha : a ^ n = 1) (hn : n ≠ 0) : Mˣ

{M : Type u_1}
[Monoid M]
(a : M)
(n : ℕ)
(ha : a ^ n = 1)
(hn : n ≠ 0)

↑(Units.ofPowEqOne a n ha hn)⁻¹ = a ^ (n - 1)


theorem dual_node3L (l : Ordnode α) (x : α) (m : Ordnode α) (y : α) (r : Ordnode α) :
    dual (node3L l x m y r) = node3R (dual r) y (dual m) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(m : Ordnode α)
(y : α)
(r : Ordnode α)

(l.node3L x m y r).dual = r.dual.node3R y m.dual x l.dual


/-- Note that `IsSelfAdjoint.zpow` does not apply to matrices as they are not a division ring. -/
theorem IsHermitian.zpow [Fintype m] [DecidableEq m] {A : Matrix m m α} (h : A.IsHermitian)
    (k : ℤ) :
    (A ^ k).IsHermitian

{α : Type u_1}
{m : Type u_3}
[CommRing α]
[StarRing α]
[Fintype m]
[DecidableEq m]
{A : Matrix m m α}
(h : A.IsHermitian)
(k : ℤ)


/-- The mean value theorem set in dimension 1: if the derivative of a function is bounded by `C`,
then the function is `C`-Lipschitz. Version with `deriv` and `LipschitzWith`. -/
theorem _root_.lipschitzWith_of_nnnorm_deriv_le {C : ℝ≥0} (hf : Differentiable 𝕜 f)
    (bound : ∀ x, ‖deriv f x‖₊ ≤ C) : LipschitzWith C f

{𝕜 : Type u_3}
{G : Type u_4}
[RCLike 𝕜]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : 𝕜 → G}
{C : ℝ≥0}
(hf : Differentiable 𝕜 f)
(bound : ∀ (x : 𝕜), ‖deriv f x‖₊ ≤ C)


lemma addContent_mono (hC : IsSetSemiring C) (hs : s ∈ C) (ht : t ∈ C)
    (hst : s ⊆ t) :
    m s ≤ m t

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
{m : MeasureTheory.AddContent C}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(ht : t ∈ C)
(hst : s ⊆ t)


/-- Suppose an indexed family of points is given, along with a subset
of the index type.  A point can be expressed as an
`affineCombination` using a `Finset` lying within that subset and
with sum of weights 1 if and only if it can be expressed an
`affineCombination` with sum of weights 1 for the corresponding
indexed family whose index type is the subtype corresponding to that
subset. -/
theorem eq_affineCombination_subset_iff_eq_affineCombination_subtype {p0 : P} {s : Set ι}
    {p : ι → P} :
    (∃ fs : Finset ι, ↑fs ⊆ s ∧ ∃ w : ι → k, ∑ i ∈ fs, w i = 1 ∧
        p0 = fs.affineCombination k p w) ↔
      ∃ (fs : Finset s) (w : s → k), ∑ i ∈ fs, w i = 1 ∧
        p0 = fs.affineCombination k (fun i : s => p i) w

(k : Type u_1)
(V : Type u_2)
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
{p0 : P}
{s : Set ι}
{p : ι → P}

(∃ fs, ↑fs ⊆ s ∧ ∃ w, ∑ i ∈ fs, w i = 1 ∧ p0 = (Finset.affineCombination k fs p) w) ↔
  ∃ fs w, ∑ i ∈ fs, w i = 1 ∧ p0 = (Finset.affineCombination k fs fun i => p ↑i) w


class HasCoequalizerOfIsSplitPair (G : D ⥤ C) : Prop where
  out : ∀ {A B} (f g : A ⟶ B) [G.IsSplitPair f g], HasCoequalizer f g

[self : CategoryTheory.Monad.HasCoequalizerOfIsSplitPair G]


/-- An isomorphism between `I`-indexed objects gives an isomorphism between each
pair of corresponding components. -/
@[simps]
def isoApp {X Y : ∀ i, C i} (f : X ≅ Y) (i : I) : X i ≅ Y i

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Pi.isoApp f i).inv = f.inv i


theorem Int.mod_nat_eq_sub_mul_floor_rat_div {n : ℤ} {d : ℕ} : n % d = n - d * ⌊(n : ℚ) / d⌋


@[field_simps]
lemma three_ne_zero [OfNat α 3] [NeZero (3 : α)] : (3 : α) ≠ 0

{α : Type u_2}
[Zero α]
[OfNat α 3]
[NeZero 3]


theorem strongRec_eq {motive : Nat → Sort _} (ind : ∀ n, (∀ m, m < n → motive m) → motive n)
    (t : Nat) : Nat.strongRec ind t = ind t fun m _ => Nat.strongRec ind m

(ind : (n : Nat) → ((m : Nat) → m < n → motive m) → motive n)

Nat.strongRec ind t = ind t fun m x => Nat.strongRec ind m


protected theorem pos_of_mul_pos_right {a b : Nat} (h : 0 < a * b) : 0 < a


/-- If `μ` is inner regular for finite measure sets with respect to compact sets,
any measurable set of finite mass can be approximated from inside by compact sets. -/
theorem _root_.MeasurableSet.measure_eq_iSup_isCompact_of_ne_top [InnerRegularCompactLTTop μ]
    ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞) :
    μ A = ⨆ (K) (_ : K ⊆ A) (_ : IsCompact K), μ K

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.InnerRegularCompactLTTop]
⦃A : Set α⦄
(hA : MeasurableSet A)
(h'A : μ A ≠ ⊤)

μ A = ⨆ K, ⨆ (_ : K ⊆ A), ⨆ (_ : IsCompact K), μ K


theorem Ico_mem_nhdsWithin_Iio' (H : a < b) : Ico a b ∈ 𝓝[<] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(H : a < b)


/-- A set is a neighborhood of `a` within `(a, +∞)` if and only if it contains an interval `(a, u]`
with `a < u`. -/
theorem mem_nhdsWithin_Ioi_iff_exists_Ioc_subset [NoMaxOrder α] [DenselyOrdered α] {a : α}
    {s : Set α} : s ∈ 𝓝[>] a ↔ ∃ u ∈ Ioi a, Ioc a u ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMaxOrder α]
[DenselyOrdered α]
{a : α}
{s : Set α}

s ∈ 𝓝[>] a ↔ ∃ u ∈ Set.Ioi a, Set.Ioc a u ⊆ s


theorem csSup_le_csSup (ht : BddAbove t) (hs : s.Nonempty) (h : s ⊆ t) : sSup s ≤ sSup t

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s t : Set α}
(ht : BddAbove t)
(hs : s.Nonempty)
(h : s ⊆ t)


protected theorem IsUpperSet.closure : IsUpperSet s → IsUpperSet (closure s)

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


@[simp]
theorem cospanExt_app_right : (cospanExt iX iY iZ wf wg).app WalkingCospan.right = iY

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Z}
{g : Y ⟶ Z}
{f' : X' ⟶ Z'}
{g' : Y' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iZ.hom)
(wg : iY.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.cospanExt iX iY iZ wf wg).app CategoryTheory.Limits.WalkingCospan.right = iY


@[simp]
theorem sub_filter_eq_filter_not [DecidableEq α] (p) [DecidablePred p] (s : Multiset α) :
    s - s.filter p = s.filter (fun a ↦ ¬ p a)

{α : Type u_1}
[DecidableEq α]
(p : α → Prop)
[DecidablePred p]
(s : Multiset α)

s - Multiset.filter p s = Multiset.filter (fun a => ¬p a) s


/-- Given three points not equal to `p`, adding the angles between them at `p` in cyclic order
results in 0. -/
@[simp]
theorem oangle_add_cyc3 {p p₁ p₂ p₃ : P} (hp₁ : p₁ ≠ p) (hp₂ : p₂ ≠ p) (hp₃ : p₃ ≠ p) :
    ∡ p₁ p p₂ + ∡ p₂ p p₃ + ∡ p₃ p p₁ = 0

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


/-- The algebra morphism `A →ₐ[R] A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
@[simps!]
def includeLeft : A →ₐ[R] 𝒜 ᵍ⊗[R] ℬ

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
(a : A)

(GradedTensorProduct.includeLeft 𝒜 ℬ) a = a ᵍ⊗ₜ[R] 1


lemma polyCharpoly_monic : (polyCharpoly φ b).Monic

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)


lemma isMeasurableRatCDF_toRatCDF (hf : Measurable f) :
    IsMeasurableRatCDF (toRatCDF f)

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)


@[simp] theorem star_im : (star a).im = -a.im


/-- A `Ctop α σ` is a realization of a topology (basis) on `α`,
  represented by a type `σ` together with operations for the top element and
  the intersection operation. -/
structure Ctop (α σ : Type*) where
  f : σ → Set α
  top : α → σ
  top_mem : ∀ x : α, x ∈ f (top x)
  inter : ∀ (a b) (x : α), x ∈ f a ∩ f b → σ
  inter_mem : ∀ a b x h, x ∈ f (inter a b x h)
  inter_sub : ∀ a b x h, f (inter a b x h) ⊆ f a ∩ f b

{α : Type u_1}
{σ : Type u_2}
(self : Ctop α σ)
(a b : σ)
(x : α)
(h : x ∈ self.f a ∩ self.f b)

self.f (self.inter a b x h) ⊆ self.f a ∩ self.f b


/-- Right translation preserves strict concavity. -/
theorem StrictConcaveOn.translate_right (hf : StrictConcaveOn 𝕜 s f) (c : E) :
    StrictConcaveOn 𝕜 ((fun z => c + z) ⁻¹' s) (f ∘ fun z => c + z)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCancelCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : StrictConcaveOn 𝕜 s f)
(c : E)


/-- Two factorisations through monomorphisms satisfying the universal property
must factor through isomorphic objects. -/
@[simps]
def isoExt {F F' : MonoFactorisation f} (hF : IsImage F) (hF' : IsImage F') :
    F.I ≅ F'.I

{F F' : CategoryTheory.Limits.MonoFactorisation f}

(hF' : CategoryTheory.Limits.IsImage F')


theorem nhdsWithin_eq_iff_eventuallyEq {s t : Set α} {x : α} : 𝓝[s] x = 𝓝[t] x ↔ s =ᶠ[𝓝 x] t

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
{x : α}


/-- The normal closure of $(04)(13)$ within $A_5$ is the whole group. This will be
  used to show that the normal closure of any permutation of cycle type $(2,2)$ is the whole group.
  -/
theorem normalClosure_swap_mul_swap_five :
    normalClosure
        ({⟨swap 0 4 * swap 1 3, mem_alternatingGroup.2 (by decide)⟩} :
          Set (alternatingGroup (Fin 5))) =
      ⊤

Subgroup.normalClosure {⟨Equiv.swap 0 4 * Equiv.swap 1 3, ⋯⟩} = ⊤


@[simp]
theorem Complex.LogDeriv_exp : logDeriv (Complex.exp) = 1


@[simp]
theorem transposeAddEquiv_symm [Add α] : (transposeAddEquiv m n α).symm = transposeAddEquiv n m α

(m : Type u_2)
(n : Type u_3)
(α : Type v)
[Add α]

(Matrix.transposeAddEquiv m n α).symm = Matrix.transposeAddEquiv n m α


theorem exists_algHom_of_adjoin_splits_of_aeval : ∃ φ : E →ₐ[F] K, φ x = y

(hK : ∀ s ∈ S, IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))

(hy : (Polynomial.aeval y) (minpoly F x) = 0)


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor'.obj f).f₃₄ = f.right.hom


theorem pi_Ioc_mem_nhds (ha : ∀ i, a i < x i) (hb : ∀ i, x i < b i) : Ioc a b ∈ 𝓝 x

{ι : Type u_1}
{π : ι → Type u_2}
[Finite ι]
[(i : ι) → LinearOrder (π i)]
[(i : ι) → TopologicalSpace (π i)]
[∀ (i : ι), OrderTopology (π i)]
{a b x : (i : ι) → π i}
[Nonempty ι]
(ha : ∀ (i : ι), a i < x i)
(hb : ∀ (i : ι), x i < b i)


@[simp] protected theorem le_inf_iff {a : α} : a ≤ s.inf f ↔ ∀ b ∈ s, a ≤ f b

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{f : β → α}
{a : α}


@[to_additive (attr := simp)]
theorem ofHom_apply {X Y : Type _} [CommGroup X] [CommGroup Y] (f : X →* Y) (x : X) :
    @DFunLike.coe (X →* Y) X (fun _ ↦ Y) _ (ofHom f) x = f x

{X Y : Type u_1}
[CommGroup X]
[CommGroup Y]
(f : X →* Y)
(x : X)


@[nolint unusedHavesSuffices] -- false positive from unfolding String.offsetOfPosAux
theorem offsetOfPosAux_of_valid : ∀ l m r n,
    offsetOfPosAux ⟨l ++ m ++ r⟩ ⟨utf8Len l + utf8Len m⟩ ⟨utf8Len l⟩ n = n + m.length

{ data := l ++ m ++ r }.offsetOfPosAux { byteIdx := String.utf8Len l + String.utf8Len m }
    { byteIdx := String.utf8Len l } n =
  n + m.length


@[simp]
theorem coe_comp (f : FrameHom β γ) (g : FrameHom α β) : ⇑(f.comp g) = f ∘ g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CompleteLattice α]
[CompleteLattice β]
[CompleteLattice γ]
(f : FrameHom β γ)
(g : FrameHom α β)


/-- An elementary embedding of first-order structures is an embedding that commutes with the
  realizations of formulas. -/
structure ElementaryEmbedding where
  toFun : M → N
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_formula' :
    ∀ ⦃n⦄ (φ : L.Formula (Fin n)) (x : Fin n → M), φ.Realize (toFun ∘ x) ↔ φ.Realize x := by
    intros; trivial

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(self : M ↪ₑ[L] N)
⦃n : ℕ⦄
(φ : L.Formula (Fin n))
(x : Fin n → M)


/-- Every ideal of the product ring is of the form `I × J`, where `I` and `J` can be explicitly
    given as the image under the projection maps. -/
theorem ideal_prod_eq (I : Ideal (R × S)) :
    I = Ideal.prod (map (RingHom.fst R S) I : Ideal R) (map (RingHom.snd R S) I)

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal (R × S))

I = (Ideal.map (RingHom.fst R S) I).prod (Ideal.map (RingHom.snd R S) I)


theorem monomial_sum_index {α : Type*} (s : Finset α) (f : α → σ →₀ ℕ) (a : R) :
    monomial (∑ i ∈ s, f i) a = C a * ∏ i ∈ s, monomial (f i) 1

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{α : Type u_2}
(s : Finset α)
(f : α → σ →₀ ℕ)
(a : R)

(MvPolynomial.monomial (∑ i ∈ s, f i)) a = MvPolynomial.C a * ∏ i ∈ s, (MvPolynomial.monomial (f i)) 1


theorem nodup_range' (s n : ℕ) (step := 1) (h : 0 < step := by simp) : Nodup (range' s n step)

(s n : ℕ)
(step : ℕ := 1)
(h : 0 < step := by simp)


/-- A copy of `mul_invOf_self_assoc` for rectangular matrices. -/
protected theorem mul_invOf_self_assoc (A : Matrix n n α) (B : Matrix n m α) [Invertible A] :
    A * (⅟ A * B) = B

{m : Type u_1}
{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
(A : Matrix n n α)
(B : Matrix n m α)
[Invertible A]


@[simp]
theorem isDiag_smul_one (n) [Semiring α] [DecidableEq n] (k : α) :
    (k • (1 : Matrix n n α)).IsDiag

{α : Type u_1}
(n : Type u_6)
[Semiring α]
[DecidableEq n]
(k : α)


@[simp]
theorem realize_denselyOrdered [Preorder M] [h : DenselyOrdered M] :
    M ⊨ Language.order.denselyOrderedSentence

{M : Type w'}
[Preorder M]
[h : DenselyOrdered M]


@[norm_cast]
theorem coe_tsum {f : α → ℝ≥0} : ↑(∑' a, f a) = ∑' a, (f a : ℝ)


theorem degree_lt_degree (h : natDegree p < natDegree q) : degree p < degree q

{R : Type u}
[Semiring R]
{p q : R[X]}
(h : p.natDegree < q.natDegree)


lemma Quot.desc_toCocone_desc {α : Type u} (f : Quot F → α) (hc : IsColimit c) (x : Quot F) :
    hc.desc (toCocone f) (Quot.desc c x) = f x

(f : CategoryTheory.Limits.Types.Quot F → α)

(hc : CategoryTheory.Limits.IsColimit c)

(x : CategoryTheory.Limits.Types.Quot F)

hc.desc (CategoryTheory.Limits.Types.toCocone f) (CategoryTheory.Limits.Types.Quot.desc c x) = f x


theorem fst_eq_snd (F : HomotopyRel f₀ f₁ S) {x : X} (hx : x ∈ S) : f₀ x = f₁ x

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{S : Set X}
(F : f₀.HomotopyRel f₁ S)
{x : X}
(hx : x ∈ S)


/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s


theorem isRat_inv_zero {α} [DivisionRing α] : {a : α} →
    IsNat a (nat_lit 0) → IsNat a⁻¹ (nat_lit 0)

Mathlib.Meta.NormNum.IsNat a 0 → Mathlib.Meta.NormNum.IsNat a⁻¹ 0


theorem denseRange_intCast : DenseRange (Int.cast : ℤ → ℤ_[p])


/-- `M →ₙ* N` is the type of functions `M → N` that preserve multiplication. The `ₙ` in the notation
stands for "non-unital" because it is intended to match the notation for `NonUnitalAlgHom` and
`NonUnitalRingHom`, so a `MulHom` is a non-unital monoid hom.

When possible, instead of parametrizing results over `(f : M →ₙ* N)`,
you should parametrize over `(F : Type*) [MulHomClass F M N] (f : F)`.
When you extend this structure, make sure to extend `MulHomClass`.
-/
@[to_additive]
structure MulHom (M : Type*) (N : Type*) [Mul M] [Mul N] where
  /-- The underlying function -/
  protected toFun : M → N
  /-- The proposition that the function preserves multiplication -/
  protected map_mul' : ∀ x y, toFun (x * y) = toFun x * toFun y

{M : Type u_10}
{N : Type u_11}
[Mul M]
[Mul N]
(self : M →ₙ* N)
(x y : M)

self.toFun (x * y) = self.toFun x * self.toFun y


lemma disjoint_genEigenspace [NoZeroSMulDivisors R M]
    (f : End R M) {μ₁ μ₂ : R} (hμ : μ₁ ≠ μ₂) (k l : ℕ) :
    Disjoint (f.genEigenspace μ₁ k) (f.genEigenspace μ₂ l)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(f : Module.End R M)
{μ₁ μ₂ : R}
(hμ : μ₁ ≠ μ₂)
(k l : ℕ)

Disjoint ((f.genEigenspace μ₁) k) ((f.genEigenspace μ₂) l)


@[simp]
protected theorem abs_neg : ∀ x : EReal, (-x).abs = x.abs


theorem star_injective [InvolutiveStar R] : Function.Injective (star : R → R)


@[simp]
theorem derivation_C (D : Derivation R R[X] A) (a : R) : D (C a) = 0

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Module (Polynomial R) A]
(D : Derivation R (Polynomial R) A)
(a : R)


@[simp]
theorem iUnion_Ioc_left [NoMinOrder α] (b : α) : ⋃ a, Ioc a b = Iic b

{α : Type v}
[Preorder α]
[NoMinOrder α]
(b : α)


/-- The quotient by the center of a group of cardinality `p ^ 2` is cyclic. -/
theorem cyclic_center_quotient_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) :
    IsCyclic (G ⧸ center G)

{p : ℕ}
{G : Type u_1}
[Group G]
[Fact (Nat.Prime p)]
(hG : Nat.card G = p ^ 2)


lemma truncatedSup_union_of_not_mem (hs : a ∉ lowerClosure s) (ht : a ∉ lowerClosure t) :
    truncatedSup (s ∪ t) a = ⊤

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s t : Finset α}
{a : α}
[DecidableEq α]
(hs : a ∉ lowerClosure ↑s)
(ht : a ∉ lowerClosure ↑t)


lemma BijOn.forall {p : β → Prop} (hf : BijOn f s t) : (∀ b ∈ t, p b) ↔ ∀ a ∈ s, p (f a)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
{p : β → Prop}
(hf : Set.BijOn f s t)


theorem isOpen_iff : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ball x ε ⊆ s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}

IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, Metric.ball x ε ⊆ s


protected lemma _root_.IsClosed.everywherePosSubset (hs : IsClosed s) :
    IsClosed (μ.everywherePosSubset s)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : IsClosed s)


/-- A family of gluing data consists of
1. An index type `J`
2. A bundled topological space `U i` for each `i : J`.
3. An open set `V i j ⊆ U i` for each `i j : J`.
4. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `V i i = U i`.
7. `t i i` is the identity.
8. For each `x ∈ V i j ∩ V i k`, `t i j x ∈ V j k`.
9. `t j k (t i j x) = t i k x`.

We can then glue the topological spaces `U i` together by identifying `V i j` with `V j i`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure MkCore where
  {J : Type u}
  U : J → TopCat.{u}
  V : ∀ i, J → Opens (U i)
  t : ∀ i j, (Opens.toTopCat _).obj (V i j) ⟶ (Opens.toTopCat _).obj (V j i)
  V_id : ∀ i, V i i = ⊤
  t_id : ∀ i, ⇑(t i i) = id
  t_inter : ∀ ⦃i j⦄ (k) (x : V i j), ↑x ∈ V i k → (((↑) : (V j i) → (U j)) (t i j x)) ∈ V j k
  cocycle :
    ∀ (i j k) (x : V i j) (h : ↑x ∈ V i k),
      -- Porting note: the underscore in the next line was `↑(t i j x)`, but Lean type-mismatched
      (((↑) : (V k j) → (U k)) (t j k ⟨_, t_inter k x h⟩)) = ((↑) : (V k i) → (U k)) (t i k ⟨x, h⟩)

(self : TopCat.GlueData.MkCore)
(i j k : self.J)
(x : ↥(self.V i j))
(h : ↑x ∈ self.V i k)

↑((self.t j k) ⟨↑((self.t i j) x), ⋯⟩) = ↑((self.t i k) ⟨↑x, h⟩)


/-- If `f` is surjective, `i` is injective, and there exists some `m` such that
`LinearMap.iterateMapComap f i m K = LinearMap.iterateMapComap f i (m + 1) K`,
then the kernel of `f` is contained in `K`.
This is a corollary of `LinearMap.iterateMapComap_eq_succ` and `LinearMap.ker_le_comap`.
As a special case, if one can take `K` to be zero,
then `f` is injective. This is the key result for establishing the strong rank condition
for noetherian rings. -/
theorem ker_le_of_iterateMapComap_eq_succ (K : Submodule R N)
    (m : ℕ) (heq : f.iterateMapComap i m K = f.iterateMapComap i (m + 1) K)
    (hf : Surjective f) (hi : Injective i) : LinearMap.ker f ≤ K


theorem condexpL1_eq (hf : Integrable f μ) : condexpL1 hm μ f = condexpL1CLM F' hm μ (hf.toL1 f)

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{f : α → F'}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.condexpL1 hm μ f = (MeasureTheory.condexpL1CLM F' hm μ) (MeasureTheory.Integrable.toL1 f hf)


@[reassoc (attr := simp)]
lemma tensorHom_fst {X₁ X₂ Y₁ Y₂ : C} (f : X₁ ⟶ X₂) (g : Y₁ ⟶ Y₂) :
    (f ⊗ g) ≫ fst _ _ = fst _ _ ≫ f

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom f g)
    (CategoryTheory.ChosenFiniteProducts.fst X₂ Y₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ChosenFiniteProducts.fst X₁ Y₁) f


theorem card_chunk (hm : m ≠ 0) : (chunk hP G ε hU).parts.card = 4 ^ P.parts.card

(hm : Fintype.card α / SzemerediRegularity.stepBound P.parts.card ≠ 0)

(SzemerediRegularity.chunk hP G ε hU).parts.card = 4 ^ P.parts.card


protected theorem le_of_sub_nonneg {a b : Int} (h : 0 ≤ a - b) : b ≤ a


/-- Analogous to `Finset.induction_on'`. -/
@[elab_as_elim]
theorem Finite.induction_on' {C : Set α → Prop} {S : Set α} (h : S.Finite) (H0 : C ∅)
    (H1 : ∀ {a s}, a ∈ S → s ⊆ S → a ∉ s → C s → C (insert a s)) : C S

(H1 : ∀ {a : α} {s : Set α}, a ∈ S → s ⊆ S → a ∉ s → C s → C (insert a s))


theorem normSq_eq_abs (x : ℂ) : normSq x = (Complex.abs x) ^ 2


/--
  A form of the chain rule: if `f` is a polynomial over `R`
  and `d : A → M` is an `R`-derivation then for all `a : A` we have
  $$ d(f(a)) = f' (a) d a. $$
  The equation is in `M`. For the same equation in `Module.AEval R M a`,
  see `Derivation.compAEval_eq`.
-/
theorem comp_aeval_eq (d : Derivation R A M) (f : R[X]) :
    d (aeval a f) = aeval a (derivative f) • d a

{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(a : A)
(d : Derivation R A M)
(f : Polynomial R)

d ((Polynomial.aeval a) f) = (Polynomial.aeval a) (Polynomial.derivative f) • d a


theorem isOpen_basicOpen {a : A} : IsOpen (basicOpen 𝒜 a : Set (ProjectiveSpectrum 𝒜))

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{a : A}

IsOpen ↑(ProjectiveSpectrum.basicOpen 𝒜 a)


@[simp]
theorem revzip_map_snd (l : List α) : (revzip l).map Prod.snd = l.reverse


@[simp]
theorem blockDiag'_conjTranspose {α : Type*} [AddMonoid α] [StarAddMonoid α]
    (M : Matrix (Σi, m' i) (Σi, n' i) α) (k : o) : blockDiag' Mᴴ k = (blockDiag' M k)ᴴ

(M : Matrix ((i : o) × m' i) ((i : o) × n' i) α)


protected theorem ext_iff (p q : MvPolynomial σ R) : p = q ↔ ∀ m, coeff m p = coeff m q

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p q : MvPolynomial σ R)

p = q ↔ ∀ (m : σ →₀ ℕ), MvPolynomial.coeff m p = MvPolynomial.coeff m q


theorem PartialOrder.ext {A B : PartialOrder α}
    (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) : A = B

{α : Type u_2}
{A B : PartialOrder α}
(H : ∀ (x y : α), x ≤ y ↔ x ≤ y)


theorem abs_areaForm_of_orthogonal {x y : E} (h : ⟪x, y⟫ = 0) : |ω x y| = ‖x‖ * ‖y‖

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


/-- Every member of an open set in a compact Hausdorff totally disconnected space
  is contained in a clopen set contained in the open set.  -/
theorem compact_exists_isClopen_in_isOpen {x : X} {U : Set X} (is_open : IsOpen U) (memU : x ∈ U) :
    ∃ V : Set X, IsClopen V ∧ x ∈ V ∧ V ⊆ U

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
[CompactSpace X]
[TotallyDisconnectedSpace X]
{x : X}
{U : Set X}
(is_open : IsOpen U)
(memU : x ∈ U)


theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo ↑a ↑b

Finset.map (Function.Embedding.subtype fun n => 0 < n) (Finset.Ioo a b) = Finset.Ioo ↑a ↑b


@[simp]
lemma lt_sub_one_iff {k : Fin (n + 2)} : k < k - 1 ↔ k = 0


theorem finite_quotient_span_sub_one' [hcycl : IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑p) :
    Finite (𝓞 K ⧸ Ideal.span {hζ.toInteger - 1})

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)


lemma spectrum_subset_circle_of_mem_unitary {u : A} (hu : u ∈ unitary A) :
    spectrum ℂ u ⊆ circle


/-- The unit for the equivalence `CommMon_ (C ⥤ D) ≌ C ⥤ CommMon_ D`.
-/
@[simps!]
def unitIso : 𝟭 (CommMon_ (C ⥤ D)) ≅ functor ⋙ inverse

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
[CategoryTheory.BraidedCategory D]
(X : CommMon_ (C ⥤ D))

∀ (x : C),
  (CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.unitIso.inv.app X).hom.app x =
    𝟙 ((CommMon_.forget₂Mon_ D).obj ((CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.functor.obj X).obj x)).X


theorem iteratedFDeriv_succ_apply_left {n : ℕ} (m : Fin (n + 1) → E) :
    (iteratedFDeriv 𝕜 (n + 1) f x : (Fin (n + 1) → E) → F) m =
      (fderiv 𝕜 (iteratedFDeriv 𝕜 n f) x : E → E[×n]→L[𝕜] F) (m 0) (tail m)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}
(m : Fin (n + 1) → E)

(iteratedFDeriv 𝕜 (n + 1) f x) m = ((fderiv 𝕜 (iteratedFDeriv 𝕜 n f) x) (m 0)) (Fin.tail m)


@[elementwise, reassoc]
theorem restrictStalkIso_hom_eq_germ {U : TopCat} (X : PresheafedSpace.{_, _, v} C)
    {f : U ⟶ (X : TopCat.{v})} (h : OpenEmbedding f) (V : Opens U) (x : U) (hx : x ∈ V) :
    (X.restrict h).presheaf.germ ⟨x, hx⟩ ≫ (restrictStalkIso X h x).hom =
    X.presheaf.germ ⟨f x, show f x ∈ h.isOpenMap.functor.obj V from ⟨x, hx, rfl⟩⟩

(X : AlgebraicGeometry.PresheafedSpace C)

(X.restrict h).presheaf.germ ⟨x, hx⟩ ≫ (X.restrictStalkIso h x).hom = X.presheaf.germ ⟨f x, ⋯⟩


theorem abs_cos_eq_abs_sin_of_two_zsmul_add_two_zsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℤ) • θ + (2 : ℤ) • ψ = π) : |cos θ| = |sin ψ|

{θ ψ : Real.Angle}
(h : 2 • θ + 2 • ψ = ↑π)


lemma LocallyLinear.card_edgeFinset (hG : G.LocallyLinear) :
    G.edgeFinset.card = 3 * (G.cliqueFinset 3).card

{α : Type u_1}
{G : SimpleGraph α}
[DecidableEq α]
[Fintype α]
[DecidableRel G.Adj]
(hG : G.LocallyLinear)


/-- If `‖y‖ → ∞`, then we can assume `y ≠ x` for any fixed `x`. -/
@[to_additive eventually_ne_of_tendsto_norm_atTop "If `‖y‖→∞`, then we can assume `y≠x` for any
fixed `x`"]
theorem eventually_ne_of_tendsto_norm_atTop' {l : Filter α} {f : α → E}
    (h : Tendsto (fun y => ‖f y‖) l atTop) (x : E) : ∀ᶠ y in l, f y ≠ x

(h : Filter.Tendsto (fun y => ‖f y‖) l Filter.atTop)


theorem eventually_pow_one_div_le (x : ℝ≥0) {y : ℝ≥0} (hy : 1 < y) :
    ∀ᶠ n : ℕ in atTop, x ^ (1 / n : ℝ) ≤ y

∀ᶠ (n : ℕ) in Filter.atTop, x ^ (1 / ↑n) ≤ y


/-- An `I`-filtration on the module `M` is a sequence of decreasing submodules `N i` such that
`I • (N i) ≤ N (i + 1)`. Note that we do not require the filtration to start from `⊤`. -/
@[ext]
structure Ideal.Filtration (M : Type u) [AddCommGroup M] [Module R M] where
  N : ℕ → Submodule R M
  mono : ∀ i, N (i + 1) ≤ N i
  smul_le : ∀ i, I • N i ≤ N (i + 1)

{R : Type u}
[CommRing R]
{I : Ideal R}
{M : Type u}
[AddCommGroup M]
[Module R M]
(self : I.Filtration M)
(i : ℕ)


theorem u_biSup_l [CompleteLattice α] [CompleteLattice β] (gi : GaloisCoinsertion l u) {ι : Sort x}
    {p : ι → Prop} (f : ∀ (i) (_ : p i), α) : u (⨆ (i) (hi), l (f i hi)) = ⨆ (i) (hi), f i hi

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisCoinsertion l u)
{ι : Sort x}
{p : ι → Prop}
(f : (i : ι) → p i → α)

u (⨆ i, ⨆ (hi : p i), l (f i hi)) = ⨆ i, ⨆ (hi : p i), f i hi


@[to_additive]
theorem subset_mulTSupport (f : X → α) : mulSupport f ⊆ mulTSupport f

{X : Type u_1}
{α : Type u_2}
[One α]
[TopologicalSpace X]
(f : X → α)


/-- If a set `s` is to the left of a set `t`, and both contain the boundary point `x`, then
the variation of `f` along `s ∪ t` is the sum of the variations. -/
theorem union (f : α → E) {s t : Set α} {x : α} (hs : IsGreatest s x) (ht : IsLeast t x) :
    eVariationOn f (s ∪ t) = eVariationOn f s + eVariationOn f t

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
{s t : Set α}
{x : α}
(hs : IsGreatest s x)
(ht : IsLeast t x)


@[mono]
theorem LEComap.mono (h : LEComap f A B) (hA : A' ≤ A) (hB : B ≤ B') : LEComap f A' B'

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : C(X, Y)}
{A A' : DiscreteQuotient X}
{B B' : DiscreteQuotient Y}
(h : DiscreteQuotient.LEComap f A B)
(hA : A' ≤ A)
(hB : B ≤ B')


theorem Filter.Tendsto.div_atTop {a : 𝕜} (h : Tendsto f l (𝓝 a)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x / g x) l (𝓝 0)

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{a : 𝕜}
(h : Filter.Tendsto f l (𝓝 a))
(hg : Filter.Tendsto g l Filter.atTop)

Filter.Tendsto (fun x => f x / g x) l (𝓝 0)


/-- Given a function `U : ι → α` for `[CompleteLattice α]`,
`iSup U` provides a cocone over `diagram U`.
-/
@[simps]
def cocone : Cocone (diagram U)

{ι α : Type v}
(U : ι → α)
[CompleteLattice α]
(o : CategoryTheory.Pairwise ι)

(CategoryTheory.Pairwise.cocone U).ι.app o = CategoryTheory.Pairwise.coconeιApp U o


lemma tendsto_cofinite_cocompact_iff :
    Tendsto f cofinite (cocompact _) ↔ ∀ K, IsCompact K → Set.Finite (f ⁻¹' K)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace Y]
{f : X → Y}

Filter.Tendsto f Filter.cofinite (Filter.cocompact Y) ↔ ∀ (K : Set Y), IsCompact K → (f ⁻¹' K).Finite


/-- The counit isomorphism for `dgoEquivHomologicalComplex`.
-/
@[simps!]
def dgoEquivHomologicalComplexCounitIso :
    homologicalComplexToDGO b V ⋙ dgoToHomologicalComplex b V ≅
      𝟭 (HomologicalComplex V (ComplexShape.up' b))

(X : HomologicalComplex V (ComplexShape.up' b))

((HomologicalComplex.dgoEquivHomologicalComplexCounitIso b V).inv.app X).f i = 𝟙 (X.X i)


@[simp]
theorem iUnion_top : (⊤ : Prepartition I).iUnion = I


@[to_additive (attr := simp)]
theorem map_inv (f : α → β) (x : FreeGroup α) : f <$> x⁻¹ = (f <$> x)⁻¹

{α β : Type u}
(f : α → β)
(x : FreeAddGroup α)


@[simp]
theorem comap_id (S : PointedCone 𝕜 E) : S.comap LinearMap.id = S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(S : PointedCone 𝕜 E)


@[simp] theorem length_concat (as : List α) (a : α) : (concat as a).length = as.length + 1


@[simp] protected theorem mul_zero (a : Rat) : a * 0 = 0


theorem epi_of_epi_map (F : C ⥤ D) [ReflectsEpimorphisms F] {X Y : C} {f : X ⟶ Y}
    (h : Epi (F.map f)) : Epi f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
[F.ReflectsEpimorphisms]
{X Y : C}
{f : X ⟶ Y}
(h : CategoryTheory.Epi (F.map f))


theorem mono (hf : RightOrdContinuous f) : Monotone f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : RightOrdContinuous f)


theorem Wbtw.left_ne_right_of_ne_right {x y z : P} (h : Wbtw R x y z) (hne : y ≠ z) : x ≠ z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Wbtw R x y z)
(hne : y ≠ z)


lemma closure_eq_subtypeClosure (M : Matroid α) (X : Set α) :
    M.closure X = M.subtypeClosure ⟨X ∩ M.E, inter_subset_right⟩

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

M.closure X = ↑(M.subtypeClosure ⟨X ∩ M.E, ⋯⟩)


@[simp] theorem utf8Len_reverseAux (cs₁ cs₂) :
    utf8Len (cs₁.reverseAux cs₂) = utf8Len cs₁ + utf8Len cs₂

String.utf8Len (cs₁.reverseAux cs₂) = String.utf8Len cs₁ + String.utf8Len cs₂


/-- If `η` is an oplax natural transformation between `F` and `G`, we have a 1-morphism
`η.app a : F.obj a ⟶ G.obj a` for each object `a : B`. We also have a 2-morphism
`η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism `f : a ⟶ b`.
These 2-morphisms satisfies the naturality condition, and preserve the identities and
the compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure OplaxNatTrans (F G : OplaxFunctor B C) where
  app (a : B) : F.obj a ⟶ G.obj a
  naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ⟶ app a ≫ G.map f
  naturality_naturality :
    ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
      F.map₂ η ▷ app b ≫ naturality g = naturality f ≫ app a ◁ G.map₂ η := by
    aesop_cat
  naturality_id :
    ∀ a : B,
      naturality (𝟙 a) ≫ app a ◁ G.mapId a =
        F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by
    aesop_cat
  naturality_comp :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
      naturality (f ≫ g) ≫ app a ◁ G.mapComp f g =
        F.mapComp f g ▷ app c ≫
          (α_ _ _ _).hom ≫
            F.map f ◁ naturality g ≫ (α_ _ _ _).inv ≫ naturality f ▷ G.map g ≫ (α_ _ _ _).hom := by
    aesop_cat

(self : CategoryTheory.OplaxNatTrans F G)

CategoryTheory.CategoryStruct.comp (self.naturality (CategoryTheory.CategoryStruct.comp f g))
    (CategoryTheory.Bicategory.whiskerLeft (self.app a) (G.mapComp f g)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g) (self.app c))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (self.app c)).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (self.naturality g))
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (self.app b) (G.map g)).inv
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.naturality f) (G.map g))
            (CategoryTheory.Bicategory.associator (self.app a) (G.map f) (G.map g)).hom))))


/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
    (h : ∀ x ∈ s, ∏ a ∈ s.filter fun y => y ≈ x, f a = 1) : ∏ x ∈ s, f x = 1

(h : ∀ x ∈ s, ∑ a ∈ Finset.filter (fun y => y ≈ x) s, f a = 0)


theorem wittNSMul_vars (m : ℕ) (n : ℕ) :
    (wittNSMul p m n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(m n : ℕ)

(WittVector.wittNSMul p m n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)


theorem toFilteriUnion_congr (I : Box ι) (l : IntegrationParams) {π₁ π₂ : Prepartition I}
    (h : π₁.iUnion = π₂.iUnion) : l.toFilteriUnion I π₁ = l.toFilteriUnion I π₂

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)
(l : BoxIntegral.IntegrationParams)
{π₁ π₂ : BoxIntegral.Prepartition I}
(h : π₁.iUnion = π₂.iUnion)


@[ext]
theorem ext : ∀ {ϕ₁ ϕ₂ : Flow τ α}, (∀ t x, ϕ₁ t x = ϕ₂ t x) → ϕ₁ = ϕ₂

{τ : Type u_1}
[AddMonoid τ]
[TopologicalSpace τ]
[ContinuousAdd τ]
{α : Type u_2}
[TopologicalSpace α]
{ϕ₁ ϕ₂ : Flow τ α}

(∀ (t : τ) (x : α), ϕ₁.toFun t x = ϕ₂.toFun t x) → ϕ₁ = ϕ₂


@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ < a₂ * b₂ → a₁ < a₂ ∨ b₁ < b₂

[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]


@[to_additive (attr := simp, norm_cast)]
theorem coe_one : ((1 : S') : M₁) = 1

{A : Type u_4}
{M₁ : Type u_5}
[SetLike A M₁]
[One M₁]
[hA : OneMemClass A M₁]
(S' : A)


/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ)

{α : Type u_7}
{β : Type u_8}
[Add α]
[Mul α]
[Add β]
[Mul β]
(f : αᵐᵒᵖ ≃+* βᵐᵒᵖ)

∀ (a : β), (RingEquiv.op.symm f).symm a = MulOpposite.unop ((↑f).symm (MulOpposite.op a))


theorem mul_nonpos_of_nonpos_of_nonneg [MulPosMono α] (ha : a ≤ 0) (hb : 0 ≤ b) : a * b ≤ 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[MulPosMono α]
(ha : a ≤ 0)
(hb : 0 ≤ b)


@[simp]
theorem toRingEquiv_eq_coe (e : A ≃⋆ₐ[R] B) : e.toRingEquiv = e

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(e : A ≃⋆ₐ[R] B)


/-- The forgetful braided functor from a full braided subcategory into the original category
("forgetting" the condition).
-/
@[simps!]
def fullBraidedSubcategoryInclusion : BraidedFunctor (FullSubcategory P) C

(X Y : CategoryTheory.FullSubcategory P)

(CategoryTheory.MonoidalCategory.fullBraidedSubcategoryInclusion P).μ X Y =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X.obj Y.obj)


lemma differentiable_completedCosZeta₀ (a : UnitAddCircle) :
    Differentiable ℂ (completedCosZeta₀ a)

Differentiable ℂ (HurwitzZeta.completedCosZeta₀ a)


@[simp]
theorem lcompₛₗ_apply (f : M →ₛₗ[σ₁₂] N) (g : N →ₛₗ[σ₂₃] P) (x : M) :
    lcompₛₗ P σ₂₃ f g x = g (f x)

{R : Type u_1}
[CommSemiring R]
{R₂ : Type u_2}
[CommSemiring R₂]
{R₃ : Type u_3}
[CommSemiring R₃]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R₂ N]
[Module R₃ P]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M →ₛₗ[σ₁₂] N)
(g : N →ₛₗ[σ₂₃] P)
(x : M)

((LinearMap.lcompₛₗ P σ₂₃ f) g) x = g (f x)


theorem iff_of_openCover (𝒰 : Y.OpenCover) :
    P f ↔ ∀ i, P (𝒰.pullbackHom f i)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[hP : AlgebraicGeometry.IsLocalAtTarget P]

P f ↔ ∀ (i : (𝒰.pullbackCover f).J), P (𝒰.pullbackHom f i)


theorem prod_eq_biUnion_left : s ×ˢ t = ⋃ a ∈ s, (fun b => (a, b)) '' t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}


theorem filterMap_mono (h : s ⊆ t) :
    filterMap f s f_inj ⊆ filterMap f t f_inj

{f_inj : ∀ (a a' : α), ∀ b ∈ f a, b ∈ f a' → a = a'}

Finset.filterMap f s f_inj ⊆ Finset.filterMap f t f_inj


/-- Uniqueness of lift. -/
theorem lift_eq (f : M →ₗ[R] N) (g : Hausdorffification I M →ₗ[R] N) (hg : g.comp (of I M) = f) :
    g = lift I f

(hg : g ∘ₗ Hausdorffification.of I M = f)


theorem HasImageMap.transport {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g)
    (F : MonoFactorisation f.hom) {F' : MonoFactorisation g.hom} (hF' : IsImage F')
    (map : F.I ⟶ F'.I) (map_ι : map ≫ F'.m = F.m ≫ sq.right) : HasImageMap sq

(F : CategoryTheory.Limits.MonoFactorisation f.hom)

{F' : CategoryTheory.Limits.MonoFactorisation g.hom}

(hF' : CategoryTheory.Limits.IsImage F')


@[simp]
theorem swap_swap : ∀ x : α × β, swap (swap x) = x

{α : Type u_1}
{β : Type u_2}
(x : α × β)


theorem coe_inj {U V : Opens α} : (U : Set α) = V ↔ U = V

{α : Type u_2}
[TopologicalSpace α]
{U V : TopologicalSpace.Opens α}


theorem convex_iff_sum_mem : Convex R s ↔ ∀ (t : Finset E) (w : E → R),
    (∀ i ∈ t, 0 ≤ w i) → ∑ i ∈ t, w i = 1 → (∀ x ∈ t, x ∈ s) → (∑ x ∈ t, w x • x) ∈ s

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Set E}

Convex R s ↔
  ∀ (t : Finset E) (w : E → R), (∀ i ∈ t, 0 ≤ w i) → ∑ i ∈ t, w i = 1 → (∀ x ∈ t, x ∈ s) → ∑ x ∈ t, w x • x ∈ s


/-- `inl_` is the functor `X ↦ inl X`. -/
@[simps]
def inl_ : C ⥤ C ⊕ D

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


@[to_additive]
theorem csInf_div (hs₀ : s.Nonempty) (hs₁ : BddBelow s) (ht₀ : t.Nonempty) (ht₁ : BddAbove t) :
    sInf (s / t) = sInf s / sSup t

[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 mapRange_add (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0)
    (hf' : ∀ i x y, f i (x + y) = f i x + f i y) (g₁ g₂ : Π₀ i, β₁ i) :
    mapRange f hf (g₁ + g₂) = mapRange f hf g₁ + mapRange f hf g₂

(hf' : ∀ (i : ι) (x y : β₁ i), f i (x + y) = f i x + f i y)

DFinsupp.mapRange f hf (g₁ + g₂) = DFinsupp.mapRange f hf g₁ + DFinsupp.mapRange f hf g₂


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor.obj f).f₁₃ = f.left.hom


@[to_additive]
lemma uniqueMul_of_twoUniqueMul {G} [Mul G] {A B : Finset G} (h : 1 < A.card * B.card →
    ∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueMul A B p1.1 p1.2 ∧ UniqueMul A B p2.1 p2.2)
    (hA : A.Nonempty) (hB : B.Nonempty) : ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b


@[simp]
theorem succ_eq_iff_isMax : succ a = a ↔ IsMax a

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}


/-- To prove something for an arbitrary integrable function in a normed group,
it suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in the `L¹` space for which the property holds is closed.
* the property is closed under the almost-everywhere equal relation.

It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in `h_add` it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of `{0}`).
-/
@[elab_as_elim]
theorem Integrable.induction (P : (α → E) → Prop)
    (h_ind : ∀ (c : E) ⦃s⦄, MeasurableSet s → μ s < ∞ → P (s.indicator fun _ => c))
    (h_add :
      ∀ ⦃f g : α → E⦄,
        Disjoint (support f) (support g) → Integrable f μ → Integrable g μ → P f → P g → P (f + g))
    (h_closed : IsClosed { f : α →₁[μ] E | P f })
    (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Integrable f μ → P f → P g) :
    ∀ ⦃f : α → E⦄, Integrable f μ → P f

(h_ind : ∀ (c : E) ⦃s : Set α⦄, MeasurableSet s → μ s < ⊤ → P (s.indicator fun x => c))

(h_add :
  ∀ ⦃f g : α → E⦄,
    Disjoint (Function.support f) (Function.support g) →
      MeasureTheory.Integrable f μ → MeasureTheory.Integrable g μ → P f → P g → P (f + g))

(h_ae : ∀ ⦃f g : α → E⦄, f =ᵐ[μ] g → MeasureTheory.Integrable f μ → P f → P g)


@[to_additive]
theorem tprod_lt_tprod (h : f ≤ g) (hi : f i < g i) (hf : Multipliable f) (hg : Multipliable g) :
    ∏' n, f n < ∏' n, g n

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
[OrderClosedTopology α]
{f g : ι → α}
{i : ι}
(h : f ≤ g)
(hi : f i < g i)
(hf : Summable f)
(hg : Summable g)


theorem Monic.nextCoeff_prod (s : Finset ι) (f : ι → R[X]) (h : ∀ i ∈ s, Monic (f i)) :
    nextCoeff (∏ i ∈ s, f i) = ∑ i ∈ s, nextCoeff (f i)

{R : Type u}
{ι : Type y}
[CommSemiring R]
(s : Finset ι)
(f : ι → R[X])
(h : ∀ i ∈ s, (f i).Monic)

(∏ i ∈ s, f i).nextCoeff = ∑ i ∈ s, (f i).nextCoeff


/-- Definition of the function on the quotient by a congruence relation `c` induced by a function
    that is constant on `c`'s equivalence classes. -/
@[to_additive (attr := simp) "Definition of the function on the quotient by an additive congruence
relation `c` induced by a function that is constant on `c`'s equivalence classes."]
protected theorem liftOn_coe {β} (c : Con M) (f : M → β) (h : ∀ a b, c a b → f a = f b) (x : M) :
    Con.liftOn (x : c.Quotient) f h = f x

{M : Type u_1}
[Add M]
{β : Sort u_4}
(c : AddCon M)
(f : M → β)
(h : ∀ (a b : M), c a b → f a = f b)
(x : M)


theorem equiv_fst_eq_mul_inv (g : G) : ↑(hST.equiv g).fst = g * ((hST.equiv g).snd : G)⁻¹

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
(g : G)

↑(hST.equiv g).1 = g * (↑(hST.equiv g).2)⁻¹


@[simp]
theorem mk_left_unitor_hom : Quot.mk _ (Hom₂.left_unitor f) = (λ_ f).hom

{B : Type u}
[Quiver B]
{a b : CategoryTheory.FreeBicategory B}
(f : a ⟶ b)

Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.left_unitor f) =
  (CategoryTheory.Bicategory.leftUnitor f).hom


theorem HasStrictFDerivAt.arctan (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => arctan (f x)) ((1 / (1 + f x ^ 2)) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)

HasStrictFDerivAt (fun x => Real.arctan (f x)) ((1 / (1 + f x ^ 2)) • f') x


@[fun_prop]
theorem DifferentiableAt.continuousAt (h : DifferentiableAt 𝕜 f x) : ContinuousAt f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(h : DifferentiableAt 𝕜 f x)


@[simp]
theorem nnnorm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖₊ = ‖v‖₊

{n : Type u_4}
{α : Type u_5}
[Fintype n]
[SeminormedAddCommGroup α]
[DecidableEq n]
(v : n → α)


@[to_additive (attr := simp)]
theorem srange_snd [Nonempty M] : (snd M N).srange = ⊤

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
[Nonempty M]


theorem measurableSpace_min (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    (hτ.min hπ).measurableSpace = hτ.measurableSpace ⊓ hπ.measurableSpace

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ π : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(hπ : MeasureTheory.IsStoppingTime f π)

⋯.measurableSpace = hτ.measurableSpace ⊓ hπ.measurableSpace


theorem pos_size_of_mem [LE α] [@DecidableRel α (· ≤ ·)] {x : α} {t : Ordnode α} (h : Sized t)
    (h_mem : x ∈ t) : 0 < size t

{α : Type u_1}
[LE α]
[DecidableRel fun x x_1 => x ≤ x_1]
{x : α}
{t : Ordnode α}
(h : t.Sized)
(h_mem : x ∈ t)


theorem pointwise_smul_le_iff₀ {a : M} (ha : a ≠ 0) {S T : Subring R} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{M : Type u_1}
{R : Type u_2}
[GroupWithZero M]
[Ring R]
[MulSemiringAction M R]
{a : M}
(ha : a ≠ 0)
{S T : Subring R}

a • S ≤ T ↔ S ≤ a⁻¹ • T


theorem some_removeNone_iff {x : α} : some (removeNone e x) = e none ↔ e.symm none = some x

{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)
{x : α}

some (e.removeNone x) = e none ↔ e.symm none = some x


/-- Change a `Cone F` into a `Cocone F.op`. -/
@[simps]
def Cone.op (c : Cone F) : Cocone F.op

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


theorem sSup_union {s t : Set α} : sSup (s ∪ t) = sSup s ⊔ sSup t

{α : Type u_1}
[CompleteLattice α]
{s t : Set α}


{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{e : α → β}
(de : DenseEmbedding e)


theorem pairwiseDisjoint_slice : (Set.univ : Set ℕ).PairwiseDisjoint (slice 𝒜)


/-- Any non-identity element of a finite group of prime order generates the group. -/
@[to_additive "Any non-identity element of a finite group of prime order generates the group."]
theorem zpowers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ}
    [hp : Fact p.Prime] (h : Fintype.card G = p) {g : G} (hg : g ≠ 1) : zpowers g = ⊤

∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g : G}, g ≠ 1 → Subgroup.zpowers g = ⊤


theorem nontrivial_span_singleton {x : M} (h : x ≠ 0) : Nontrivial (R ∙ x)

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


theorem star_mem {U : R} (hU : U ∈ unitary R) : star U ∈ unitary R

{R : Type u_1}
[Monoid R]
[StarMul R]
{U : R}
(hU : U ∈ unitary R)


theorem lift'_principal {s : Set α} (hh : Monotone h) : (𝓟 s).lift' h = 𝓟 (h s)

{α : Type u_1}
{β : Type u_2}
{h : Set α → Set β}
{s : Set α}
(hh : Monotone h)


theorem toDual_le_iff {a : WithTop α} {b : WithBot αᵒᵈ} :
    WithTop.toDual a ≤ b ↔ WithBot.ofDual b ≤ a

{α : Type u_1}
[LE α]
{a : WithTop α}
{b : WithBot αᵒᵈ}


lemma isDivSequence_id : IsDivSequence id


@[fun_prop]
theorem hasStrictFDerivAt_id (x : E) : HasStrictFDerivAt id (id 𝕜 E) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)

HasStrictFDerivAt id (ContinuousLinearMap.id 𝕜 E) x


theorem UniformSpace.hasBasis_nhds_prod (x y : α) :
    HasBasis (𝓝 (x, y)) (fun s => s ∈ 𝓤 α ∧ SymmetricRel s) fun s => ball x s ×ˢ ball y s

{α : Type ua}
[UniformSpace α]
(x y : α)

(𝓝 (x, y)).HasBasis (fun s => s ∈ 𝓤 α ∧ SymmetricRel s) fun s => UniformSpace.ball x s ×ˢ UniformSpace.ball y s


theorem Set.Finite.interior_biInter {ι : Type*} {s : Set ι} (hs : s.Finite) (f : ι → Set X) :
    interior (⋂ i ∈ s, f i) = ⋂ i ∈ s, interior (f i)

{X : Type u}
[TopologicalSpace X]
{ι : Type u_3}
{s : Set ι}
(hs : s.Finite)
(f : ι → Set X)


theorem mem_upperBounds_image (Hf : AntitoneOn f t) (Hst : s ⊆ t) (Has : a ∈ lowerBounds s) :
    a ∈ t → f a ∈ upperBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
{a : α}
(Hf : AntitoneOn f t)
(Hst : s ⊆ t)
(Has : a ∈ lowerBounds s)


theorem gauge_mono (hs : Absorbent ℝ s) (h : s ⊆ t) : gauge t ≤ gauge s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s t : Set E}
(hs : Absorbent ℝ s)
(h : s ⊆ t)


theorem _root_.IsCoprime.exists (h : IsCoprime I J) : ∃ i ∈ I, ∃ j ∈ J, i + j = 1

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
(h : IsCoprime I J)


@[to_additive (attr := simp)]
lemma prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).prod = ∏ a ∈ s, f a

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
(s : Finset α)
(f : α → β)

(Multiset.map f s.val).sum = ∑ a ∈ s, f a


@[simp]
theorem irrational_div_nat_iff : Irrational (x / n) ↔ n ≠ 0 ∧ Irrational x

Irrational (x / ↑n) ↔ n ≠ 0 ∧ Irrational x


/-- If a function `f` equals `1` on a set `s`, then the product of `f i` over `i ∈ s` equals `1`. -/
@[to_additive
      "If a function `f` equals `0` on a set `s`, then the product of `f i` over `i ∈ s`
      equals `0`."]
theorem finprod_mem_of_eqOn_one (hf : s.EqOn f 1) : ∏ᶠ i ∈ s, f i = 1

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{s : Set α}
(hf : Set.EqOn f 1 s)


theorem IsLimit.isSuccLimit {o} (h : IsLimit o) : IsSuccLimit o


theorem Subsingleton.coe_sort {s : Set α} : s.Subsingleton → Subsingleton s


protected theorem mul_lt_mul {a b c d : Int}
    (h₁ : a < c) (h₂ : b ≤ d) (h₃ : 0 < b) (h₄ : 0 ≤ c) : a * b < c * d


{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x : M)


@[simp]
theorem snd_neg [Neg R] [Neg M] (x : tsze R M) : (-x).snd = -x.snd

{R : Type u}
{M : Type v}
[Neg R]
[Neg M]
(x : tsze R M)


@[simp] theorem eraseIdx_cons_zero : (a::as).eraseIdx 0 = as

∀ {α : Type u_1} {a : α} {as : List α}, (a :: as).eraseIdx 0 = as


theorem nonneg_smul {a : ℤ√d} {n : ℕ} (ha : Nonneg a) : Nonneg ((n : ℤ√d) * a)

{d : ℕ}
{a : ℤ√↑d}
{n : ℕ}
(ha : a.Nonneg)


@[to_additive (attr := simp)] lemma prod_inv_index [InvolutiveInv ι] (s : Finset ι) (f : ι → α) :
    ∏ i ∈ s⁻¹, f i = ∏ i ∈ s, f i⁻¹

{α : Type u_2}
[CommMonoid α]
{ι : Type u_5}
[DecidableEq ι]
[InvolutiveInv ι]
(s : Finset ι)
(f : ι → α)


@[to_additive]
theorem map_div (hf : IsGroupHom f) (a b : α) : f (a / b) = f a / f b

{α : Type u}
{β : Type v}
[AddGroup α]
[AddGroup β]
{f : α → β}
(hf : IsAddGroupHom f)
(a b : α)


/-- An implication of predicates `P → P'` induces a monoidal functor between full monoidal
subcategories. -/
@[simps]
def fullMonoidalSubcategory.map (h : ∀ ⦃X⦄, P X → P' X) :
    MonoidalFunctor (FullSubcategory P) (FullSubcategory P')

(CategoryTheory.MonoidalCategory.fullMonoidalSubcategory.map h).toFunctor = CategoryTheory.FullSubcategory.map h


theorem ofNat_fst_mk {β} {x : Nat} {y : β} : (Prod.mk x y).fst = (x : Int)


theorem not_isField_iff_exists_ideal_bot_lt_and_lt_top [Nontrivial R] :
    ¬IsField R ↔ ∃ I : Ideal R, ⊥ < I ∧ I < ⊤

{R : Type u_1}
[CommSemiring R]
[Nontrivial R]


theorem Pairwise.biUnion_injective (h₀ : Pairwise (Disjoint on f)) (h₁ : ∀ i, (f i).Nonempty) :
    Injective fun s : Set ι => ⋃ i ∈ s, f i

{α : Type u_1}
{ι : Type u_4}
{f : ι → Set α}
(h₀ : Pairwise (Disjoint on f))
(h₁ : ∀ (i : ι), (f i).Nonempty)

Function.Injective fun s => ⋃ i ∈ s, f i


@[simp] theorem castLE_zero {n m : Nat} (h : n.succ ≤ m.succ) : castLE h 0 = 0


theorem sign_bot : sign (⊥ : EReal) = -1


/-- Lagrange's **Mean Value Theorem**, `deriv` version. -/
theorem exists_deriv_eq_slope : ∃ c ∈ Ioo a b, deriv f c = (f b - f a) / (b - a)

(hfd : DifferentiableOn ℝ f (Set.Ioo a b))

∃ c ∈ Set.Ioo a b, deriv f c = (f b - f a) / (b - a)


theorem ofComposition_surj {n : ℕ} : Function.Surjective (ofComposition n)


/-- The unit isomorphism of the equivalence `equivalence₂` between `A` and `B`. -/
@[simps!]
def equivalence₂UnitIso : 𝟭 A ≅ (F ⋙ eB.inverse) ⋙ eB.functor ⋙ e'.inverse ⋙ eA.inverse

{A : Type u_1}
{A' : Type u_2}
{B : Type u_3}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_2} A']
[CategoryTheory.Category.{u_7, u_3} B]
[CategoryTheory.Category.{u_8, u_4} B']
{eA : A ≌ A'}
(eB : B ≌ B')
{e' : A' ≌ B'}
{F : A ⥤ B'}
(hF : eA.functor ⋙ e'.functor ≅ F)
(X : A)

(AlgebraicTopology.DoldKan.Compatibility.equivalence₂UnitIso eB hF).hom.app X =
  eA.unitIso.hom.app X ≫
    eA.inverse.map (e'.unitIso.hom.app (eA.functor.obj X)) ≫
      eA.inverse.map (e'.inverse.map (hF.hom.app X)) ≫ eA.inverse.map (e'.inverse.map (eB.counitIso.inv.app (F.obj X)))


theorem not_mem_keys_of_nodupKeys_cons {s : Sigma β} {l : List (Sigma β)} (h : NodupKeys (s :: l)) :
    s.1 ∉ l.keys

{α : Type u}
{β : α → Type v}
{s : Sigma β}
{l : List (Sigma β)}
(h : (s :: l).NodupKeys)


/-- An angle in a right-angled triangle expressed using `arccos`. -/
theorem angle_eq_arccos_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2) :
    ∠ p₂ p₃ p₁ = Real.arccos (dist p₃ p₂ / dist p₁ p₃)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)


theorem dvd_sub_pow_of_dvd_sub {R : Type*} [CommRing R] {p : ℕ} {a b : R} (h : (p : R) ∣ a - b)
    (k : ℕ) : (p ^ (k + 1) : R) ∣ a ^ p ^ k - b ^ p ^ k

{R : Type u_1}
[CommRing R]
{p : ℕ}
{a b : R}
(h : ↑p ∣ a - b)
(k : ℕ)


@[simp]
theorem ι_ne_zero [Nontrivial R] (x : X) : ι R x ≠ 0

{R : Type u_1}
[CommSemiring R]
{X : Type u_2}
[Nontrivial R]
(x : X)


@[to_additive]
theorem edist_mulIndicator (s t : Set α) (f : α → E) (x : α) :
    edist (s.mulIndicator f x) (t.mulIndicator f x) = ‖(s ∆ t).mulIndicator f x‖₊

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
(s t : Set α)
(f : α → E)
(x : α)

edist (s.indicator f x) (t.indicator f x) = ↑‖(symmDiff s t).indicator f x‖₊


theorem left_inv' :
    ⟨strInv h ≫ A.str, by rw [← Category.assoc, F.map_comp, strInv, ← Hom.h]⟩ = 𝟙 A

{A : CategoryTheory.Endofunctor.Algebra F}

{ f := CategoryTheory.CategoryStruct.comp (CategoryTheory.Endofunctor.Algebra.Initial.strInv h) A.str, h := ⋯ } =
  CategoryTheory.CategoryStruct.id A


@[simp]
theorem pushoutCoconeOfLeftIso_x : (pushoutCoconeOfLeftIso f g).pt = Z

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).pt = Z


@[simp]
theorem differentiable_neg_iff : (Differentiable 𝕜 fun y => -f y) ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}


@[simp]
theorem lie_add : ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m n : M)


@[simp, norm_cast]
lemma coe_smul (a : 𝕜≥0) (x : 𝕜') : (a : 𝕜) • x = a • x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[OrderedSemiring 𝕜]
[SMul 𝕜 𝕜']
(a : 𝕜≥0)
(x : 𝕜')


@[simp]
theorem row_smul [SMul R α] (x : R) (v : m → α) : row ι (x • v) = x • row ι v

{m : Type u_2}
{R : Type u_5}
{α : Type v}
{ι : Type u_6}
[SMul R α]
(x : R)
(v : m → α)

Matrix.row ι (x • v) = x • Matrix.row ι v


@[to_additive]
theorem prod_range_succ_div_prod : ((∏ i ∈ range (n + 1), f i) / ∏ i ∈ range n, f i) = f n

{M : Type u_3}
(f : ℕ → M)
{n : ℕ}
[CommGroup M]

(∏ i ∈ Finset.range (n + 1), f i) / ∏ i ∈ Finset.range n, f i = f n


theorem bddOrd_dual_comp_forget_to_bipointed :
    BddOrd.dual ⋙ forget₂ BddOrd Bipointed =
    forget₂ BddOrd Bipointed ⋙ Bipointed.swap

BddOrd.dual ⋙ CategoryTheory.forget₂ BddOrd Bipointed = CategoryTheory.forget₂ BddOrd Bipointed ⋙ Bipointed.swap


@[simp]
theorem essSup_const' [NeZero μ] (c : β) : essSup (fun _ : α => c) μ = c

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
[NeZero μ]
(c : β)


/-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover

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


lemma zero_smul_finset_subset (s : Finset β) : (0 : α) • s ⊆ 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
[DecidableEq β]
(s : Finset β)


lemma exists_character_apply_ne_zero_of_ne_zero {a : A} (ne_zero : a ≠ 0) :
    ∃ (c : CharacterModule A), c a ≠ 0

{A : Type uA}
[AddCommGroup A]
{a : A}
(ne_zero : a ≠ 0)


theorem toDual_map (f : α → β) (a : WithBot α) :
    WithBot.toDual (WithBot.map f a) = map (toDual ∘ f ∘ ofDual) (WithBot.toDual a)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(a : WithBot α)

WithBot.toDual (WithBot.map f a) = WithBot.map (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) (WithBot.toDual a)


/-- **First moment method**. The maximum of a measurable function is greater than its integral. -/
theorem exists_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ∫⁻ a, f a ∂μ ≤ f x

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsProbabilityMeasure μ]
(hint : ∫⁻ (a : α), f a ∂μ ≠ ⊤)


@[simp]
theorem lift_base (f : ∀ i, G i →* K) (k : H →* K)
    (hf : ∀ i, (f i).comp (φ i) = k)
    (g : H) : (lift f k hf) (base φ g : PushoutI φ) = k g

{ι : Type u_1}
{G : ι → Type u_2}
{H : Type u_3}
{K : Type u_4}
[Monoid K]
[(i : ι) → Monoid (G i)]
[Monoid H]
{φ : (i : ι) → H →* G i}
(f : (i : ι) → G i →* K)
(k : H →* K)
(hf : ∀ (i : ι), (f i).comp (φ i) = k)
(g : H)

(Monoid.PushoutI.lift f k hf) ((Monoid.PushoutI.base φ) g) = k g


theorem contMDiffAt_iff_source_of_mem_source {x' : M} (hx' : x' ∈ (chartAt H x).source) :
    ContMDiffAt I I' n f x' ↔
      ContMDiffWithinAt 𝓘(𝕜, E) I' n (f ∘ (extChartAt I x).symm) (range I) (extChartAt I x x')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}
{n : ℕ∞}
{x' : M}
(hx' : x' ∈ (chartAt H x).source)

ContMDiffAt I I' n f x' ↔
  ContMDiffWithinAt 𝓘(𝕜, E) I' n (f ∘ ↑(extChartAt I x).symm) (Set.range ↑I) (↑(extChartAt I x) x')


/-- The transitivity of homotopy between morphisms of short complexes. -/
@[simps]
def trans (h₁₂ : Homotopy φ₁ φ₂) (h₂₃ : Homotopy φ₂ φ₃) : Homotopy φ₁ φ₃

{φ₁ φ₂ φ₃ : S₁ ⟶ S₂}

(h₁₂ : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h₂₃ : CategoryTheory.ShortComplex.Homotopy φ₂ φ₃)


@[nolint unusedHavesSuffices] -- Porting note: false positive
theorem mergeSort_cons_cons {a b} {l l₁ l₂ : List α} (h : split (a :: b :: l) = (l₁, l₂)) :
    mergeSort r (a :: b :: l) = merge (r · ·) (mergeSort r l₁) (mergeSort r l₂)

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
{a b : α}
{l l₁ l₂ : List α}
(h : (a :: b :: l).split = (l₁, l₂))

List.mergeSort r (a :: b :: l) = List.merge (fun x x_1 => decide (r x x_1)) (List.mergeSort r l₁) (List.mergeSort r l₂)


theorem isNat_prime_0 : {n : ℕ} → IsNat n (nat_lit 0) → ¬ n.Prime

Mathlib.Meta.NormNum.IsNat n 0 → ¬Nat.Prime n


protected theorem continuousOn (e : M₁ ≃SL[σ₁₂] M₂) {s : Set M₁} : ContinuousOn (e : M₁ → M₂) s

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
{s : Set M₁}


/-- A cardinal lifted to the same universe equals itself. -/
@[simp]
theorem lift_id (a : Cardinal) : lift.{u, u} a = a


theorem _root_.element_smul_restrictScalars {R S M}
    [CommSemiring R] [CommSemiring S] [Algebra R S] [AddCommMonoid M]
    [Module R M] [Module S M] [IsScalarTower R S M] (r : R) (N : Submodule S M) :
    (algebraMap R S r • N).restrictScalars R = r • N.restrictScalars R

{R : Type u_4}
{S : Type u_5}
{M : Type u_6}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(r : R)
(N : Submodule S M)

Submodule.restrictScalars R ((algebraMap R S) r • N) = r • Submodule.restrictScalars R N


@[simp]
theorem sum_toFinset_count_eq_length [DecidableEq α] (l : List α) :
    ∑ a in l.toFinset, l.count a = l.length

{α : Type u_3}
[DecidableEq α]
(l : List α)

∑ a ∈ l.toFinset, List.count a l = l.length


/-- If `g` is concave on `s`, so is `(g ∘ f)` on `f ⁻¹' s` for a linear `f`. -/
theorem ConcaveOn.comp_linearMap {f : F → β} {s : Set F} (hf : ConcaveOn 𝕜 s f) (g : E →ₗ[𝕜] F) :
    ConcaveOn 𝕜 (g ⁻¹' s) (f ∘ g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 F]
[SMul 𝕜 β]
{f : F → β}
{s : Set F}
(hf : ConcaveOn 𝕜 s f)
(g : E →ₗ[𝕜] F)


lemma Gammaℝ_ne_zero_of_re_pos {s : ℂ} (hs : 0 < re s) : Gammaℝ s ≠ 0


/--Universal property of the free product of algebras, property:
for every `R`-algebra `B`, every family of maps `maps : (i : I) → (A i →ₐ[R] B)` lifts
to a unique arrow `π` from `FreeProduct R A` such that  `π ∘ ι i = maps i`.-/
theorem lift_comp_ι : (lift R A maps) ∘ₐ (ι R A i) = maps

{I : Type u}
[DecidableEq I]
{i : I}
(R : Type v)
[CommSemiring R]
(A : I → Type w)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
{B : Type w'}
[Semiring B]
[Algebra R B]
(maps : {i : I} → A i →ₐ[R] B)

((LinearAlgebra.FreeProduct.lift R A) fun {i} => maps).comp (LinearAlgebra.FreeProduct.ι R A i) = maps


/-- If `A` is a module over a commutative `R` with compatible actions,
then `star` is a semilinear equivalence. -/
@[simps]
def starLinearEquiv (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid A]
    [StarAddMonoid A] [Module R A] [StarModule R A] : A ≃ₗ⋆[R] A

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[AddCommMonoid A]
[StarAddMonoid A]
[Module R A]
[StarModule R A]

∀ (a : A), (starLinearEquiv R).symm a = starAddEquiv.invFun a


@[simp]
theorem floor_le_sub_one_iff : ⌊a⌋ ≤ z - 1 ↔ a < z

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{z : ℤ}
{a : α}


@[ext]
theorem ext {f g : sInfHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[InfSet β]
{f g : sInfHom α β}
(h : ∀ (a : α), f a = g a)


@[simp, fun_prop]
theorem DifferentiableAt.smul (hc : DifferentiableAt 𝕜 c x) (hf : DifferentiableAt 𝕜 f x) :
    DifferentiableAt 𝕜 (fun y => c y • f y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(hf : DifferentiableAt 𝕜 f x)


/--
The `Fin.zero_le` in `Lean` only applies in `Fin (n+1)`.
This one instead uses a `NeZero n` typeclass hypothesis.
-/
@[simp]
protected theorem zero_le' [NeZero n] (a : Fin n) : 0 ≤ a


theorem factorization_choose_eq_zero_of_lt (h : n < p) : (choose n k).factorization p = 0


private theorem add_one_lt_exp_of_pos {x : ℝ} (hx : 0 < x) : x + 1 < exp x


@[to_additive dite_pos]
lemma one_lt_dite [LT α] (ha : ∀ h, 1 < a h) (hb : ∀ h, 1 < b h) : 1 < dite p a b

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LT α]
(ha : ∀ (h : p), 0 < a h)
(hb : ∀ (h : ¬p), 0 < b h)


/-- A type is said to be infinite if it is not finite. Note that `Infinite α` is equivalent to
`IsEmpty (Fintype α)` or `IsEmpty (Finite α)`. -/
class Infinite (α : Sort*) : Prop where
  /-- assertion that `α` is `¬Finite`-/
  not_finite : ¬Finite α


theorem sup_continuous {f g : α →o β} (hf : Continuous f) (hg : Continuous g) :
    Continuous (f ⊔ g)

(hf : OmegaCompletePartialOrder.Continuous f)

(hg : OmegaCompletePartialOrder.Continuous g)

OmegaCompletePartialOrder.Continuous (f ⊔ g)


/-- Left-invariant global derivations.

A global derivation is left-invariant if it is equal to its pullback along left multiplication by
an arbitrary element of `G`.
-/
structure LeftInvariantDerivation extends Derivation 𝕜 C^∞⟮I, G; 𝕜⟯ C^∞⟮I, G; 𝕜⟯ where
  left_invariant'' :
    ∀ g, 𝒅ₕ (smoothLeftMul_one I g) (Derivation.evalAt 1 toDerivation) =
      Derivation.evalAt g toDerivation

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(self : LeftInvariantDerivation I G)
(g : G)

(𝒅ₕ ⋯) ((Derivation.evalAt 1) ↑self) = (Derivation.evalAt g) ↑self


lemma IntermediateField.isSeparable_of_mem_isSeparable {L : IntermediateField F E}
    [Algebra.IsSeparable F L] {x : E} (h : x ∈ L) : IsSeparable F x

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
{L : IntermediateField F E}
[Algebra.IsSeparable F ↥L]
{x : E}
(h : x ∈ L)


theorem ext_adjoin {s : Set A} [FunLike F (adjoin R s) B]
    [AlgHomClass F R (adjoin R s) B] [StarAlgHomClass F R (adjoin R s) B] {f g : F}
    (h : ∀ x : adjoin R s, (x : A) ∈ s → f x = g x) : f = g

[FunLike F (↥(StarAlgebra.adjoin R s)) B]

[AlgHomClass F R (↥(StarAlgebra.adjoin R s)) B]

[StarAlgHomClass F R (↥(StarAlgebra.adjoin R s)) B]

(h : ∀ (x : ↥(StarAlgebra.adjoin R s)), ↑x ∈ s → f x = g x)


/-- If a function is `C^n` around each point in a set, then it is `C^n` on the set. -/
theorem contDiffOn_of_locally_contDiffOn
    (h : ∀ x ∈ s, ∃ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn 𝕜 n f (s ∩ u)) : ContDiffOn 𝕜 n f s


/-- The identity function as a lower adjoint to itself. -/
@[simps]
protected def id [Preorder α] : LowerAdjoint (id : α → α)


/-- Euler's infinite product formula for the complex sine function. -/
theorem _root_.Complex.tendsto_euler_sin_prod (z : ℂ) :
    Tendsto (fun n : ℕ => π * z * ∏ j ∈ Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2))
      atTop (𝓝 <| Complex.sin (π * z))

Filter.Tendsto (fun n => ↑π * z * ∏ j ∈ Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) Filter.atTop
  (𝓝 (Complex.sin (↑π * z)))


@[simp]
theorem Ioc_diff_Ioo_self (h : a < b) : Ioc a b \ Ioo a b = {b}

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidableEq α]
(h : a < b)


theorem HasDerivAt.finset_prod (hf : ∀ i ∈ u, HasDerivAt (f i) (f' i) x) :
    HasDerivAt (∏ i ∈ u, f i ·) (∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • f' i) x

{f : ι → 𝕜 → 𝔸'}

HasDerivAt (fun x => ∏ i ∈ u, f i x) (∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • f' i) x


theorem ext_get?_iff {l₁ l₂ : List α} : l₁ = l₂ ↔ ∀ n, l₁.get? n = l₂.get? n

l₁ = l₂ ↔ ∀ (n : ℕ), l₁.get? n = l₂.get? n


theorem generatePiSystem_subset_self {α} {S : Set (Set α)} (h_S : IsPiSystem S) :
    generatePiSystem S ⊆ S

{α : Type u_1}
{S : Set (Set α)}
(h_S : IsPiSystem S)


/-- If `M` and `M'` are each other's inverse matrices, they provide an equivalence between `m → A`
and `n → A` corresponding to `M.mulVec` and `M'.mulVec`. -/
@[simps]
def Matrix.toLin'OfInv [Fintype m] [DecidableEq m] {M : Matrix m n R} {M' : Matrix n m R}
    (hMM' : M * M' = 1) (hM'M : M' * M = 1) : (m → R) ≃ₗ[R] n → R

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
[Fintype m]
[DecidableEq m]
{M : Matrix m n R}
{M' : Matrix n m R}
(hMM' : M * M' = 1)
(hM'M : M' * M = 1)
(a : n → R)

∀ (a_1 : m), (Matrix.toLin'OfInv hMM' hM'M).symm a a_1 = (Matrix.toLin' M) a a_1


/-- An inductive property of the central binomial coefficient.
-/
theorem succ_mul_centralBinom_succ (n : ℕ) :
    (n + 1) * centralBinom (n + 1) = 2 * (2 * n + 1) * centralBinom n

(n + 1) * (n + 1).centralBinom = 2 * (2 * n + 1) * n.centralBinom


/-- `LocallyConstant.congrLeft` as a `RingEquiv`. -/
@[simps!]
def congrLeftRingEquiv [Semiring Z] (e : X ≃ₜ Y) :
    LocallyConstant X Z ≃+* LocallyConstant Y Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{Z : Type u_6}
[Semiring Z]
(e : X ≃ₜ Y)
(g : LocallyConstant Y Z)

∀ (a : X), ((LocallyConstant.congrLeftRingEquiv e).symm g) a = g (e a)


/-- The `erase` function preserves the balance invariants. -/
protected theorem Balanced.erase {t : RBNode α}
    (h : t.Balanced c n) : ∃ n, (t.erase cut).Balanced black n

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}
{cut : α → Ordering}
{t : Batteries.RBNode α}
(h : t.Balanced c n)

∃ n, (Batteries.RBNode.erase cut t).Balanced Batteries.RBColor.black n


theorem continuousWithinAt_iff_ptendsto_res (f : X → Y) {x : X} {s : Set X} :
    ContinuousWithinAt f s x ↔ PTendsto (PFun.res f s) (𝓝 x) (𝓝 (f x))

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : X → Y)
{x : X}
{s : Set X}

ContinuousWithinAt f s x ↔ Filter.PTendsto (PFun.res f s) (𝓝 x) (𝓝 (f x))


/-- A dilation from a metric space is an embedding -/
protected theorem embedding [PseudoEMetricSpace β] [DilationClass F α β] (f : F) :
    Embedding (f : α → β)

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[EMetricSpace α]
[FunLike F α β]
[PseudoEMetricSpace β]
[DilationClass F α β]
(f : F)


@[simp]
private lemma ofTensorProductBil_apply_apply (r : AdicCompletion I R) (x : M) :
    ((AdicCompletion.ofTensorProductBil I M) r) x = r • (of I M) x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(r : AdicCompletion I R)
(x : M)

((AdicCompletion.ofTensorProductBil I M) r) x = r • (AdicCompletion.of I M) x


theorem conjTranspose {M : Matrix n n R} (hM : M.PosSemidef) : Mᴴ.PosSemidef

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
{M : Matrix n n R}
(hM : M.PosSemidef)


@[to_additive]
theorem mem_map_of_mem (f : G →* N) {K : Subgroup G} {x : G} (hx : x ∈ K) : f x ∈ K.map f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
{K : Subgroup G}
{x : G}
(hx : x ∈ K)


/-- Takes an element of `ℂ ≃ₗᵢ[ℝ] ℂ` and checks if it is a rotation, returns an element of the
unit circle. -/
@[simps]
def rotationOf (e : ℂ ≃ₗᵢ[ℝ] ℂ) : circle

(e : ℂ ≃ₗᵢ[ℝ] ℂ)

↑(rotationOf e) = e 1 / ↑(Complex.abs (e 1))


theorem modEq_sub_iff_add_modEq : a ≡ b - c [PMOD p] ↔ a + c ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b c : α}


/-- Group homomorphisms preserve division. -/
@[to_additive "Additive group homomorphisms preserve subtraction."]
theorem map_mul_inv [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (a b : G) :
    f (a * b⁻¹) = f a * (f b)⁻¹

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[AddGroup G]
[SubtractionMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(a b : G)


@[simp]
theorem sInf_eq_top : sInf s = ⊤ ↔ ∀ a ∈ s, a = ⊤

{α : Type u_1}
[CompleteLattice α]
{s : Set α}


/-- When `s.re > 1`, the map `n ↦ χ(n) * n^(-s)` is norm-summable. -/
lemma summable_dirichletSummand {N : ℕ} (χ : DirichletCharacter ℂ N) (hs : 1 < s.re) :
    Summable (fun n ↦ ‖dirichletSummandHom χ (ne_zero_of_one_lt_re hs) n‖)

{s : ℂ}
{N : ℕ}
(χ : DirichletCharacter ℂ N)
(hs : 1 < s.re)

Summable fun n => ‖(dirichletSummandHom χ ⋯) n‖


@[simp]
theorem inter_insert_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₁) :
    s₁ ∩ insert a s₂ = insert a (s₁ ∩ s₂)

{α : Type u_1}
[DecidableEq α]
{s₁ s₂ : Finset α}
{a : α}
(h : a ∈ s₁)


@[simp]
theorem symm_mk (f f') (h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨f, f', h₁, h₂⟩, h₃, h₄, h₅⟩ : A₁ ≃ₐ[R] A₂).symm =
      { symm_mk.aux f f' h₁ h₂ h₃ h₄ h₅ with
        toFun := f'
        invFun := f }

(h₃ :
  ∀ (x y : A₁),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun (x * y) =
      { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun x *
        { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₄ :
  ∀ (x y : A₁),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun (x + y) =
      { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun x +
        { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₅ :
  ∀ (r : R),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun ((algebraMap R A₁) r) = (algebraMap R A₂) r)

{ toFun := f, invFun := f', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄, commutes' := h₅ }.symm =
  let __src := AlgEquiv.symm_mk.aux f f' h₁ h₂ h₃ h₄ h₅;
  { toFun := f', invFun := f, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯, commutes' := ⋯ }


@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0

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


/-- A function `f` on `Fin (n + 1)` is monotone if and only if `f i ≤ f (i + 1)` for all `i`. -/
lemma monotone_iff_le_succ : Monotone f ↔ ∀ i : Fin n, f (castSucc i) ≤ f i.succ

{n : ℕ}
{α : Type u_1}
[Preorder α]
{f : Fin (n + 1) → α}

Monotone f ↔ ∀ (i : Fin n), f i.castSucc ≤ f i.succ


@[simp]
lemma corootSpace_eq_bot_iff {α : Weight K H L} :
    corootSpace α = ⊥ ↔ α.IsZero

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
[LieAlgebra.IsKilling K L]
[CharZero K]
{α : LieModule.Weight K (↥H) L}

LieAlgebra.corootSpace ⇑α = ⊥ ↔ α.IsZero


@[simp]
theorem Matrix.toLin'_apply (M : Matrix m n R) (v : n → R) : Matrix.toLin' M v = M *ᵥ v

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(M : Matrix m n R)
(v : n → R)


lemma exists_walk_of_edist_ne_top (h : G.edist u v ≠ ⊤) :
    ∃ p : G.Walk u v, p.length = G.edist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : G.edist u v ≠ ⊤)


@[gcongr]
theorem Icc_subset_Icc (h₁ : a₂ ≤ a₁) (h₂ : b₁ ≤ b₂) : Icc a₁ b₁ ⊆ Icc a₂ b₂

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ b₂ : α}
(h₁ : a₂ ≤ a₁)
(h₂ : b₁ ≤ b₂)


/-- Like `Finsupp.mapDomain_add`, but for the convolutive multiplication we define in this file -/
theorem mapDomain_mul {α : Type*} {β : Type*} {α₂ : Type*} [Semiring β] [Mul α] [Mul α₂]
    {F : Type*} [FunLike F α α₂] [MulHomClass F α α₂] (f : F) (x y : MonoidAlgebra β α) :
    mapDomain f (x * y) = mapDomain f x * mapDomain f y

{α : Type u_3}
{β : Type u_4}
{α₂ : Type u_5}
[Semiring β]
[Mul α]
[Mul α₂]
{F : Type u_6}
[FunLike F α α₂]
[MulHomClass F α α₂]
(f : F)
(x y : MonoidAlgebra β α)

MonoidAlgebra.mapDomain (⇑f) (x * y) = MonoidAlgebra.mapDomain (⇑f) x * MonoidAlgebra.mapDomain (⇑f) y


/-- Closing under `J` is stable under pullback. -/
theorem pullback_close {X Y : C} (f : Y ⟶ X) (S : Sieve X) :
    J₁.close (S.pullback f) = (J₁.close S).pullback f

(J₁ : CategoryTheory.GrothendieckTopology C)

J₁.close (CategoryTheory.Sieve.pullback f S) = CategoryTheory.Sieve.pullback f (J₁.close S)


theorem birthday_zero_add : (0 + a).birthday = a.birthday


protected theorem tsum_add : ∑' a, (f a + g a) = ∑' a, f a + ∑' a, g a


/-- If `f` has a derivative at `x` within `s`, then `fderivWithin 𝕜 f s x` is such a derivative.
Otherwise, it is set to `0`. If `x` is isolated in `s`, we take the derivative within `s` to
be zero for convenience. -/
irreducible_def fderivWithin (f : E → F) (s : Set E) (x : E) : E →L[𝕜] F

(𝕜 : Type u_6)
[NontriviallyNormedField 𝕜]
{E : Type u_7}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
(s : Set E)
(x : E)

fderivWithin 𝕜 f s x =
  if 𝓝[s \ {x}] x = ⊥ then 0 else if h : ∃ f', HasFDerivWithinAt f f' s x then Classical.choose h else 0


theorem mapQ_pow {f : M →ₗ[R] M} (h : p ≤ p.comap f) (k : ℕ)
    (h' : p ≤ p.comap (f ^ k) := p.le_comap_pow_of_le_comap h k) :
    p.mapQ p (f ^ k) h' = p.mapQ p f h ^ k

(h' : p ≤ Submodule.comap (f ^ k) p := ⋯)


theorem monotone_const [Preorder α] [Preorder β] {c : β} : Monotone fun _ : α ↦ c

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{c : β}


/-- The $L^1$ norm is less than the $L^\infty$ norm scaled by the cardinality. -/
@[to_additive Pi.sum_norm_apply_le_norm "The $L^1$ norm is less than the $L^\\infty$ norm scaled by
the cardinality."]
lemma Pi.sum_norm_apply_le_norm' : ∑ i, ‖f i‖ ≤ Fintype.card ι • ‖f‖

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
(f : (i : ι) → π i)


/-- The equivalence induced by `a ↦ (a / n, a % n)` for nonzero `n`.
This is like `finProdFinEquiv.symm` but with `m` infinite.
See `Nat.div_mod_unique` for a similar propositional statement. -/
@[simps]
def Nat.divModEquiv (n : ℕ) [NeZero n] : ℕ ≃ ℕ × Fin n


@[simp]
theorem isNilpotent_neg_iff [Ring R] : IsNilpotent (-x) ↔ IsNilpotent x


@[simp] lemma graph_inj {f g : α → β} : f.graph = g.graph ↔ f = g

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

Function.graph f = Function.graph g ↔ f = g


theorem gauge_gaugeRescale_le (s t : Set E) (x : E) :
    gauge t (gaugeRescale s t x) ≤ gauge s x

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
(s t : Set E)
(x : E)


@[simp, norm_cast]
theorem tendsto_coe_atTop {f : Filter α} {m : α → ℝ≥0} :
    Tendsto (fun a => (m a : ℝ)) f atTop ↔ Tendsto m f atTop

{α : Type u_1}
{f : Filter α}
{m : α → NNReal}

Filter.Tendsto (fun a => ↑(m a)) f Filter.atTop ↔ Filter.Tendsto m f Filter.atTop


/-- A multiple of the difference of two points added to the second point lies in their affine
span. -/
theorem smul_vsub_rev_vadd_mem_affineSpan_pair (r : k) (p₁ p₂ : P) :
    r • (p₁ -ᵥ p₂) +ᵥ p₂ ∈ line[k, p₁, p₂]

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(r : k)
(p₁ p₂ : P)

r • (p₁ -ᵥ p₂) +ᵥ p₂ ∈ affineSpan k {p₁, p₂}


nonrec theorem IsLocalMax.sup (hf : IsLocalMax f a) (hg : IsLocalMax g a) :
    IsLocalMax (fun x => f x ⊔ g x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SemilatticeSup β]
{f g : α → β}
{a : α}
(hf : IsLocalMax f a)
(hg : IsLocalMax g a)


/-- `pb.liftEquiv'` states that elements of the root set of the minimal
polynomial of `pb.gen` correspond to maps sending `pb.gen` to that root. -/
@[simps! (config := .asFn)]
noncomputable def liftEquiv' (pb : PowerBasis A S) :
    (S →ₐ[A] B) ≃ { y : B // y ∈ (minpoly A pb.gen).aroots B }

{S : Type u_2}
[Ring S]
{A : Type u_4}
{B : Type u_5}
[CommRing A]
[CommRing B]
[IsDomain B]
[Algebra A B]
[Algebra A S]
(pb : PowerBasis A S)

∀ (a : { y // y ∈ (minpoly A pb.gen).aroots B }), ⇑(pb.liftEquiv'.symm a) = ⇑((pb.basis.constr A) fun i => ↑a ^ ↑i)


/-- `Option.map` as a function between functions is injective. -/
theorem map_injective' : Function.Injective (@Option.map α β)


@[simp]
theorem Orientation.map_of_isEmpty [IsEmpty ι] (x : Orientation R M ι) (f : M ≃ₗ[R] M) :
    Orientation.map ι f x = x

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(ι : Type u_4)
[IsEmpty ι]
(x : Orientation R M ι)
(f : M ≃ₗ[R] M)


/-- When lowered to a prop, `Matrix.invertibleEquivDetInvertible` forms an `iff`. -/
theorem isUnit_iff_isUnit_det : IsUnit A ↔ IsUnit A.det

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


theorem foldrIdx_start :
    (xs : List α).foldrIdx f i s = (xs : List α).foldrIdx (fun i => f (i + s)) i

∀ {α_1 : Sort u_2} {f : Nat → α → α_1 → α_1} {i : α_1} {s : Nat},
  List.foldrIdx f i xs s = List.foldrIdx (fun i => f (i + s)) i xs


theorem uniformEmbedding_toProdMulOpposite : UniformEmbedding (@toProdMulOpposite 𝕜 A _ _ _ _ _)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]


theorem IsEquivalent.exists_eq_mul (huv : u ~[l] v) :
    ∃ (φ : α → β) (_ : Tendsto φ l (𝓝 1)), u =ᶠ[l] φ * v

{α : Type u_1}
{β : Type u_2}
[NormedField β]
{u v : α → β}
{l : Filter α}
(huv : u ~[l] v)

∃ φ, ∃ (_ : Filter.Tendsto φ l (nhds 1)), u =ᶠ[l] φ * v


theorem finite_of_card_ne_zero (h : Nat.card α ≠ 0) : Finite α


/-- `LocallyConstant.congrRight` as a linear equivalence. -/
@[simps!]
def congrRightₗ (R : Type*) [Semiring R] [AddCommMonoid Y] [Module R Y]
    [AddCommMonoid Z] [Module R Z] (e : Y ≃ₗ[R] Z) :
    LocallyConstant X Y ≃ₗ[R] LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_6}
(R : Type u_7)
[Semiring R]
[AddCommMonoid Y]
[Module R Y]
[AddCommMonoid Z]
[Module R Z]
(e : Y ≃ₗ[R] Z)

∀ (a : LocallyConstant X Z) (a_1 : X), ((LocallyConstant.congrRightₗ R e).symm a) a_1 = e.symm (a a_1)


protected theorem add_lt_add_left {a b : Int} (h : a < b) (c : Int) : c + a < c + b


@[simp] theorem toNat_ofNat_add_one {n : Nat} : ((n : Int) + 1).toNat = n + 1


@[simp]
theorem comap_comp (S : DiscreteQuotient Z) : S.comap (g.comp f) = (S.comap g).comap f

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(g : C(Y, Z))
(f : C(X, Y))
(S : DiscreteQuotient Z)

DiscreteQuotient.comap (g.comp f) S = DiscreteQuotient.comap f (DiscreteQuotient.comap g S)


@[simp] lemma affineIndependent_vadd {p : ι → P} {v : V} :
    AffineIndependent k (v +ᵥ p) ↔ AffineIndependent k p

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{p : ι → P}
{v : V}


@[simp]
theorem left_le_midpoint : a ≤ midpoint k a b ↔ a ≤ b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}


theorem norm_inner_symm (x y : E) : ‖⟪x, y⟫‖ = ‖⟪y, x⟫‖

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)

‖⟪x, y⟫_𝕜‖ = ‖⟪y, x⟫_𝕜‖


/-- In an R₁ topological space with Borel measure `μ`,
the measure of the closure of a compact set `K` is equal to the measure of `K`.

See also `MeasureTheory.Measure.OuterRegular.measure_closure_eq_of_isCompact`
for a version that assumes `μ` to be outer regular
but does not assume the `σ`-algebra to be Borel.  -/
theorem IsCompact.measure_closure [R1Space γ] {K : Set γ} (hK : IsCompact K) (μ : Measure γ) :
    μ (closure K) = μ K

{γ : Type u_3}
[TopologicalSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
[R1Space γ]
{K : Set γ}
(hK : IsCompact K)
(μ : MeasureTheory.Measure γ)