theorem mem_right {b : Board} (x : ℤ × ℤ) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b

{b : SetTheory.PGame.Domineering.Board}
(x : ℤ × ℤ)

x ∈ SetTheory.PGame.Domineering.right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b


/-- Check that indeed any uniform random variable has the uniformPDF. -/
lemma uniformPDF_eq_pdf {s : Set E} (hs : MeasurableSet s) (hu : pdf.IsUniform X s ℙ μ) :
    (fun x ↦ uniformPDF s x μ) =ᵐ[μ] pdf X ℙ μ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  MeasurableSet s →
    MeasureTheory.pdf.IsUniform X s ℙ μ → (fun x => MeasureTheory.pdf.uniformPDF s x μ) =ᵐ[μ] MeasureTheory.pdf X ℙ μ


@[ext] protected theorem ext {f g : G →+c[a, b] H} (h : ∀ x, f x = g x) : f = g

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
{f g : AddConstMap G H a b}
(h : ∀ (x : G), f x = g x)


lemma RightHomologyData.exact_iff_mono_g' [S.HasHomology] (h : RightHomologyData S) :
    S.Exact ↔ Mono h.g'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
[S.HasHomology]
(h : S.RightHomologyData)


@[simp] lemma traceForm_flip : LinearMap.flip (traceForm R L M) = traceForm R L M

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

LinearMap.flip (LieModule.traceForm R L M) = LieModule.traceForm R L M


@[simp]
theorem toIsometryEquiv_symm : e.toIsometryEquiv.symm = e.symm.toIsometryEquiv

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


theorem lowerCentralSeries.map {H : Type*} [Group H] (f : G →* H) (n : ℕ) :
    Subgroup.map f (lowerCentralSeries G n) ≤ lowerCentralSeries H n

{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(f : G →* H)
(n : ℕ)


protected theorem completeSpace : CompleteSpace (∀ n, E n)

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]


theorem and_iff_left_of_imp  (h : a → b) : (a ∧ b) ↔ a


theorem sub_one_lt_natAbs_cyclotomic_eval {n : ℕ} {q : ℕ} (hn' : 1 < n) (hq : q ≠ 1) :
    q - 1 < ((cyclotomic n ℤ).eval ↑q).natAbs

q - 1 < (Polynomial.eval (↑q) (Polynomial.cyclotomic n ℤ)).natAbs


@[to_additive]
theorem map_inf_comap_of_surjective (S T : Submonoid N) : (S.comap f ⊓ T.comap f).map f = S ⊓ T

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
(hf : Function.Surjective ⇑f)
(S T : Submonoid N)

Submonoid.map f (Submonoid.comap f S ⊓ Submonoid.comap f T) = S ⊓ T


@[elab_as_elim]
protected theorem induction {p : Multiset α → Prop} (empty : p 0)
    (cons : ∀ (a : α) (s : Multiset α), p s → p (a ::ₘ s)) : ∀ s, p s


protected theorem StrictMono.strictMonoOn (hf : StrictMono f) (s : Set α) : StrictMonoOn f s

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


/-- The underlying oplax monoidal functor of a (strong) monoidal functor. -/
@[simps]
noncomputable def MonoidalFunctor.toOplaxMonoidalFunctor (F : MonoidalFunctor C D) :
    OplaxMonoidalFunctor C D

(F : CategoryTheory.MonoidalFunctor C D)

F.toOplaxMonoidalFunctor.δ X Y = CategoryTheory.inv (F.μ X Y)


lemma exists_triangle (A : C) (n₀ n₁ : ℤ) (h : n₀ + 1 = n₁) :
    ∃ (X Y : C) (_ : t.LE n₀ X) (_ : t.GE n₁ Y) (f : X ⟶ A) (g : A ⟶ Y)
      (h : Y ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C

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

(t : CategoryTheory.Triangulated.TStructure C)

∃ X Y,
  ∃ (_ : t.LE n₀ X) (_ : t.GE n₁ Y),
    ∃ f g h, CategoryTheory.Pretriangulated.Triangle.mk f g h ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[simp, norm_cast]
theorem star_coe : star (x : ℍ[R]) = x


theorem card_finset_fin_le {n : ℕ} (s : Finset (Fin n)) : s.card ≤ n


theorem induced_mono (h : t₁ ≤ t₂) : t₁.induced g ≤ t₂.induced g

{α : Type u_1}
{β : Type u_2}
{t₁ t₂ : TopologicalSpace α}
{g : β → α}
(h : t₁ ≤ t₂)

TopologicalSpace.induced g t₁ ≤ TopologicalSpace.induced g t₂


@[to_additive]
theorem mrange_inl' : mrange (inl M N) = comap (snd M N) ⊥

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]

MonoidHom.mrange (MonoidHom.inl M N) = Submonoid.comap (MonoidHom.snd M N) ⊥


@[simp]
theorem symm_trans_self (e : R ≃+* S) : e.symm.trans e = RingEquiv.refl S

{R : Type u_4}
{S : Type u_5}
[Add R]
[Add S]
[Mul R]
[Mul S]
(e : R ≃+* S)


@[elab_as_elim]
theorem closure_induction' {s : Set R} {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (zero : p 0 (zero_mem _)) (one : p 1 (one_mem _))
    (add : ∀ x hx y hy, p x hx → p y hy → p (x + y) (add_mem hx hy))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy))
    {a : R} (ha : a ∈ closure s) : p a ha

{p : (x : R) → x ∈ Subsemiring.closure s → Prop}

(add :
  ∀ (x : R) (hx : x ∈ Subsemiring.closure s) (y : R) (hy : y ∈ Subsemiring.closure s), p x hx → p y hy → p (x + y) ⋯)

(mul :
  ∀ (x : R) (hx : x ∈ Subsemiring.closure s) (y : R) (hy : y ∈ Subsemiring.closure s), p x hx → p y hy → p (x * y) ⋯)


theorem nextOr_mem {xs : List α} {x d : α} (hd : d ∈ xs) : nextOr xs x d ∈ xs

{α : Type u_1}
[DecidableEq α]
{xs : List α}
{x d : α}
(hd : d ∈ xs)


lemma ceilDiv_eq_add_pred_div (a b : ℕ) : a ⌈/⌉ b = (a + b - 1) / b


/-- A more general version of `finprod_mem_insert` that requires `s ∩ mulSupport f` rather than `s`
to be finite. -/
@[to_additive
      "A more general version of `finsum_mem_insert` that requires `s ∩ support f` rather
      than `s` to be finite."]
theorem finprod_mem_insert' (f : α → M) (h : a ∉ s) (hs : (s ∩ mulSupport f).Finite) :
    ∏ᶠ i ∈ insert a s, f i = f a * ∏ᶠ i ∈ s, f i

(hs : (s ∩ Function.mulSupport f).Finite)

∏ᶠ (i : α) (_ : i ∈ insert a s), f i = f a * ∏ᶠ (i : α) (_ : i ∈ s), f i


protected theorem continuous_iff (hf : QuotientMap f) : Continuous g ↔ Continuous (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hf : QuotientMap f)


/-- If `M` and `N` are linearly disjoint, if `M` is flat, then any two commutative
elements of `↥(M ⊓ N)` are not `R`-linearly independent (namely, their span is not `R ^ 2`). -/
theorem not_linearIndependent_pair_of_commute_of_flat_left [Module.Flat R M]
    (a b : ↥(M ⊓ N)) (hc : Commute a.1 b.1) : ¬LinearIndependent R ![a, b]

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
[Nontrivial R]
[Module.Flat R ↥M]
(a b : ↥(M ⊓ N))
(hc : Commute ↑a ↑b)


lemma mapRange_finsuppAntidiag_eq {e : μ ≃+ μ'} {s : Finset ι} {n : μ} :
    (finsuppAntidiag s n).map (mapRange.addEquiv e).toEmbedding = finsuppAntidiag s (e n)

{ι : Type u_1}
{μ : Type u_2}
{μ' : Type u_3}
[DecidableEq ι]
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
[AddCommMonoid μ']
[Finset.HasAntidiagonal μ']
[DecidableEq μ']
{e : μ ≃+ μ'}
{s : Finset ι}
{n : μ}

Finset.map (Finsupp.mapRange.addEquiv e).toEmbedding (s.finsuppAntidiag n) = s.finsuppAntidiag (e n)


@[simp]
theorem coeFn_neg (f : lp E p) : ⇑(-f) = -f

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(f : ↥(lp E p))


@[simp]
theorem coe_mk (f : C(α, β)) (h : Tendsto f (cocompact α) (cocompact β)) :
    ⇑(⟨f, h⟩ : CocompactMap α β) = f

(h : Filter.Tendsto (⇑f) (Filter.cocompact α) (Filter.cocompact β))

⇑{ toContinuousMap := f, cocompact_tendsto' := h } = ⇑f


@[simp]
theorem coe_algebraMap (r : R) : ⇑(algebraMap R (LocallyConstant X Y) r) = algebraMap R (X → Y) r

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{R : Type u_5}
[CommSemiring R]
[Semiring Y]
[Algebra R Y]
(r : R)

⇑((algebraMap R (LocallyConstant X Y)) r) = (algebraMap R (X → Y)) r


theorem right_mem_of_mk_mem_sym2 {xs : List α} {a b : α}
    (h : s(a, b) ∈ xs.sym2) : b ∈ xs

{α : Type u_1}
{xs : List α}
{a b : α}
(h : s(a, b) ∈ xs.sym2)


@[simp]
theorem mul_le_mul_left [PosMulMono α] [PosMulReflectLE α] (a0 : 0 < a) : a * b ≤ a * c ↔ b ≤ c

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulMono α]
[PosMulReflectLE α]
(a0 : 0 < a)


theorem coe_equiv_lpPiLp (f : lp E p) : Equiv.lpPiLp f = ⇑f

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Finite α]
(f : ↥(lp E p))


@[simp, norm_cast]
theorem coe_inf (S T : IntermediateField F E) : (↑(S ⊓ T) : Set E) = (S : Set E) ∩ T

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


theorem _root_.MeasureTheory.Integrable.integral_norm_compProd ⦃f : β × γ → E⦄
    (hf : Integrable f ((κ ⊗ₖ η) a)) : Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂η (a, x)) (κ a)

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

⦃f : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

MeasureTheory.Integrable (fun x => ∫ (y : γ), ‖f (x, y)‖ ∂η (a, x)) (κ a)


/-- Division `y ↦ x / y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply symm_apply toEquiv)
  "Subtraction `y ↦ x - y` as an `IsometryEquiv`."]
def divLeft (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(c b : G)


@[simp] theorem two_nsmul_associated : 2 • associatedHom S Q = Q.polarBilin

(S : Type u_1)
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[CommSemiring S]
[Algebra S R]
[Module S N]
[IsScalarTower S R N]
[Invertible 2]
(Q : QuadraticMap R M N)

2 • (QuadraticMap.associatedHom S) Q = Q.polarBilin


/-- For `m < n`, `(n, m)` is in the transitive closure of a relation `~` if `succ i ~ i`
  for all `i` between `n` and `m`. -/
theorem transGen_of_succ_of_gt (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico m n, r (succ i) i)
    (hmn : m < n) : TransGen r n m

(h : ∀ i ∈ Set.Ico m n, r (Order.succ i) i)


/-- continuous linear maps are Lipschitz continuous. -/
theorem lipschitz : LipschitzWith ⟨‖f‖, opNorm_nonneg f⟩ f

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)


private theorem smul_ne_zero_of_ne_zero_of_pos [Preorder β] (ha : a ≠ 0) (hb : 0 < b) : a • b ≠ 0

{α : Type u_1}
{β : Type u_2}
[Zero α]
[Zero β]
[SMul α β]
[NoZeroSMulDivisors α β]
{a : α}
{b : β}
[Preorder β]
(ha : a ≠ 0)
(hb : 0 < b)


/-- The counit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def counitIso : inverse J C ⋙ functor J C ≅ 𝟭 _

(X : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

∀ (X_1 : J),
  (((CategoryTheory.ShortComplex.FunctorEquivalence.counitIso J C).hom.app X).app X_1).τ₃ =
    CategoryTheory.CategoryStruct.id (X.obj X_1).X₃


@[simp]
theorem decompose_zero : decompose ℳ (0 : M) = 0

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]


/-- Build a `AlgEquiv` from an isomorphism in the category `AlgebraCat R`. -/
@[simps]
def toAlgEquiv {X Y : AlgebraCat R} (i : X ≅ Y) : X ≃ₐ[R] Y

{R : Type u}
[CommRing R]
{X Y : AlgebraCat R}
(i : X ≅ Y)
(a : ↑Y)


@[to_additive] lemma range_mul [Mul α] {ι : Sort*} (a : α) (f : ι → α) :
    range (fun i ↦ a * f i) = a • range f

{α : Type u_2}
[Mul α]
{ι : Sort u_5}
(a : α)
(f : ι → α)

(Set.range fun i => a * f i) = a • Set.range f


@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
    h.equiv.toLinearMap = TensorProduct.lift f

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_2}
{M₂ : Type u_3}
{M : Type u_4}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M]
[Module R M₁]
[Module R M₂]
[Module R M]
{f : M₁ →ₗ[R] M₂ →ₗ[R] M}
(h : IsTensorProduct f)


lemma changeLevel_factorsThrough {m : ℕ} (hm : n ∣ m) : FactorsThrough (changeLevel hm χ) n

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
{m : ℕ}
(hm : n ∣ m)

((DirichletCharacter.changeLevel hm) χ).FactorsThrough n


/-- We say `C` has strict initial objects if every initial object is strict, ie given any morphism
`f : A ⟶ I` where `I` is initial, then `f` is an isomorphism.

Strictly speaking, this says that *any* initial object must be strict, rather than that strict
initial objects exist.
-/
class HasStrictInitialObjects : Prop where
  out : ∀ {I A : C} (f : A ⟶ I), IsInitial I → IsIso f

[self : CategoryTheory.Limits.HasStrictInitialObjects C]

CategoryTheory.Limits.IsInitial I → CategoryTheory.IsIso f


/-- A `SemilatticeInf` is a meet-semilattice, that is, a partial order
  with a meet (a.k.a. glb / greatest lower bound, inf / infimum) operation
  `⊓` which is the greatest element smaller than both factors. -/
class SemilatticeInf (α : Type u) extends Inf α, PartialOrder α where
  /-- The infimum is a lower bound on the first argument -/
  protected inf_le_left : ∀ a b : α, a ⊓ b ≤ a
  /-- The infimum is a lower bound on the second argument -/
  protected inf_le_right : ∀ a b : α, a ⊓ b ≤ b
  /-- The infimum is the *greatest* lower bound -/
  protected le_inf : ∀ a b c : α, a ≤ b → a ≤ c → a ≤ b ⊓ c

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


theorem extChartAt_transDiffeomorph_target (x : M) :
    (extChartAt (I.transDiffeomorph e) x).target = e.symm ⁻¹' (extChartAt I x).target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E')
(x : M)

(extChartAt (I.transDiffeomorph e) x).target = ⇑e.symm ⁻¹' (extChartAt I x).target


protected theorem injective (hM : M ≤ nonZeroDivisors R) : Injective (algebraMap R S)

{R : Type u_1}
[CommRing R]
{M : Submonoid R}
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]
(hM : M ≤ nonZeroDivisors R)


/-- Equality behind `Commute a b`; useful for rewriting. -/
@[to_additive "Equality behind `AddCommute a b`; useful for rewriting."]
protected theorem eq {a b : S} (h : Commute a b) : a * b = b * a

{S : Type u_3}
[Mul S]
{a b : S}
(h : Commute a b)


theorem map_sup (f : A →ₐ[R] B) (S T : Subalgebra R A) : (S ⊔ T).map f = S.map f ⊔ T.map f

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(f : A →ₐ[R] B)
(S T : Subalgebra R A)

Subalgebra.map f (S ⊔ T) = Subalgebra.map f S ⊔ Subalgebra.map f T


theorem Ico_subset_Ico_union_Ico : Ico a c ⊆ Ico a b ∪ Ico b c

{α : Type u_1}
[LinearOrder α]
{a b c : α}


/-- The `Submodule.LinearDisjoint.not_linearIndependent_pair_of_commute_of_flat_right`
for commutative rings. -/
theorem not_linearIndependent_pair_of_flat_right [Module.Flat R N]
    (a b : ↥(M ⊓ N)) : ¬LinearIndependent R ![a, b]

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
[Nontrivial R]
[Module.Flat R ↥N]
(a b : ↥(M ⊓ N))


theorem gcd_succ (x y : Nat) : gcd (succ x) y = gcd (y % succ x) (succ x)


theorem is_compatible_of_exists_amalgamation (x : FamilyOfElements P R)
    (h : ∃ t, x.IsAmalgamation t) : x.Compatible

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

(x : CategoryTheory.Presieve.FamilyOfElements P R)


@[simp]
theorem cosh_sq_sub_sinh_sq : cosh x ^ 2 - sinh x ^ 2 = 1

Complex.cosh x ^ 2 - Complex.sinh x ^ 2 = 1


@[simp, norm_cast]
lemma ofReal_le_ofReal {x y : ℝ} : (x : K) ≤ (y : K) ↔ x ≤ y

↑x ≤ ↑y ↔ x ≤ y


theorem IsOpen.ite' {s s' t : Set α} (hs : IsOpen s) (hs' : IsOpen s')
    (ht : ∀ x ∈ frontier t, x ∈ s ↔ x ∈ s') : IsOpen (t.ite s s')

{α : Type u_1}
[TopologicalSpace α]
{s s' t : Set α}
(hs : IsOpen s)
(hs' : IsOpen s')
(ht : ∀ x ∈ frontier t, x ∈ s ↔ x ∈ s')


/-- Heterobasic version of `TensorProduct.mk`:

The canonical bilinear map `M →[A] N →[R] M ⊗[R] N`. -/
@[simps! apply]
nonrec def mk : M →ₗ[A] N →ₗ[R] M ⊗[R] N

(R : Type uR)
(A : Type uA)
(M : Type uM)
(N : Type uN)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
(m : M)

(TensorProduct.AlgebraTensorModule.mk R A M N) m = { toFun := fun x => m ⊗ₜ[R] x, map_add' := ⋯, map_smul' := ⋯ }


@[simp]
theorem map_comp_ι (f : M →ₗ[R] N) : (map f).toLinearMap ∘ₗ ι R = ι R ∘ₗ f

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
[AddCommGroup N]
[Module R N]
(f : M →ₗ[R] N)

(ExteriorAlgebra.map f).toLinearMap ∘ₗ ExteriorAlgebra.ι R = ExteriorAlgebra.ι R ∘ₗ f


@[simp]
theorem mem_full_objs_iff {c : C} : c ∈ (full D).objs ↔ c ∈ D

{C : Type u}
[CategoryTheory.Groupoid C]
(D : Set C)
{c : C}

c ∈ (CategoryTheory.Subgroupoid.full D).objs ↔ c ∈ D


theorem injective_iff_surjective {f : α → α} : Injective f ↔ Surjective f

Function.Injective f ↔ Function.Surjective f


lemma mem_inf {I J : TwoSidedIdeal R} {x : R} :
    x ∈ I ⊓ J ↔ x ∈ I ∧ x ∈ J

(R : Type u_1)
[NonUnitalNonAssocRing R]
{I J : TwoSidedIdeal R}
{x : R}


theorem upperBounds_image {s : Set α} : upperBounds (f '' s) = f '' upperBounds s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
{s : Set α}

upperBounds (⇑f '' s) = ⇑f '' upperBounds s


theorem map_add_add (f : E →L[𝕜] Fₗ →L[𝕜] Gₗ) (x x' : E) (y y' : Fₗ) :
    f (x + x') (y + y') = f x y + f.deriv₂ (x, y) (x', y') + f x' y'

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
{Gₗ : Type u_9}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]
(f : E →L[𝕜] Fₗ →L[𝕜] Gₗ)
(x x' : E)
(y y' : Fₗ)


@[simp, mfld_simps]
theorem coe_trans_symm : ((e.trans e').symm : Z → X) = e.symm ∘ e'.symm

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)


protected lemma compl_Iic_zero : (Set.Iic 0)ᶜ = slitPlane


theorem Associated.neg_left [Monoid α] [HasDistribNeg α] {a b : α} (h : Associated a b) :
    Associated (-a) b

{α : Type u_1}
[Monoid α]
[HasDistribNeg α]
{a b : α}
(h : a ~ᵤ b)


theorem wMk_eq {α : TypeVec n} (a : P.A) (f : P.last.B a → P.last.W) (g' : P.drop.B a ⟹ α)
    (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    (P.wMk a g' fun i => ⟨f i, g i⟩) = ⟨⟨a, f⟩, P.wPathCasesOn g' g⟩

(g : (j : P.last.B a) → TypeVec.Arrow (P.WPath (f j)) α)

(P.wMk a g' fun i => ⟨f i, g i⟩) = ⟨WType.mk a f, P.wPathCasesOn g' g⟩


lemma mul_self_lt_mul_self (h : m < n) : m * m < n * n


@[simp] theorem not_append {x : BitVec w} {y : BitVec v} : ~~~ (x ++ y) = (~~~ x) ++ (~~~ y)

{w v : Nat}
{x : BitVec w}
{y : BitVec v}


@[simp] theorem toNat_and (x y : BitVec v) :
    BitVec.toNat (x &&& y) = BitVec.toNat x &&& BitVec.toNat y


@[simp]
theorem length_permutations'Aux (s : List α) (x : α) :
    length (permutations'Aux x s) = length s + 1

(List.permutations'Aux x s).length = s.length + 1


@[simp]
theorem tensorHom_id {X₁ X₂ : C} (f : X₁ ⟶ X₂) (Y : C) :
    f ⊗ 𝟙 Y = f ▷ Y

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

CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.CategoryStruct.id Y) =
  CategoryTheory.MonoidalCategory.whiskerRight f Y


/-- The volume of `(ConvexBodyLt K f)` where `convexBodyLT K f` is the set of points `x`
such that `‖x w‖ < f w` for all infinite places `w`. -/
theorem convexBodyLT_volume :
    volume (convexBodyLT K f) = (convexBodyLTFactor K) * ∏ w, (f w) ^ (mult w)

(f : NumberField.InfinitePlace K → NNReal)

MeasureTheory.volume (NumberField.mixedEmbedding.convexBodyLT K f) =
  ↑(NumberField.mixedEmbedding.convexBodyLTFactor K) * ↑(∏ w : NumberField.InfinitePlace K, f w ^ w.mult)


theorem reduce_isSpecial : ∀ u : XgcdType, u.IsSpecial → u.reduce.IsSpecial


lemma charP_to_charZero [CharP R 0] : CharZero R

(R : Type u_1)
[AddGroupWithOne R]
[CharP R 0]


@[simp]
theorem ofModule_asAlgebraHom_apply_apply (r : MonoidAlgebra k G)
    (m : RestrictScalars k (MonoidAlgebra k G) M) :
    ((ofModule M).asAlgebraHom r) m =
      (RestrictScalars.addEquiv _ _ _).symm (r • RestrictScalars.addEquiv _ _ _ m)

((Representation.ofModule M).asAlgebraHom r) m =
  (RestrictScalars.addEquiv k (MonoidAlgebra k G) M).symm (r • (RestrictScalars.addEquiv k (MonoidAlgebra k G) M) m)


/-- If `𝒜` is an algebra of sets, then it contains the algebra generated by itself. -/
theorem generateSetAlgebra_subset_self (h𝒜 : IsSetAlgebra 𝒜) :
    generateSetAlgebra 𝒜 ⊆ 𝒜

{α : Type u_1}
{𝒜 : Set (Set α)}
(h𝒜 : MeasureTheory.IsSetAlgebra 𝒜)


theorem IsNormal.conjugation_bij (Sn : IsNormal S) {c d} (p : c ⟶ d) :
    Set.BijOn (fun γ : c ⟶ c => Groupoid.inv p ≫ γ ≫ p) (S.arrows c c) (S.arrows d d)

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
(Sn : S.IsNormal)
{c d : C}
(p : c ⟶ d)

Set.BijOn
  (fun γ => CategoryTheory.CategoryStruct.comp (CategoryTheory.Groupoid.inv p) (CategoryTheory.CategoryStruct.comp γ p))
  (S.arrows c c) (S.arrows d d)


theorem smul_inf [SMul R ℝ] [SMul R ℝ≥0] [IsScalarTower R ℝ≥0 ℝ] (r : R) (p q : Seminorm 𝕜 E) :
    r • (p ⊓ q) = r • p ⊓ r • q

{R : Type u_1}
{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p q : Seminorm 𝕜 E)


@[simp] lemma one_succAbove_one {n : ℕ} : (1 : Fin (n + 3)).succAbove 1 = 2


/-- Definition of `ContinuousMap.compactOpen`. -/
theorem compactOpen_eq : @compactOpen X Y _ _ =
    .generateFrom (image2 (fun K U ↦ {f | MapsTo f K U}) {K | IsCompact K} {t | IsOpen t})

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]

ContinuousMap.compactOpen =
  TopologicalSpace.generateFrom (Set.image2 (fun K U => {f | Set.MapsTo (⇑f) K U}) {K | IsCompact K} {t | IsOpen t})


theorem smul_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R)
    (x : AdicCauchySequence I M) :
    r.val n • Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (x.val n) =
      r.val m • Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (x.val m)

(r : AdicCompletion.AdicCauchySequence I R)

(x : AdicCompletion.AdicCauchySequence I M)

↑r n • Submodule.Quotient.mk (↑x n) = ↑r m • Submodule.Quotient.mk (↑x m)


theorem log_monotone {b : ℕ} : Monotone (log b)


@[to_additive]
theorem prod_comm {ι₁ ι₂ : Sort _} {β₁ : ι₁ → Type*} {β₂ : ι₂ → Type*} [DecidableEq ι₁]
    [DecidableEq ι₂] [∀ i, Zero (β₁ i)] [∀ i, Zero (β₂ i)] [∀ (i) (x : β₁ i), Decidable (x ≠ 0)]
    [∀ (i) (x : β₂ i), Decidable (x ≠ 0)] [CommMonoid γ] (f₁ : Π₀ i, β₁ i) (f₂ : Π₀ i, β₂ i)
    (h : ∀ i, β₁ i → ∀ i, β₂ i → γ) :
    (f₁.prod fun i₁ x₁ => f₂.prod fun i₂ x₂ => h i₁ x₁ i₂ x₂) =
      f₂.prod fun i₂ x₂ => f₁.prod fun i₁ x₁ => h i₁ x₁ i₂ x₂

[(i : ι₁) → (x : β₁ i) → Decidable (x ≠ 0)]

[(i : ι₂) → (x : β₂ i) → Decidable (x ≠ 0)]

(h : (i : ι₁) → β₁ i → (i : ι₂) → β₂ i → γ)

(f₁.sum fun i₁ x₁ => f₂.sum fun i₂ x₂ => h i₁ x₁ i₂ x₂) = f₂.sum fun i₂ x₂ => f₁.sum fun i₁ x₁ => h i₁ x₁ i₂ x₂


theorem ext_iff {f g : A →A[R] B} : f = g ↔ ∀ x, f x = g x

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{f g : A →A[R] B}


@[simp]
theorem degree_neg (p : R[X]) : degree (-p) = degree p


@[simp]
theorem lieCharacter_apply_lie' (χ : LieCharacter R L) (x y : L) : ⁅χ x, χ y⁆ = 0

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(χ : LieAlgebra.LieCharacter R L)
(x y : L)


lemma addXYZ_of_X_eq {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) :
    W.addXYZ P Q = addU P Q • ![1, 1, 0]

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)

W.addXYZ P Q = WeierstrassCurve.Jacobian.addU P Q • ![1, 1, 0]


@[norm_cast]
theorem to_nat_inj {m n : PosNum} : (m : ℕ) = n ↔ m = n


/-- A subalgebra is algebraic if and only if it is algebraic as an algebra. -/
theorem Subalgebra.isAlgebraic_iff (S : Subalgebra R A) :
    S.IsAlgebraic ↔ @Algebra.IsAlgebraic R S _ _ S.algebra

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
(S : Subalgebra R A)

S.IsAlgebraic ↔ Algebra.IsAlgebraic R ↥S


@[to_additive (attr := simp)]
theorem quot_mk_eq_mk : Quot.mk Red.Step L = mk L

Quot.mk FreeGroup.Red.Step L = FreeGroup.mk L


theorem coeff_add_mul_monomial (a : R) :
    coeff R (m + n) (φ * monomial R n a) = coeff R m φ * a

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(m n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)
(a : R)

(MvPowerSeries.coeff R (m + n)) (φ * (MvPowerSeries.monomial R n) a) = (MvPowerSeries.coeff R m) φ * a


@[simp] theorem emod_self_add_one {x : Int} (h : 0 ≤ x) : x % (x + 1) = x


theorem add_def {X Y : C} (a b : X ⟶ Y) : a + b = a - -b


theorem differentiableOn_of_locally_differentiableOn
    (h : ∀ x ∈ s, ∃ u, IsOpen u ∧ x ∈ u ∧ DifferentiableOn 𝕜 f (s ∩ u)) :
    DifferentiableOn 𝕜 f s


lemma add_pos_iff_pos_or_pos : 0 < m + n ↔ 0 < m ∨ 0 < n


@[ext]
lemma pullback_obj_obj_ext {Z : C} {f : X ⟶ Y} {F : Y.Presheaf C} (U : (Opens X)ᵒᵖ)
    {φ ψ : ((pullback C f).obj F).obj U ⟶ Z}
    (h : ∀ (V : Opens Y) (hV : U.unop ≤ (Opens.map f).obj V),
      ((pushforwardPullbackAdjunction C f).unit.app F).app (op V) ≫
        ((pullback C f).obj F).map (homOfLE hV).op ≫ φ =
      ((pushforwardPullbackAdjunction C f).unit.app F).app (op V) ≫
        ((pullback C f).obj F).map (homOfLE hV).op ≫ ψ) : φ = ψ

{φ ψ : ((TopCat.Presheaf.pullback C f).obj F).obj U ⟶ Z}

(h :
  ∀ (V : TopologicalSpace.Opens ↑Y) (hV : Opposite.unop U ≤ (TopologicalSpace.Opens.map f).obj V),
    ((TopCat.Presheaf.pushforwardPullbackAdjunction C f).unit.app F).app (Opposite.op V) ≫
        ((TopCat.Presheaf.pullback C f).obj F).map (CategoryTheory.homOfLE hV).op ≫ φ =
      ((TopCat.Presheaf.pushforwardPullbackAdjunction C f).unit.app F).app (Opposite.op V) ≫
        ((TopCat.Presheaf.pullback C f).obj F).map (CategoryTheory.homOfLE hV).op ≫ ψ)


theorem isClosed_range_sigmaMk {i : ι} : IsClosed (range (@Sigma.mk ι σ i))

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
{i : ι}


@[to_additive]
theorem locallyFinite_mulSupport_iff [CommMonoid M] {f : ι → X → M} :
    (LocallyFinite fun i ↦ mulSupport <| f i) ↔ LocallyFinite fun i ↦ mulTSupport <| f i

{X : Type u_1}
{M : Type u_7}
{ι : Type u_10}
[TopologicalSpace X]
[AddCommMonoid M]
{f : ι → X → M}

(LocallyFinite fun i => Function.support (f i)) ↔ LocallyFinite fun i => tsupport (f i)


theorem count_le_count_cons (a b : α) (l : List α) : count a l ≤ count a (b :: l)

{α : Type u_1}
[DecidableEq α]
(a b : α)
(l : List α)


@[reassoc]
theorem associator_inv_conjugation {X X' Y Y' Z Z' : C} (f : X ⟶ X') (g : Y ⟶ Y') (h : Z ⟶ Z') :
    f ⊗ g ⊗ h = (α_ X Y Z).inv ≫ ((f ⊗ g) ⊗ h) ≫ (α_ X' Y' Z').hom

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

CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.MonoidalCategory.tensorHom g h) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.tensorHom f g) h)
      (CategoryTheory.MonoidalCategory.associator X' Y' Z').hom)


theorem ndinsert_le {a : α} {s t : Multiset α} : ndinsert a s ≤ t ↔ s ≤ t ∧ a ∈ t

{α : Type u_1}
[DecidableEq α]
{a : α}
{s t : Multiset α}

Multiset.ndinsert a s ≤ t ↔ s ≤ t ∧ a ∈ t


theorem filter_singleton (a : α) : filter p {a} = if p a then {a} else ∅

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(a : α)

Finset.filter p {a} = if p a then {a} else ∅


@[to_additive (attr := simp) Fintype.sum_prod_type]
theorem Fintype.prod_prod_type [CommMonoid γ] {f : α₁ × α₂ → γ} :
    ∏ x, f x = ∏ x, ∏ y, f (x, y)

{γ : Type u_3}
{α₁ : Type u_4}
{α₂ : Type u_5}
[Fintype α₁]
[Fintype α₂]
[AddCommMonoid γ]
{f : α₁ × α₂ → γ}

∑ x : α₁ × α₂, f x = ∑ x : α₁, ∑ y : α₂, f (x, y)


@[simp]
theorem Differentiable.div (hc : Differentiable 𝕜 c) (hd : Differentiable 𝕜 d) (hx : ∀ x, d x ≠ 0) :
    Differentiable 𝕜 fun x => c x / d x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
(hc : Differentiable 𝕜 c)
(hd : Differentiable 𝕜 d)
(hx : ∀ (x : 𝕜), d x ≠ 0)


/-- If `ι` has a unique element, then `ι → M` is linearly equivalent to `M`. -/
@[simps (config := { simpRhs := true, fullyApplied := false }) symm_apply]
def funUnique (ι R M : Type*) [Unique ι] [Semiring R] [AddCommMonoid M] [Module R M] :
    (ι → M) ≃ₗ[R] M

(ι : Type u_5)
(R : Type u_6)
(M : Type u_7)
[Unique ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]

⇑(LinearEquiv.funUnique ι R M).symm = uniqueElim


lemma Finitary.sigma (h : ∀ i, (M i).Finitary) : (Matroid.sigma M).Finitary

{ι : Type u_1}
{α : ι → Type u_2}
{M : (i : ι) → Matroid (α i)}
(h : ∀ (i : ι), (M i).Finitary)


theorem map_le_iff_le_comap {K : LieSubalgebra R L} {K' : LieSubalgebra R L₂} :
    map f K ≤ K' ↔ K ≤ comap f K'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
{f : L →ₗ⁅R⁆ L₂}
{K : LieSubalgebra R L}
{K' : LieSubalgebra R L₂}

LieSubalgebra.map f K ≤ K' ↔ K ≤ LieSubalgebra.comap f K'


@[simp]
theorem orderIsoPUnitSumLex_bot : @orderIsoPUnitSumLex α _ ⊥ = toLex (inl PUnit.unit)

WithBot.orderIsoPUnitSumLex ⊥ = toLex (Sum.inl PUnit.unit)


@[simp]
theorem zeroth_prime_eq_two : nth Prime 0 = 2


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

(f : CategoryTheory.StructuredArrow S T)


@[simp, mfld_simps]
theorem trivializationAt_baseSet (x : M) :
    (trivializationAt E (TangentSpace I) x).baseSet = (chartAt H x).source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(x : M)


@[simp]
theorem untop'_top {α} (d : α) : untop' d ⊤ = d


theorem rat_dense (q : ℚ_[p]) {ε : ℝ} (hε : 0 < ε) : ∃ r : ℚ, ‖q - r‖ < ε

(p : ℕ)
[Fact (Nat.Prime p)]
(q : ℚ_[p])
{ε : ℝ}
(hε : 0 < ε)


theorem nrRealPlaces_eq_one_of_finrank_eq_one (h : finrank ℚ K = 1) :
    NrRealPlaces K = 1

{K : Type u_2}
[Field K]
[NumberField K]
(h : FiniteDimensional.finrank ℚ K = 1)

NumberField.InfinitePlace.NrRealPlaces K = 1


/-- Empty graphs are strongly regular. Note that `ℓ` can take any value
for empty graphs, since there are no pairs of adjacent vertices. -/
theorem bot_strongly_regular : (⊥ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 ℓ 0


@[simp]
lemma equivShrink_add [Add α] [Small α] (x y : α) :
    equivShrink α (x + y) = equivShrink α x + equivShrink α y

{α : Type u_1}
[Add α]
[Small.{u_2, u_1} α]
(x y : α)

(equivShrink α) (x + y) = (equivShrink α) x + (equivShrink α) y


@[to_additive]
lemma inv [Inv γ] [MeasurableInv γ] (h : IdentDistrib f g μ ν) :
    IdentDistrib f⁻¹ g⁻¹ μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib f⁻¹ g⁻¹ μ ν


@[to_additive]
theorem prod_mul_tprod_compl {s : Finset β} (hf : Multipliable f) :
    (∏ x ∈ s, f x) * ∏' x : ↑(s : Set β)ᶜ, f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
[T2Space α]
{s : Finset β}
(hf : Summable f)

∑ x ∈ s, f x + ∑' (x : ↑(↑s)ᶜ), f ↑x = ∑' (x : β), f x


@[simp]
theorem reflect_C_mul (f : R[X]) (r : R) (N : ℕ) : reflect N (C r * f) = C r * reflect N f

{R : Type u_1}
[Semiring R]
(f : Polynomial R)
(r : R)
(N : ℕ)

Polynomial.reflect N (Polynomial.C r * f) = Polynomial.C r * Polynomial.reflect N f


theorem get!_eq_get? [Inhabited α] (a : Array α) : a.get! n = (a.get? n).getD default

{α : Type u_1}
{n : Nat}
[Inhabited α]
(a : Array α)


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.mul_lt_one`. -/
@[to_additive "Assumes right covariance.
The lemma assuming left covariance is `Left.add_neg`."]
theorem Right.mul_lt_one [CovariantClass α α (swap (· * ·)) (· < ·)] {a b : α} (ha : a < 1)
    (hb : b < 1) :
    a * b < 1

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


theorem norm_setToSimpleFunc_le_sum_opNorm {m : MeasurableSpace α} (T : Set α → F' →L[ℝ] F)
    (f : α →ₛ F') : ‖f.setToSimpleFunc T‖ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x})‖ * ‖x‖

{α : Type u_1}
{F : Type u_3}
{F' : Type u_4}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedAddCommGroup F']
[NormedSpace ℝ F']
{m : MeasurableSpace α}
(T : Set α → F' →L[ℝ] F)
(f : MeasureTheory.SimpleFunc α F')

‖MeasureTheory.SimpleFunc.setToSimpleFunc T f‖ ≤ ∑ x ∈ f.range, ‖T (↑f ⁻¹' {x})‖ * ‖x‖


theorem vector_ofFn {n} {f : Fin n → α → σ} (hf : ∀ i, Primrec (f i)) :
    Primrec fun a => Vector.ofFn fun i => f i a

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{n : ℕ}
{f : Fin n → α → σ}
(hf : ∀ (i : Fin n), Primrec (f i))

Primrec fun a => Mathlib.Vector.ofFn fun i => f i a


/-- If `f` is `AnalyticWithinOn` near each point in a set, it is `AnalyticWithinOn` the set -/
lemma analyticWithinOn_of_locally_analyticWithinOn {f : E → F} {s : Set E}
    (h : ∀ x ∈ s, ∃ u, IsOpen u ∧ x ∈ u ∧ AnalyticWithinOn 𝕜 f (s ∩ u)) :
    AnalyticWithinOn 𝕜 f s


theorem mem_gradeBy_iff (f : M → ι) (i : ι) (a : R[M]) :
    a ∈ gradeBy R f i ↔ (a.support : Set M) ⊆ f ⁻¹' {i}

{M : Type u_1}
{ι : Type u_2}
(R : Type u_3)
[CommSemiring R]
(f : M → ι)
(i : ι)
(a : AddMonoidAlgebra R M)

a ∈ AddMonoidAlgebra.gradeBy R f i ↔ ↑a.support ⊆ f ⁻¹' {i}


@[to_additive]
theorem prod.unique (g : FreeGroup α →* α) (hg : ∀ x, g (FreeGroup.of x) = x) {x} : g x = prod x

(hg : ∀ (x : α), g (FreeGroup.of x) = x)


theorem lt_inv_of_neg (ha : a < 0) (hb : b < 0) : a < b⁻¹ ↔ b < a⁻¹

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
(ha : a < 0)
(hb : b < 0)


@[to_additive (attr := simp)]
theorem snd_inv : s⁻¹.snd = s.fst⁻¹

{α : Type u_2}
[OrderedCommGroup α]
(s : NonemptyInterval α)


/-- The counit iso in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.counitIso : inverse J K e A ⋙ functor J K e A ≅ 𝟭 (Sheaf _ A)

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

∀ (X_1 : Dᵒᵖ),
  ((CategoryTheory.Equivalence.sheafCongr.counitIso J K e A).inv.app X).val.app X_1 =
    X.val.map (e.counitIso.hom.app (Opposite.unop X_1)).op


/-- All elements are self-adjoint when `star` is trivial. -/
theorem all [Star R] [TrivialStar R] (r : R) : IsSelfAdjoint r

{R : Type u_1}
[Star R]
[TrivialStar R]
(r : R)


@[simp, norm_cast]
theorem natCast_sub (m n : ℕ) : ↑(m - n) = (m - n : ℝ≥0∞)


@[simp] theorem isSome_getLeft?_iff_isLeft : x.getLeft?.isSome ↔ x.isLeft

x.getLeft?.isSome = true ↔ x.isLeft = true


/-- The category of sheaves taking values in Type is the same as the category of set-valued sheaves.
-/
@[simps]
def sheafEquivSheafOfTypes : Sheaf J (Type w) ≌ SheafOfTypes J

(CategoryTheory.sheafEquivSheafOfTypes J).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun X => CategoryTheory.Iso.refl ((CategoryTheory.Functor.id (CategoryTheory.Sheaf J (Type w))).obj X)) ⋯


theorem FiberBundle.chartedSpace'_chartAt (x : TotalSpace F E) :
    chartAt (B × F) x = (trivializationAt F E x.proj).toPartialHomeomorph

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem _root_.Real.toNNReal_div' {x y : ℝ} (hy : 0 ≤ y) :
    Real.toNNReal (x / y) = Real.toNNReal x / Real.toNNReal y

(x / y).toNNReal = x.toNNReal / y.toNNReal


theorem card_fintypeIio : Fintype.card (Set.Iio b) = b


theorem LinearMap.mul_toMatrix₂_mul (B : M₁ →ₗ[R] M₂ →ₗ[R] R) (M : Matrix n' n R)
    (N : Matrix m m' R) :
    M * LinearMap.toMatrix₂ b₁ b₂ B * N =
      LinearMap.toMatrix₂ b₁' b₂' (B.compl₁₂ (toLin b₁' b₁ Mᵀ) (toLin b₂' b₂ N))

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{M₁' : Type u_9}
{M₂' : Type u_10}
{n : Type u_12}
{m : Type u_13}
{n' : Type u_14}
{m' : Type u_15}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
[AddCommMonoid M₁']
[Module R M₁']
[AddCommMonoid M₂']
[Module R M₂']
(b₁' : Basis n' R M₁')
(b₂' : Basis m' R M₂')
[Fintype n']
[Fintype m']
[DecidableEq n']
[DecidableEq m']
(B : M₁ →ₗ[R] M₂ →ₗ[R] R)
(M : Matrix n' n R)
(N : Matrix m m' R)

M * (LinearMap.toMatrix₂ b₁ b₂) B * N =
  (LinearMap.toMatrix₂ b₁' b₂') (B.compl₁₂ ((Matrix.toLin b₁' b₁) Mᵀ) ((Matrix.toLin b₂' b₂) N))


theorem HasDerivWithinAt.const_cpow (hf : HasDerivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
    HasDerivWithinAt (fun x => c ^ f x) (c ^ f x * Complex.log c * f') s x

{f : ℂ → ℂ}
{s : Set ℂ}
{f' x c : ℂ}
(hf : HasDerivWithinAt f f' s x)
(h0 : c ≠ 0 ∨ f x ≠ 0)


/-- Given a family of sets `t : ι → Set α`, a finite set `I` in the index type such that all sets
`t i`, `i ∈ I`, are finite, if all `t i`, `i ∈ I`, are pairwise disjoint, then the product of `f a`
over `a ∈ ⋃ i ∈ I, t i` is equal to the product over `i ∈ I` of the products of `f a` over
`a ∈ t i`. -/
@[to_additive
      "Given a family of sets `t : ι → Set α`, a finite set `I` in the index type such that
      all sets `t i`, `i ∈ I`, are finite, if all `t i`, `i ∈ I`, are pairwise disjoint, then the
      sum of `f a` over `a ∈ ⋃ i ∈ I, t i` is equal to the sum over `i ∈ I` of the sums of `f a`
      over `a ∈ t i`."]
theorem finprod_mem_biUnion {I : Set ι} {t : ι → Set α} (h : I.PairwiseDisjoint t) (hI : I.Finite)
    (ht : ∀ i ∈ I, (t i).Finite) : ∏ᶠ a ∈ ⋃ x ∈ I, t x, f a = ∏ᶠ i ∈ I, ∏ᶠ j ∈ t i, f j

{α : Type u_1}
{ι : Type u_3}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{I : Set ι}
{t : ι → Set α}
(h : I.PairwiseDisjoint t)
(hI : I.Finite)
(ht : ∀ i ∈ I, (t i).Finite)

∏ᶠ (a : α) (_ : a ∈ ⋃ x ∈ I, t x), f a = ∏ᶠ (i : ι) (_ : i ∈ I) (j : α) (_ : j ∈ t i), f j


@[simp]
lemma image_subtype_val_Iio_Ioi {a : α} (b : Iio a) : Subtype.val '' Ioi b = Ioo b.1 a

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

Subtype.val '' Set.Ioi b = Set.Ioo (↑b) a


/-- The degree of a product of polynomials is equal to
the sum of the degrees, provided that the product of leading coefficients is nonzero.

See `Polynomial.natDegree_multiset_prod` (without the `'`) for a version for integral domains,
where this condition is automatically satisfied.
-/
theorem natDegree_multiset_prod' (h : (t.map fun f => leadingCoeff f).prod ≠ 0) :
    t.prod.natDegree = (t.map fun f => natDegree f).sum

(h : (Multiset.map (fun f => f.leadingCoeff) t).prod ≠ 0)

t.prod.natDegree = (Multiset.map (fun f => f.natDegree) t).sum


/-- The `vectorSpan` of `n + 1` points in an indexed family has
dimension at most `n`. -/
theorem finrank_vectorSpan_image_finset_le [DecidableEq P] (p : ι → P) (s : Finset ι) {n : ℕ}
    (hc : Finset.card s = n + 1) : finrank k (vectorSpan k (s.image p : Set P)) ≤ n

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[DecidableEq P]
(p : ι → P)
(s : Finset ι)
{n : ℕ}
(hc : s.card = n + 1)

FiniteDimensional.finrank k ↥(vectorSpan k ↑(Finset.image p s)) ≤ n


@[to_additive (attr := simp)]
lemma dist_op (x y : α) : dist (op x) (op y) = dist x y

{α : Type u_1}
[PseudoMetricSpace α]
(x y : α)

dist (AddOpposite.op x) (AddOpposite.op y) = dist x y


@[to_additive]
protected lemma div_left_inj (h : IsUnit c) : a / c = b / c ↔ a = b

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit c)


/-- The lifting of a functor `C ⥤ D` inverting `W` as a functor `W.Localization ⥤ D` -/
@[simps!]
def lift : W.Localization ⥤ D

(a b : CategoryTheory.Quotient (CategoryTheory.Localization.Construction.relations W))

(CategoryTheory.Localization.Construction.lift G hG).map hf =
  Quot.liftOn hf
    (fun f =>
      CategoryTheory.composePath
        ({ obj := fun X => G.obj X.obj,
              map := fun {X Y} a =>
                Sum.rec (fun val => G.map val) (fun val => CategoryTheory.inv (G.map ↑val)) a }.mapPath
          f))
    ⋯


@[reassoc]
lemma mapComp_assoc_right_hom {c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) :
    (F.mapComp f (g ≫ h)).hom ≫ F.map f ◁ (F.mapComp g h).hom = F.map₂ (α_ f g h).inv ≫
    (F.mapComp (f ≫ g) h).hom ≫ (F.mapComp f g).hom ▷ F.map h ≫
    (α_ (F.map f) (F.map g) (F.map h)).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)
{a b c d : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)

CategoryTheory.CategoryStruct.comp (F.mapComp f (CategoryTheory.CategoryStruct.comp g h)).hom
    (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapComp g h).hom) =
  CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.Bicategory.associator f g h).inv)
    (CategoryTheory.CategoryStruct.comp (F.mapComp (CategoryTheory.CategoryStruct.comp f g) h).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g).hom (F.map h))
        (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (F.map h)).hom))


@[to_additive abs_pos_of_neg] lemma one_lt_mabs_of_lt_one (h : a < 1) : 1 < |a|ₘ

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


theorem isSupported_neg (hxs : IsSupported x s) : IsSupported (-x) s

{α : Type u}
{x : FreeCommRing α}
{s : Set α}
(hxs : x.IsSupported s)


theorem le_sequence (a : α) : f a ≤ f (hf.sequence f (encode a + 1))

(hf : Directed (fun x x_1 => x ≤ x_1) f)

f a ≤ f (Directed.sequence f hf (Encodable.encode a + 1))


theorem Injective.beq_eq {α β : Type*} [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β] {f : α → β}
    (I : Injective f) {a b : α} : (f a == f b) = (a == b)

{α : Type u_4}
{β : Type u_5}
[BEq α]
[LawfulBEq α]
[BEq β]
[LawfulBEq β]
{f : α → β}
(I : Function.Injective f)
{a b : α}


theorem closed_iff_image_closed (hf : ClosedEmbedding f) {s : Set X} :
    IsClosed s ↔ IsClosed (f '' s)

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


@[simp]
theorem integral_const {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f : β → E} {μ : Measure β} {a : α} : ∫ x, f x ∂const α μ a = ∫ x, f x ∂μ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : β → E}
{μ : MeasureTheory.Measure β}
{a : α}

∫ (x : β), f x ∂(ProbabilityTheory.Kernel.const α μ) a = ∫ (x : β), f x ∂μ


@[to_additive sum_nonneg]
lemma one_le_prod (hf : 1 ≤ f) : 1 ≤ ∏ i, f i

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCommMonoid M]
{f : ι → M}
(hf : 1 ≤ f)


protected theorem IsCycle.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p) :
    IsCycle g → IsCycle (g.extendDomain f)

{α : Type u_2}
{β : Type u_3}
{g : Equiv.Perm α}
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)


/-- An ultrafilter is a minimal (maximal in the set order) proper filter. -/
structure Ultrafilter (α : Type*) extends Filter α where
  /-- An ultrafilter is nontrivial. -/
  protected neBot' : NeBot toFilter
  /-- If `g` is a nontrivial filter that is less than or equal to an ultrafilter, then it is greater
  than or equal to the ultrafilter. -/
  protected le_of_le : ∀ g, Filter.NeBot g → g ≤ toFilter → toFilter ≤ g

{α : Type u_2}
(self : Ultrafilter α)
(g : Filter α)


theorem exists_fin_succ_pi {P : (∀ i, α i) → Prop} : (∃ x, P x) ↔ ∃ a v, P (Fin.cons a v)

{n : ℕ}
{α : Fin (n + 1) → Type u}
{P : ((i : Fin (n + 1)) → α i) → Prop}


/-- Bound `abv (a + b)` from below -/
protected theorem le_add (a b : R) : abv a - abv b ≤ abv (a + b)

{R : Type u_3}
{S : Type u_4}
[OrderedCommRing S]
[Ring R]
(abv : AbsoluteValue R S)
[NoZeroDivisors S]
(a b : R)


@[simp]
theorem pi_eval (f : ∀ i, C(A, X i)) (a : A) : (pi f) a = fun i : I => (f i) a

{I : Type u_5}
{A : Type u_6}
{X : I → Type u_7}
[TopologicalSpace A]
[(i : I) → TopologicalSpace (X i)]
(f : (i : I) → C(A, X i))
(a : A)

(ContinuousMap.pi f) a = fun i => (f i) a


@[simp]
theorem lowerCentralSeries_nilpotencyClass :
    lowerCentralSeries G (Group.nilpotencyClass G) = ⊥

{G : Type u_1}
[Group G]
[hG : Group.IsNilpotent G]


theorem exists_finset_of_mem_supr' {ι : Type*} {f : ι → IntermediateField F E} {x : E}
    (hx : x ∈ ⨆ i, f i) : ∃ s : Finset (Σ i, f i), x ∈ ⨆ i ∈ s, F⟮(i.2 : E)⟯

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{ι : Type u_3}
{f : ι → IntermediateField F E}
{x : E}
(hx : x ∈ ⨆ i, f i)


protected theorem lt_add_one_iff_lt_or_eq : m < n + 1 ↔ m < n ∨ m = n


theorem smul_eq_map [MulSemiringAction M R] (m : M) :
    HSMul.hSMul m = map (MulSemiringAction.toRingHom M R m)

{M : Type u_1}
[Monoid M]
(R : Type u_2)
[Semiring R]
[MulSemiringAction M R]
(m : M)

HSMul.hSMul m = Polynomial.map (MulSemiringAction.toRingHom M R m)


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


/-- If a function is `antiperiodic` with antiperiod `c`, then it is also `Periodic` with period
  `2 * c`. -/
protected theorem Antiperiodic.periodic_two_mul [Semiring α] [InvolutiveNeg β]
    (h : Antiperiodic f c) : Periodic f (2 * c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[Semiring α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)


@[simp] theorem exists_prop : (∃ _h : a, b) ↔ a ∧ b


theorem maximals_of_symm [IsSymm α r] : maximals r s = s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsSymm α r]


@[simp]
theorem ofDual_wcovBy_ofDual_iff {a b : αᵒᵈ} : ofDual a ⩿ ofDual b ↔ b ⩿ a

OrderDual.ofDual a ⩿ OrderDual.ofDual b ↔ b ⩿ a


@[to_additive (attr := simp)]
lemma stabilizer_finset_singleton (b : α) : stabilizer G ({b} : Finset α) = stabilizer G b

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
[DecidableEq α]
(b : α)

MulAction.stabilizer G {b} = MulAction.stabilizer G b


theorem closure_preimage_le (f : R →+* S) (s : Set S) : closure (f ⁻¹' s) ≤ (closure s).comap f

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)
(s : Set S)

Subring.closure (⇑f ⁻¹' s) ≤ Subring.comap f (Subring.closure s)


/-- The sum over all values of a nontrivial multiplicative character on a finite ring is zero
(when the target is a domain). -/
theorem sum_eq_zero_of_ne_one [IsDomain R'] {χ : MulChar R R'} (hχ : χ ≠ 1) : ∑ a, χ a = 0

{R : Type u_1}
[CommMonoid R]
[Fintype R]
{R' : Type u_2}
[CommRing R']
[IsDomain R']
{χ : MulChar R R'}
(hχ : χ ≠ 1)


@[simp]
theorem liftAlternating_ιMulti :
    liftAlternating (R := R) (M := M) (N := ExteriorAlgebra R M) (ιMulti R) =
    (LinearMap.id : ExteriorAlgebra R M →ₗ[R] ExteriorAlgebra R M)

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

ExteriorAlgebra.liftAlternating (ExteriorAlgebra.ιMulti R) = LinearMap.id


/-- The `R`-algebra `HahnSeries ℕ A` is isomorphic to `PowerSeries A`. -/
@[simps!]
def toPowerSeriesAlg : HahnSeries ℕ A ≃ₐ[R] PowerSeries A

(R : Type u_2)
[CommSemiring R]
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : PowerSeries A)
(n : ℕ)

((HahnSeries.toPowerSeriesAlg R).symm f).coeff n = (PowerSeries.coeff A n) f


@[fun_prop]
protected theorem ContinuousLinearMap.hasFDerivWithinAt : HasFDerivWithinAt e e s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e : E →L[𝕜] F)
{x : E}
{s : Set E}


@[simp]
theorem List.dProd_nil (fι : α → ι) (fA : ∀ a, A (fι a)) :
    (List.nil : List α).dProd fι fA = GradedMonoid.GOne.one

{ι : Type u_1}
{α : Type u_2}
{A : ι → Type u_3}
[AddMonoid ι]
[GradedMonoid.GMonoid A]
(fι : α → ι)
(fA : (a : α) → A (fι a))


@[to_additive]
theorem max_mul_mul_left (a b c : α) : max (a * b) (a * c) = a * max b c

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


theorem isGLB_univ [OrderBot α] : IsGLB (univ : Set α) ⊥


theorem range_casesOn {α : Type*} (x : α) (f : ℕ → α) :
    (Set.range fun n => Nat.casesOn n x f : Set α) = {x} ∪ Set.range f

(Set.range fun n => Nat.casesOn n x f) = {x} ∪ Set.range f


theorem map_eq_map {f : α → β} (hf : Function.Injective f) {s t : Multiset α} :
    s.map f = t.map f ↔ s = t

{α : Type u_1}
{β : Type v}
{f : α → β}
(hf : Function.Injective f)
{s t : Multiset α}

Multiset.map f s = Multiset.map f t ↔ s = t


@[simp, norm_cast]
theorem coe_snd : ↑(snd R A B) = AlgHom.snd R A B

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]

↑(ContinuousAlgHom.snd R A B) = AlgHom.snd R A B


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : MonCat} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f


@[simp]
theorem withBot_comp (f : LatticeHom β γ) (g : LatticeHom α β) :
    (f.comp g).withBot = f.withBot.comp g.withBot

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
(f : LatticeHom β γ)
(g : LatticeHom α β)


@[to_additive]
theorem comap_map_eq_of_injective (S : Submonoid M) : (S.map f).comap f = S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)
(S : Submonoid M)

Submonoid.comap f (Submonoid.map f S) = S


protected theorem isometry (h : α ≃ᵢ β) : Isometry h

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)


theorem rootMultiplicity_le_one_of_separable [Nontrivial R] {p : R[X]} (hsep : Separable p)
    (x : R) : rootMultiplicity x p ≤ 1

{R : Type u}
[CommRing R]
[Nontrivial R]
{p : R[X]}
(hsep : p.Separable)
(x : R)


@[to_additive]
theorem mulSingle_op₂ {g₁ g₂ : I → Type*} [∀ i, One (g₁ i)] [∀ i, One (g₂ i)]
    (op : ∀ i, g₁ i → g₂ i → f i) (h : ∀ i, op i 1 1 = 1) (i : I) (x₁ : g₁ i) (x₂ : g₂ i) :
    mulSingle i (op i x₁ x₂) = fun j => op j (mulSingle i x₁ j) (mulSingle i x₂ j)

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → One (f i)]
{g₁ : I → Type u_4}
{g₂ : I → Type u_5}
[(i : I) → One (g₁ i)]
[(i : I) → One (g₂ i)]
(op : (i : I) → g₁ i → g₂ i → f i)
(h : ∀ (i : I), op i 1 1 = 1)
(i : I)
(x₁ : g₁ i)
(x₂ : g₂ i)

Pi.mulSingle i (op i x₁ x₂) = fun j => op j (Pi.mulSingle i x₁ j) (Pi.mulSingle i x₂ j)


private theorem card_nonuniformWitness_sdiff_biUnion_star (hV : V ∈ P.parts) (hUV : U ≠ V)
    (h₂ : ¬G.IsUniform ε U V) :
    (G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id).card ≤
    2 ^ (P.parts.card - 1) * m

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{P : Finpartition Finset.univ}
{hP : P.IsEquipartition}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : ℝ}
{U : Finset α}
{hU : U ∈ P.parts}
{V : Finset α}
(hV : V ∈ P.parts)
(hUV : U ≠ V)
(h₂ : ¬G.IsUniform ε U V)

(G.nonuniformWitness ε U V \ (SzemerediRegularity.star hP G ε hU V).biUnion id).card ≤
  2 ^ (P.parts.card - 1) * (Fintype.card α / SzemerediRegularity.stepBound P.parts.card)


@[simp]
theorem single_sub (a : α) (b₁ b₂ : G) : single a (b₁ - b₂) = single a b₁ - single a b₂

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(a : α)
(b₁ b₂ : G)

Finsupp.single a (b₁ - b₂) = Finsupp.single a b₁ - Finsupp.single a b₂


theorem charP_iff_model_fieldOfChar [Field K] [CompatibleRing K] :
    (Theory.fieldOfChar p).Model K ↔ CharP K p

{p : ℕ}
{K : Type u_1}
[Field K]
[FirstOrder.Ring.CompatibleRing K]

K ⊨ FirstOrder.Language.Theory.fieldOfChar p ↔ CharP K p


/-- `x ↦ a / x` as an order-reversing equivalence. -/
@[to_additive (attr := simps!) "`x ↦ a - x` as an order-reversing equivalence."]
def OrderIso.divLeft (a : α) : α ≃o αᵒᵈ

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

∀ (a_1 : αᵒᵈ), (RelIso.symm (OrderIso.divLeft a)) a_1 = (OrderDual.ofDual a_1)⁻¹ * a


/-- The norm of `f.comp_along_composition p c` is controlled by the product of
the norms of the relevant bits of `f` and `p`. -/
theorem compAlongComposition_bound {n : ℕ} (p : FormalMultilinearSeries 𝕜 E F) (c : Composition n)
    (f : ContinuousMultilinearMap 𝕜 (fun _i : Fin c.length => F) G) (v : Fin n → E) :
    ‖f.compAlongComposition p c v‖ ≤ (‖f‖ * ∏ i, ‖p (c.blocksFun i)‖) * ∏ i : Fin n, ‖v i‖

(f : ContinuousMultilinearMap 𝕜 (fun _i => F) G)

‖(ContinuousMultilinearMap.compAlongComposition p c f) v‖ ≤
  (‖f‖ * ∏ i : Fin c.length, ‖p (c.blocksFun i)‖) * ∏ i : Fin n, ‖v i‖


@[simp] lemma nonMemberSubfamily_image_insert : (𝒜.image <| insert a).nonMemberSubfamily a = ∅

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{a : α}

Finset.nonMemberSubfamily a (Finset.image (insert a) 𝒜) = ∅


lemma findGreatest_mono_left [DecidablePred Q] (hPQ : ∀ n, P n → Q n) (n : ℕ) :
    Nat.findGreatest P n ≤ Nat.findGreatest Q n

{P Q : ℕ → Prop}
[DecidablePred P]
[DecidablePred Q]
(hPQ : ∀ (n : ℕ), P n → Q n)
(n : ℕ)


@[simp]
theorem map_pure (f : α →o β) (a : α) : (pure a).map f = pure (f a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α →o β)
(a : α)

NonemptyInterval.map f (NonemptyInterval.pure a) = NonemptyInterval.pure (f a)


theorem eLpNorm_rpow_two_norm_lt_top (f : Lp F 2 μ) :
    eLpNorm (fun x => ‖f x‖ ^ (2 : ℝ)) 1 μ < ∞

{α : Type u_1}
{F : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
(f : ↥(MeasureTheory.Lp F 2 μ))

MeasureTheory.eLpNorm (fun x => ‖↑↑f x‖ ^ 2) 1 μ < ⊤


@[to_additive]
theorem tprod_subtype_mulSupport (f : β → α) : ∏' x : mulSupport f, f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(f : β → α)

∑' (x : ↑(Function.support f)), f ↑x = ∑' (x : β), f x


@[to_additive]
theorem lift.range_le {s : Subgroup β} (H : Set.range f ⊆ s) : (lift f).range ≤ s

{α : Type u}
{β : Type v}
[Group β]
{f : α → β}
{s : Subgroup β}
(H : Set.range f ⊆ ↑s)


@[ext]
lemma Bornology.ext (t t' : Bornology α)
    (h_cobounded : @Bornology.cobounded α t = @Bornology.cobounded α t') :
    t = t'

(h_cobounded : Bornology.cobounded α = Bornology.cobounded α)


@[simp, norm_cast] protected lemma gcd_natCast_natCast (m n : ℕ) : gcd ↑m ↑n = m.gcd n


theorem desc_op_comp_opCoproductIsoProduct_hom [HasCoproduct Z] {X : C} (π : (a : α) → Z a ⟶ X) :
    (Sigma.desc π).op ≫ (opCoproductIsoProduct Z).hom = Pi.lift (fun a ↦ (π a).op)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{α : Type u_1}
{Z : α → C}
[CategoryTheory.Limits.HasCoproduct Z]
{X : C}
(π : (a : α) → Z a ⟶ X)

(CategoryTheory.Limits.Sigma.desc π).op ≫ (CategoryTheory.Limits.opCoproductIsoProduct Z).hom =
  CategoryTheory.Limits.Pi.lift fun a => (π a).op


@[to_additive (attr := continuity, fun_prop) sub]
theorem Continuous.div' (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x / g x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
[TopologicalSpace α]
{f g : α → G}
(hf : Continuous f)
(hg : Continuous g)


/-- The **alternating series test** for antitone sequences.
See also `Antitone.tendsto_alternating_series_of_tendsto_zero`. -/
theorem Antitone.cauchySeq_alternating_series_of_tendsto_zero (hfa : Antitone f)
    (hf0 : Tendsto f atTop (𝓝 0)) : CauchySeq fun n ↦ ∑ i ∈ range n, (-1) ^ i * f i

(hf0 : Filter.Tendsto f Filter.atTop (𝓝 0))

CauchySeq fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i


@[to_additive (attr := simp)]
theorem subtype_comp_inclusion {H K : Subgroup G} (hH : H ≤ K) :
    K.subtype.comp (inclusion hH) = H.subtype

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
(hH : H ≤ K)

K.subtype.comp (AddSubgroup.inclusion hH) = H.subtype


@[simp] theorem getLsb_concat_zero : (concat x b).getLsb 0 = b

∀ {w : Nat} {x : BitVec w} {b : Bool}, (x.concat b).getLsb 0 = b


protected theorem new_def_eq_old_def :
    ∀ (f : ℕ → α → β) (l : List α), l.mapIdx f = List.oldMapIdx f l

{α : Type u}
{β : Type v}
(f : ℕ → α → β)
(l : List α)


/-- There is a general version `top_le_iff`, but this lemma does not require a `PartialOrder`. -/
@[simp]
protected theorem top_le_iff : ∀ {a : WithTop α}, ⊤ ≤ a ↔ a = ⊤

⊤ ≤ a ↔ a = ⊤


theorem union_congr_right (hs : s ⊆ t ∪ u) (ht : t ⊆ s ∪ u) : s ∪ u = t ∪ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(hs : s ⊆ t ∪ u)
(ht : t ⊆ s ∪ u)


theorem le_moveRight {x : PGame} (o : Numeric x) (j) : x ≤ x.moveRight j

{x : SetTheory.PGame}
(o : x.Numeric)
(j : x.RightMoves)


theorem bsup_eq_blsub_of_lt_succ_limit {o : Ordinal.{u}} (ho : IsLimit o)
    {f : ∀ a < o, Ordinal.{max u v}} (hf : ∀ a ha, f a ha < f (succ a) (ho.2 a ha)) :
    bsup.{_, v} o f = blsub.{_, v} o f

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v}}

(hf : ∀ (a : Ordinal.{u}) (ha : a < o), f a ha < f (Order.succ a) ⋯)


theorem iIndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
    (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
    {s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
    cgf (∑ i ∈ s, X i) μ t = ∑ i ∈ s, cgf (X i) μ t

{X : ι → Ω → ℝ}

(h_indep : ProbabilityTheory.iIndepFun (fun i => inferInstance) X μ)

(h_int : ∀ i ∈ s, MeasureTheory.Integrable (fun ω => rexp (t * X i ω)) μ)

ProbabilityTheory.cgf (∑ i ∈ s, X i) μ t = ∑ i ∈ s, ProbabilityTheory.cgf (X i) μ t


lemma abs_def (f : ∀ i, α i) : |f| = fun i ↦ |f i|

{ι : Type u_2}
{α : ι → Type u_3}
[(i : ι) → AddGroup (α i)]
[(i : ι) → Lattice (α i)]
(f : (i : ι) → α i)


@[simp]
theorem parallelFamily_obj_zero : (parallelFamily f).obj zero = X

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

(CategoryTheory.Limits.parallelFamily f).obj CategoryTheory.Limits.WalkingParallelFamily.zero = X


theorem diagonal_mulVec_single [Fintype n] [DecidableEq n] [NonUnitalNonAssocSemiring R] (v : n → R)
    (j : n) (x : R) : diagonal v *ᵥ Pi.single j x = Pi.single j (v j * x)

{n : Type u_3}
{R : Type u_7}
[Fintype n]
[DecidableEq n]
[NonUnitalNonAssocSemiring R]
(v : n → R)
(j : n)
(x : R)

Matrix.diagonal v *ᵥ Pi.single j x = Pi.single j (v j * x)


@[to_additive]
theorem Pi.mulSingle_mul [∀ i, MulOneClass <| f i] (i : I) (x y : f i) :
    mulSingle i (x * y) = mulSingle i x * mulSingle i y

{I : Type u}
{f : I → Type v}
[DecidableEq I]
[(i : I) → AddZeroClass (f i)]
(i : I)
(x y : f i)

Pi.single i (x + y) = Pi.single i x + Pi.single i y


/-- A sublattice of a lattice is a set containing the suprema and infima of any of its elements. -/
structure Sublattice where
  /-- The underlying set of a sublattice. **Do not use directly**. Instead, use the coercion
  `Sublattice α → Set α`, which Lean should automatically insert for you in most cases. -/
  carrier : Set α
  supClosed' : SupClosed carrier
  infClosed' : InfClosed carrier

{α : Type u_2}
[Lattice α]
(self : Sublattice α)


/-- Typeclass for reverse monotonicity of scalar multiplication by positive elements on the left,
namely `a₁ • b ≤ a₂ • b → a₁ ≤ a₂` if `0 < b`.

You should usually not use this very granular typeclass directly, but rather a typeclass like
`OrderedSMul`. -/
class SMulPosReflectLE : Prop where
  /-- Do not use this. Use `le_of_smul_lt_smul_right` instead. -/
  protected elim ⦃b : β⦄ (hb : 0 < b) ⦃a₁ a₂ : α⦄ (hb : a₁ • b ≤ a₂ • b) : a₁ ≤ a₂

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero β]
[self : SMulPosReflectLE α β]
⦃b : β⦄
(hb : 0 < b)
⦃a₁ a₂ : α⦄

a₁ • b ≤ a₂ • b → a₁ ≤ a₂


/-- The definitional equality between `p`-ary heterogeneous functions into `τ`
  and function from `vecHead p` to `(vecTail p)`-ary heterogeneous functions into `τ`. -/
@[simps!]
def fromTypes_succ_equiv {n} (p : Fin (n + 1) → Type u) (τ : Type u) :
    FromTypes p τ ≃ (vecHead p → FromTypes (vecTail p) τ)

{n : ℕ}
(p : Fin (n + 1) → Type u)
(τ : Type u)
(a : Function.FromTypes p τ)

(Function.fromTypes_succ_equiv p τ).symm a = a


@[to_additive (attr := simp)]
theorem mul_div_cancel_left (a b : G) : a * b / a = b

{G : Type u_3}
[AddCommGroup G]
(a b : G)


/-- A particular case of Sard's Theorem. If `f` is a `C¹` smooth map from a real vector space to a
real vector space `F` of strictly larger dimension, then the complement of the range of `f` is dense
in `F`. -/
theorem ContDiff.dense_compl_range_of_finrank_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
    (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range f)ᶜ

(hEF : FiniteDimensional.finrank ℝ E < FiniteDimensional.finrank ℝ F)


lemma dist_le_pi_dist (f g : ∀ b, π b) (b : β) : dist (f b) (g b) ≤ dist f g

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
(f g : (b : β) → π b)
(b : β)


@[to_additive (attr := simp)]
theorem inv_down [Inv α] : x⁻¹.down = x.down⁻¹

{α : Type u}
{x : ULift.{v, u} α}
[Inv α]


/-- An explicit description of `χ₈'` on integers / naturals -/
theorem χ₈'_int_eq_if_mod_eight (n : ℤ) :
    χ₈' n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1

ZMod.χ₈' ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1


@[simp] lemma coord_vadd (v : V) (b : AffineBasis ι k P) :
    (v +ᵥ b).coord i = (b.coord i).comp (AffineEquiv.constVAdd k P v).symm

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
{i : ι}
(v : V)
(b : AffineBasis ι k P)

(v +ᵥ b).coord i = (b.coord i).comp ↑(AffineEquiv.constVAdd k P v).symm


theorem decompose_of_mem_same {x : M} {i : ι} (hx : x ∈ ℳ i) : (decompose ℳ x i : M) = x

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]
{x : M}
{i : ι}
(hx : x ∈ ℳ i)


@[simp] theorem getElem_list (i : Nat) (h : i < (list n).length) :
    (list n)[i] = cast (length_list n) ⟨i, h⟩

{n : Nat}
(i : Nat)
(h : i < (Fin.list n).length)


/-- The `NoZeroSMulDivisors` makes sure that the result holds even when the support of `f` is
infinite. For a more usual version assuming `(support f).Finite` instead, see `smul_finsum'`. -/
theorem smul_finsum {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M]
    (c : R) (f : ι → M) : (c • ∑ᶠ i, f i) = ∑ᶠ i, c • f i

{ι : Sort u_6}
{R : Type u_7}
{M : Type u_8}
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(c : R)
(f : ι → M)

c • ∑ᶠ (i : ι), f i = ∑ᶠ (i : ι), c • f i


/-- Dense open sets are residual. -/
theorem residual_of_dense_open {s : Set X} (ho : IsOpen s) (hd : Dense s) : s ∈ residual X

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(ho : IsOpen s)
(hd : Dense s)


theorem comp (hg : LeftOrdContinuous g) (hf : LeftOrdContinuous f) : LeftOrdContinuous (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : LeftOrdContinuous g)
(hf : LeftOrdContinuous f)


/-- A scheme where the children of each set are pairwise disjoint induces an injective map. -/
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2

{β : Type u_1}
{α : Type u_2}
{A : List β → Set α}
(hA : CantorScheme.Disjoint A)


lemma mapsTo_iSup_genEigenspace_of_comm {f g : End R M} (h : Commute f g) (μ : R) :
    MapsTo g ↑(⨆ k, f.genEigenspace μ k) ↑(⨆ k, f.genEigenspace μ k)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f g : Module.End R M}
(h : Commute f g)
(μ : R)

Set.MapsTo ⇑g ↑(⨆ k, (f.genEigenspace μ) k) ↑(⨆ k, (f.genEigenspace μ) k)


/-- Eta rule for costructured arrows. -/
@[simps!]
def eta (f : CostructuredArrow S T) : f ≅ mk f.hom

(f : CategoryTheory.CostructuredArrow S T)


/-- Postcomposition of a 1-morphism as a functor. -/
@[simps]
def postcomp (a : B) (f : b ⟶ c) : (a ⟶ b) ⥤ (a ⟶ c)

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

∀ (x : a ⟶ b), (CategoryTheory.Bicategory.postcomp a f).obj x = CategoryTheory.CategoryStruct.comp x f


theorem closedBall_mem_nhds {x : E} {r : ℝ} (hr : 0 < r) : closedBall x r ∈ 𝓝 x

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{r : ℝ}
(hr : 0 < r)


/-- Compute the target of the composition of two partial homeomorphisms induced by fiberwise linear
equivalences. -/
theorem target_trans_partialHomeomorph (hU : IsOpen U)
    (hφ : ContinuousOn (fun x => φ x : B → F →L[𝕜] F) U)
    (h2φ : ContinuousOn (fun x => (φ x).symm : B → F →L[𝕜] F) U) (hU' : IsOpen U')
    (hφ' : ContinuousOn (fun x => φ' x : B → F →L[𝕜] F) U')
    (h2φ' : ContinuousOn (fun x => (φ' x).symm : B → F →L[𝕜] F) U') :
    (FiberwiseLinear.partialHomeomorph φ hU hφ h2φ ≫ₕ
          FiberwiseLinear.partialHomeomorph φ' hU' hφ' h2φ').target =
      (U ∩ U') ×ˢ univ

(h2φ : ContinuousOn (fun x => ↑(φ x).symm) U)

(hφ' : ContinuousOn (fun x => ↑(φ' x)) U')

(h2φ' : ContinuousOn (fun x => ↑(φ' x).symm) U')

(FiberwiseLinear.partialHomeomorph φ hU hφ h2φ ≫ₕ FiberwiseLinear.partialHomeomorph φ' hU' hφ' h2φ').target =
  (U ∩ U') ×ˢ Set.univ


theorem natTrailingDegree_mul' (h : p.trailingCoeff * q.trailingCoeff ≠ 0) :
    (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree


theorem dvd_of_mem_cycleType {σ : Perm α} {n : ℕ} (h : n ∈ σ.cycleType) : n ∣ orderOf σ

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}
{n : ℕ}
(h : n ∈ σ.cycleType)


/-- If `a < b`, then `b` does not cover `a` iff there's an element in between. -/
theorem not_covBy_iff (h : a < b) : ¬a ⋖ b ↔ ∃ c, a < c ∧ c < b

{α : Type u_1}
[LT α]
{a b : α}
(h : a < b)


/-- If `μ` is inner regular for finite measure sets with respect to compact sets
and is locally finite in an R₁ space,
then any compact set can be approximated from outside by open sets. -/
protected lemma _root_.IsCompact.measure_eq_iInf_isOpen [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α] {K : Set α} (hK : IsCompact K) :
    μ K = ⨅ (U : Set α) (_ : K ⊆ U) (_ : IsOpen U), μ U

μ K = ⨅ U, ⨅ (_ : K ⊆ U), ⨅ (_ : IsOpen U), μ U


@[simp] theorem castAdd_mk (m : Nat) (i : Nat) (h : i < n) :
    castAdd m ⟨i, h⟩ = ⟨i, Nat.lt_add_right m h⟩


@[simp]
theorem homothety_apply_same (c : P1) (r : k) : homothety c r c = c

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[CommRing k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
(c : P1)
(r : k)


@[reassoc (attr := simp, nolint simpNF)]
theorem w {f g : Arrow T} (sq : f ⟶ g) : sq.left ≫ g.hom = f.hom ≫ sq.right

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(sq : f ⟶ g)

CategoryTheory.CategoryStruct.comp sq.left g.hom = CategoryTheory.CategoryStruct.comp f.hom sq.right


@[to_additive (attr := simp)]
theorem mul_le_mul_iff_left [CovariantClass α α (· * ·) (· ≤ ·)]
    [ContravariantClass α α (· * ·) (· ≤ ·)] (a : α) {b c : α} :
    a * b ≤ a * c ↔ b ≤ c

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

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


@[to_additive]
lemma mulIndicator_apply_le {a : α} {s : Set α} {f g : α → M} (hfg : a ∈ s → f a ≤ g a) :
    mulIndicator s f a ≤ g a

{α : Type u_2}
{M : Type u_4}
[CanonicallyOrderedAddCommMonoid M]
{a : α}
{s : Set α}
{f g : α → M}
(hfg : a ∈ s → f a ≤ g a)


/-- If a set has zero measure in a neighborhood of each of its points, then it has zero measure
in a second-countable space. -/
@[deprecated measure_null_of_locally_null (since := "2024-05-14")]
theorem null_of_locally_null [TopologicalSpace α] [SecondCountableTopology α] (m : OuterMeasure α)
    (s : Set α) (hs : ∀ x ∈ s, ∃ u ∈ 𝓝[s] x, m u = 0) : m s = 0

{α : Type u_1}
[TopologicalSpace α]
[SecondCountableTopology α]
(m : MeasureTheory.OuterMeasure α)
(s : Set α)
(hs : ∀ x ∈ s, ∃ u ∈ 𝓝[s] x, m u = 0)


theorem setLIntegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
    (hs : MeasurableSet s) :
    ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x)

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
[MeasureTheory.IsFiniteMeasure ρ]
(x : ℝ)
{s : Set α}
(hs : MeasurableSet s)

∫⁻ (a : α) in s, ENNReal.ofReal (↑(ProbabilityTheory.condCDF ρ a) x) ∂ρ.fst = ρ (s ×ˢ Set.Iic x)


@[simp]
theorem Cofork.app_one_eq_π (t : Cofork f g) : t.ι.app one = t.π

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

t.ι.app CategoryTheory.Limits.WalkingParallelPair.one = t.π


@[to_additive]
lemma mem_units_iff (S : Submonoid M) (x : Mˣ) : x ∈ S.units ↔
    ((x : M) ∈ S ∧ ((x⁻¹ : Mˣ) : M) ∈ S)

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
(x : Mˣ)


theorem isClosed_iUnion (hf : LocallyFinite f) (hc : ∀ i, IsClosed (f i)) :
    IsClosed (⋃ i, f i)

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
(hf : LocallyFinite f)
(hc : ∀ (i : ι), IsClosed (f i))


@[simp]
theorem logDeriv_const (a : 𝕜') : logDeriv (fun _ : 𝕜 ↦ a) = 0

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
(a : 𝕜')


/-- The null homotopic maps `Hσ` are compatible with the application of additive functors. -/
theorem map_Hσ {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    (Hσ q : K[((whiskering C D).obj G).obj X] ⟶ _).f n = G.map ((Hσ q : K[X] ⟶ _).f n)

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preadditive C]
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
(G : C ⥤ D)
[G.Additive]
(X : CategoryTheory.SimplicialObject C)
(q n : ℕ)

(AlgebraicTopology.DoldKan.Hσ q).f n = G.map ((AlgebraicTopology.DoldKan.Hσ q).f n)


theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
    condCount {ω} t = if ω ∈ t then 1 else 0

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
(ω : Ω)
(t : Set Ω)
[Decidable (ω ∈ t)]

(ProbabilityTheory.condCount {ω}) t = if ω ∈ t then 1 else 0


/--
Equivalent preregular categories give equivalent regular toposes.
-/
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
    Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_5, u_2} D]
(e : C ≌ D)
[CategoryTheory.Preregular C]
(A : Type u_3)
[CategoryTheory.Category.{u_6, u_3} A]

∀ {X Y : CategoryTheory.Sheaf (CategoryTheory.regularTopology C) A} (f : X ⟶ Y) (X_1 : Dᵒᵖ),
  ((e.sheafCongrPreregular A).functor.map f).val.app X_1 = f.val.app (Opposite.op (e.inverse.obj (Opposite.unop X_1)))


/-- In the trivial `ChartedSpace` structure of a space modelled over itself through the identity,
the atlas members are just the identity. -/
@[simp, mfld_simps]
theorem chartedSpaceSelf_atlas {H : Type*} [TopologicalSpace H] {e : PartialHomeomorph H H} :
    e ∈ atlas H H ↔ e = PartialHomeomorph.refl H

{H : Type u_5}
[TopologicalSpace H]
{e : PartialHomeomorph H H}


protected theorem encode : ∀ {n}, @Primrec' n encode


theorem exists_integral_multiple [Algebra R S] {z : S} (hz : IsAlgebraic R z)
    (inj : ∀ x, algebraMap R S x = 0 → x = 0) :
    ∃ᵉ (x : integralClosure R S) (y ≠ (0 : R)), z * algebraMap R S y = x

(inj : ∀ (x : R), (algebraMap R S) x = 0 → x = 0)

∃ x y, y ≠ 0 ∧ z * (algebraMap R S) y = ↑x


/-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Monad C}
(self : T.Algebra)

CategoryTheory.CategoryStruct.comp (T.η.app self.A) self.a = CategoryTheory.CategoryStruct.id self.A


@[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}

ProbabilityTheory.mgf 0 μ t = (μ Set.univ).toReal


theorem singleton_sups_singleton : ({a} ⊻ {b} : Set α) = {a ⊔ b}

{α : Type u_2}
[SemilatticeSup α]
{a b : α}


theorem cos_sub : cos (x - y) = cos x * cos y + sin x * sin y

Real.cos (x - y) = Real.cos x * Real.cos y + Real.sin x * Real.sin y


theorem condexpL1_of_aestronglyMeasurable' (hfm : AEStronglyMeasurable' m f μ)
    (hfi : Integrable f μ) : condexpL1 hm μ f =ᵐ[μ] f

(hfm : MeasureTheory.AEStronglyMeasurable' m f μ)

↑↑(MeasureTheory.condexpL1 hm μ f) =ᵐ[μ] f


@[ext]
lemma hom_ext {β : Type*} {X Y : GradedObject β C} (f g : X ⟶ Y) (h : ∀ x, f x = g x) : f = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type u_1}
{X Y : CategoryTheory.GradedObject β C}
(f g : X ⟶ Y)
(h : ∀ (x : β), f x = g x)


theorem preimage_subset {α β} (e : α ≃ β) (s t : Set β) : e ⁻¹' s ⊆ e ⁻¹' t ↔ s ⊆ t

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

⇑e ⁻¹' s ⊆ ⇑e ⁻¹' t ↔ s ⊆ t


theorem exists_mem_Ico_zpow {x y : ℝ≥0∞} (hx : x ≠ 0) (h'x : x ≠ ∞) (hy : 1 < y) (h'y : y ≠ ⊤) :
    ∃ n : ℤ, x ∈ Ico (y ^ n) (y ^ (n + 1))

{x y : ENNReal}
(hx : x ≠ 0)
(h'x : x ≠ ⊤)
(hy : 1 < y)
(h'y : y ≠ ⊤)


@[to_additive (attr := simp)]
theorem inv_preimage : Inv.inv ⁻¹' s = s⁻¹


@[simp]
theorem hadamard_apply [Mul α] (A : Matrix m n α) (B : Matrix m n α) (i j) :
    hadamard A B i j = A i j * B i j

{α : Type u_1}
{m : Type u_4}
{n : Type u_5}
[Mul α]
(A B : Matrix m n α)
(i : m)
(j : n)


@[deprecated _root_.map_sum (since := "2023-09-16")]
protected theorem map_sum {ι : Type*} (f : M₁ →SL[σ₁₂] M₂) (s : Finset ι) (g : ι → M₁) :
    f (∑ i ∈ s, g i) = ∑ i ∈ s, f (g i)

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
{ι : Type u_9}
(f : M₁ →SL[σ₁₂] M₂)
(s : Finset ι)
(g : ι → M₁)


theorem insert_eq_insertWith [@DecidableRel α (· ≤ ·)] (x : α) :
    ∀ t, Ordnode.insert x t = insertWith (fun _ => x) x t

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x ≤ x_1]
(x : α)
(t : Ordnode α)

Ordnode.insert x t = Ordnode.insertWith (fun x_1 => x) x t


theorem isGLB_Ioc {a b : γ} (hab : a < b) : IsGLB (Ioc a b) a

{γ : Type w}
[SemilatticeSup γ]
[DenselyOrdered γ]
{a b : γ}
(hab : a < b)


@[to_additive]
theorem union_mul_inter_subset_union : (s₁ ∪ s₂) * (t₁ ∩ t₂) ⊆ s₁ * t₁ ∪ s₂ * t₂

{α : Type u_2}
[Mul α]
{s₁ s₂ t₁ t₂ : Set α}


theorem const_injective [Nonempty α] : Injective (const α : β → α → β)

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]


theorem toSubsemiring_inj {S U : Subalgebra R A} : S.toSubsemiring = U.toSubsemiring ↔ S = U

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


theorem adjoin_eq_starClosure_adjoin (s : Set A) : adjoin R s = (Algebra.adjoin R s).starClosure

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

StarAlgebra.adjoin R s = (Algebra.adjoin R s).starClosure


@[to_additive]
theorem div_iInter_subset (s : Set α) (t : ι → Set α) : (s / ⋂ i, t i) ⊆ ⋂ i, s / t i

{α : Type u_2}
{ι : Sort u_5}
[Sub α]
(s : Set α)
(t : ι → Set α)


theorem coe_sup_of_nonempty {s : Finset β} (h : s.Nonempty) (f : β → α) :
    (↑(s.sup f) : WithBot α) = s.sup ((↑) ∘ f)

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
(h : s.Nonempty)
(f : β → α)


@[to_additive (attr := simp 1100)]
theorem singleton_div_closedBall : {x} / closedBall y δ = closedBall (x / y) δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x y : E)

{x} / Metric.closedBall y δ = Metric.closedBall (x / y) δ


theorem map_mul_algebraMap (f : A →ₗ[R] B) (a : A) (r : R) :
    f (a * algebraMap R A r) = f a * algebraMap R B r

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₗ[R] B)
(a : A)
(r : R)

f (a * (algebraMap R A) r) = f a * (algebraMap R B) r


protected theorem hasSum_inner_mul_inner (b : HilbertBasis ι 𝕜 E) (x y : E) :
    HasSum (fun i => ⟪x, b i⟫ * ⟪b i, y⟫) ⟪x, y⟫

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

HasSum (fun i => ⟪x, (fun i => b.repr.symm (lp.single 2 i 1)) i⟫_𝕜 * ⟪(fun i => b.repr.symm (lp.single 2 i 1)) i, y⟫_𝕜)
  ⟪x, y⟫_𝕜


theorem pow_log_le_add_one (b : ℕ) : ∀ x, b ^ log b x ≤ x + 1


theorem prod_norm_eq_of_nat [Norm α] [Norm β] (n : ℕ) (h : p = n) (f : WithLp p (α × β)) :
    ‖f‖ = (‖f.fst‖ ^ n + ‖f.snd‖ ^ n) ^ (1 / (n : ℝ))

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[hp : Fact (1 ≤ p)]
[Norm α]
[Norm β]
(n : ℕ)
(h : p = ↑n)
(f : WithLp p (α × β))


theorem surjOn_iff_exists_bijOn_subset : SurjOn f s t ↔ ∃ s' ⊆ s, BijOn f s' t

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

Set.SurjOn f s t ↔ ∃ s' ⊆ s, Set.BijOn f s' t


theorem det_invOf [Invertible A] [Invertible A.det] : (⅟ A).det = ⅟ A.det

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


/-- The region between two measurable functions on a measurable set is measurable;
a version for the region together with the graph of the lower function. -/
theorem measurableSet_region_between_co (hf : Measurable f) (hg : Measurable g)
    (hs : MeasurableSet s) :
    MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ico (f p.fst) (g p.fst) }

{α : Type u_1}
[MeasurableSpace α]
{f g : α → ℝ}
{s : Set α}
(hf : Measurable f)
(hg : Measurable g)
(hs : MeasurableSet s)

MeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Set.Ico (f p.1) (g p.1)}


lemma zero_mem_smul_iff :
    (0 : β) ∈ s • t ↔ (0 : α) ∈ s ∧ t.Nonempty ∨ (0 : β) ∈ t ∧ s.Nonempty

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
[DecidableEq β]
{s : Finset α}
{t : Finset β}
[NoZeroSMulDivisors α β]

0 ∈ s • t ↔ 0 ∈ s ∧ t.Nonempty ∨ 0 ∈ t ∧ s.Nonempty


@[simp] theorem infix_append' (l₁ l₂ l₃ : List α) : l₂ <:+: l₁ ++ (l₂ ++ l₃)


@[to_additive]
theorem image_mulSingle_Ioc_left (i : ι) (a : α i) :
    Pi.mulSingle i '' Ioc a 1 = Ioc (Pi.mulSingle i a) 1

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → One (α i)]
(i : ι)
(a : α i)

Pi.mulSingle i '' Set.Ioc a 1 = Set.Ioc (Pi.mulSingle i a) 1


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.div' [MeasurableDiv₂ G] (hf : Measurable f) (hg : Measurable g) :
    Measurable (f / g)

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f g : α → G}
[MeasurableSub₂ G]
(hf : Measurable f)
(hg : Measurable g)


@[simp]
theorem model_nonemptyTheory_iff : M ⊨ L.nonemptyTheory ↔ Nonempty M

(L : FirstOrder.Language)
{M : Type w}
[L.Structure M]


@[reassoc]
theorem δ_comp_δ' {n} {i : Fin (n + 2)} {j : Fin (n + 3)} (H : Fin.castSucc i < j) :
    X.δ j ≫ X.δ i =
      X.δ (Fin.castSucc i) ≫
        X.δ (j.pred fun (hj : j = 0) => by simp [hj, Fin.not_lt_zero] at H)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 2)}
{j : Fin (n + 3)}
(H : i.castSucc < j)

X.δ j ≫ X.δ i = X.δ i.castSucc ≫ X.δ (j.pred ⋯)


theorem log_nat_eq_sum_factorization (n : ℕ) :
    log n = n.factorization.sum fun p t => t * log p

Real.log ↑n = n.factorization.sum fun p t => ↑t * Real.log ↑p


theorem single_zero_mul_coeff [NonUnitalNonAssocSemiring R] {r : R} {x : HahnSeries Γ R} {a : Γ} :
    ((single 0 r : HahnSeries Γ R) * x).coeff a = r * x.coeff a

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonUnitalNonAssocSemiring R]
{r : R}
{x : HahnSeries Γ R}
{a : Γ}

((HahnSeries.single 0) r * x).coeff a = r * x.coeff a


lemma dvd_nsmul_of_dvd [NonUnitalSemiring R] {x y : R} (n : ℕ) (h : x ∣ y) : x ∣ n • y

{R : Type u_1}
[NonUnitalSemiring R]
{x y : R}
(n : ℕ)
(h : x ∣ y)


@[simp]
theorem normalize_apply (a : α) : (normalize f hf0 hf) a = f a * (∑' x, f x)⁻¹

{α : Type u_1}
{f : α → ENNReal}
(hf0 : tsum f ≠ 0)
(hf : tsum f ≠ ⊤)
(a : α)

(PMF.normalize f hf0 hf) a = f a * (∑' (x : α), f x)⁻¹


/-- The explicit fan of a family of topological spaces given by the pi type. -/
@[simps! pt π_app]
def piFan {ι : Type v} (α : ι → TopCat.{max v u}) : Fan α

(TopCat.piFan α).pt = TopCat.of ((i : ι) → ↑(α i))


theorem nodup_toList (s : Finset α) : s.toList.Nodup


theorem min'_lt_max' {i j} (H1 : i ∈ s) (H2 : j ∈ s) (H3 : i ≠ j) :
    s.min' ⟨i, H1⟩ < s.max' ⟨i, H1⟩

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
{i j : α}
(H1 : i ∈ s)
(H2 : j ∈ s)
(H3 : i ≠ j)


@[reassoc (attr := simp)]
lemma liftCochain_v_fst_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + n = p₂) (h₂₃ : p₂ + 1 = p₃) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (fst φ).1.v p₂ p₃ h₂₃ = α.v p₁ p₃ (by omega)

(α : CochainComplex.HomComplex.Cochain K F m)

(β : CochainComplex.HomComplex.Cochain K G n)

(CochainComplex.mappingCone.liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (↑(CochainComplex.mappingCone.fst φ)).v p₂ p₃ h₂₃ =
  α.v p₁ p₃ ⋯


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]
(z : K)

RCLike.im ((starRingEnd K) z) = -RCLike.im z


@[simp]
theorem symm_trans_self (e : M ≃ₗ⁅R,L⁆ N) : e.symm.trans e = refl

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e : M ≃ₗ⁅R,L⁆ N)


@[simp]
theorem inf_apply (a : α) : (f ⊓ g) a = f a ⊓ g a

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


theorem isCoprime_biInf {J : ι → Ideal R} {s : Finset ι}
    (hf : ∀ j ∈ s, IsCoprime I (J j)) : IsCoprime I (⨅ j ∈ s, J j)

{R : Type u}
{ι : Type u_1}
[CommSemiring R]
{I : Ideal R}
{J : ι → Ideal R}
{s : Finset ι}
(hf : ∀ j ∈ s, IsCoprime I (J j))


@[simp]
theorem volume_interval {a b : ℝ} : volume (uIcc a b) = ofReal |b - a|

MeasureTheory.volume (Set.uIcc a b) = ENNReal.ofReal |b - a|


/-- A version of `Cocones.ext` for `Cofan`s. -/
@[simps!]
def Cofan.ext {f : β → C} {c₁ c₂ : Cofan f} (e : c₁.pt ≅ c₂.pt)
    (w : ∀ (b : β), c₁.inj b ≫ e.hom = c₂.inj b := by aesop_cat) : c₁ ≅ c₂

(CategoryTheory.Limits.Cofan.ext e w).inv.hom = e.inv


theorem inits_tail (s : Stream' α) : inits (tail s) = initsCore [head (tail s)] (tail (tail s))

s.tail.inits = Stream'.initsCore [s.tail.head] s.tail.tail


theorem zero_mem_nonunits [Semiring α] : 0 ∈ nonunits α ↔ (0 : α) ≠ 1


@[nolint unusedHavesSuffices] -- false positive from unfolding String.revFindAux
theorem revFindAux_of_valid (p) : ∀ l r,
    revFindAux ⟨l.reverse ++ r⟩ p ⟨utf8Len l⟩ = (l.dropWhile (!p ·)).tail?.map (⟨utf8Len ·⟩)

{ data := l.reverse ++ r }.revFindAux p { byteIdx := String.utf8Len l } =
  Option.map (fun x => { byteIdx := String.utf8Len x }) (List.dropWhile (fun x => !p x) l).tail?


@[simp]
theorem deriv_cos' : deriv cos = fun x => -sin x


@[simp]
theorem head_cons (x : α) (u : Fin m → α) : vecHead (vecCons x u) = x

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m → α)


@[simp]
theorem leadingCoeff_mul_X_pow {p : R[X]} {n : ℕ} : leadingCoeff (p * X ^ n) = leadingCoeff p

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}

(p * Polynomial.X ^ n).leadingCoeff = p.leadingCoeff


theorem surjOn_sin : SurjOn sin (Icc (-(π / 2)) (π / 2)) (Icc (-1) 1)

Set.SurjOn Real.sin (Set.Icc (-(Real.pi / 2)) (Real.pi / 2)) (Set.Icc (-1) 1)


@[simp]
theorem map_comp_obj (f : X ⟶ Y) (g : Y ⟶ Z) (U) :
    (map (f ≫ g)).obj U = (map f).obj ((map g).obj U)

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(U : TopologicalSpace.Opens ↑Z)

(TopologicalSpace.Opens.map (f ≫ g)).obj U = (TopologicalSpace.Opens.map f).obj ((TopologicalSpace.Opens.map g).obj U)


theorem isOpen_sum_iff {s : Set (X ⊕ Y)} : IsOpen s ↔ IsOpen (inl ⁻¹' s) ∧ IsOpen (inr ⁻¹' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set (X ⊕ Y)}

IsOpen s ↔ IsOpen (Sum.inl ⁻¹' s) ∧ IsOpen (Sum.inr ⁻¹' s)


@[simp]
theorem encode_none [Encodable α] : encode (@none α) = 0


@[to_additive mem_closedBall_iff_norm']
theorem mem_closedBall_iff_norm''' : b ∈ closedBall a r ↔ ‖a / b‖ ≤ r

{E : Type u_6}
[SeminormedAddGroup E]
{a b : E}
{r : ℝ}


/-- All n-simplices among cospherical points in n-space have the same
circumradius. -/
theorem exists_circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = n) (hc : Cospherical ps) :
    ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r

(hd : FiniteDimensional.finrank ℝ V = n)

∃ r, ∀ (sx : Affine.Simplex ℝ P n), Set.range sx.points ⊆ ps → sx.circumradius = r


@[to_additive]
protected theorem Specializes.pow {M : Type*} [Monoid M] [TopologicalSpace M] [ContinuousMul M]
    {a b : M} (h : a ⤳ b) (n : ℕ) : (a ^ n) ⤳ (b ^ n)

{M : Type u_6}
[Monoid M]
[TopologicalSpace M]
[ContinuousMul M]
{a b : M}
(h : a ⤳ b)
(n : ℕ)


lemma mono_binaryCofanSum_inr' [MonoCoprod C] (inr : c₂.pt ⟶ c.pt)
    (hinr : ∀ (i₂ : I₂), c₂.inj i₂ ≫ inr = c.inj (Sum.inr i₂)) :
    Mono inr

(c₁ : CategoryTheory.Limits.Cofan (X ∘ Sum.inl))

(c₂ : CategoryTheory.Limits.Cofan (X ∘ Sum.inr))

(hc : CategoryTheory.Limits.IsColimit c)

(hc₁ : CategoryTheory.Limits.IsColimit c₁)

(hc₂ : CategoryTheory.Limits.IsColimit c₂)


@[simp]
theorem _root_.Prod.snd_zmod_cast (a : ZMod n) : (cast a : R × S).snd = cast a

{n : ℕ}
{R : Type u_1}
[AddGroupWithOne R]
{S : Type u_2}
[AddGroupWithOne S]
(a : ZMod n)


/-- The function `x^n * exp(-x)` tends to `0` at `+∞`, for any natural number `n`. -/
theorem tendsto_pow_mul_exp_neg_atTop_nhds_zero (n : ℕ) :
    Tendsto (fun x => x ^ n * exp (-x)) atTop (𝓝 0)

Filter.Tendsto (fun x => x ^ n * Real.exp (-x)) Filter.atTop (𝓝 0)


/-- The isomorphism between `F.rightOp.leftOp` and `F`. -/
@[simps!]
def rightOpLeftOpIso (F : Cᵒᵖ ⥤ D) : F.rightOp.leftOp ≅ F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor Cᵒᵖ D)
(X : Cᵒᵖ)

F.rightOpLeftOpIso.inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[simp]
lemma colimitCoyonedaHomIsoLimit'_π_apply (f : colimit (D.op ⋙ coyoneda) ⟶ F) (i : I) :
    limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) i ((colimitCoyonedaHomIsoLimit' D F).hom f)
      = ⟨f.app (D.obj i) ((colimit.ι (D.op ⋙ coyoneda) ⟨i⟩).app (D.obj i) (𝟙 (D.obj i)))⟩

(F : CategoryTheory.Functor C (Type u₂))

[CategoryTheory.Limits.HasLimitsOfShape I (Type (max u₁ u₂))]

(f : CategoryTheory.Limits.colimit (D.op.comp CategoryTheory.coyoneda) ⟶ F)

CategoryTheory.Limits.limit.π (D.comp (F.comp CategoryTheory.uliftFunctor.{u₁, u₂})) i
    ((CategoryTheory.Limits.colimitCoyonedaHomIsoLimit' D F).hom f) =
  {
    down :=
      f.app (D.obj i)
        ((CategoryTheory.Limits.colimit.ι (D.op.comp CategoryTheory.coyoneda) (Opposite.op i)).app (D.obj i)
          (CategoryTheory.CategoryStruct.id (D.obj i))) }


theorem Nonempty.zero_div (hs : s.Nonempty) : 0 / s = 0

{α : Type u_2}
[GroupWithZero α]
{s : Set α}
(hs : s.Nonempty)


@[to_additive (attr := simp)]
theorem mk'_mul_cancel_right (x : M) (y : S) : f.mk' (x * y) y = f.toMap x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)


theorem constants_mem (c : L.Constants) : (c : M) ∈ S

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{S : L.Substructure M}
(c : L.Constants)


theorem toHomeomorph_injective : Function.Injective (toHomeomorph : (E ≃ₛₗᵢ[σ₁₂] E₂) → E ≃ₜ E₂)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]


theorem mul_le_mul_right (h : N ≤ P) : M * N ≤ M * P

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{M N P : Submodule R A}
(h : N ≤ P)


theorem QuasilinearOn.dual : QuasilinearOn 𝕜 s f → QuasilinearOn 𝕜 s (toDual ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LE β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}

QuasilinearOn 𝕜 s f → QuasilinearOn 𝕜 s (⇑OrderDual.toDual ∘ f)


theorem exists_finset_toPOUFun_eventuallyEq (i : ι) (x : X) : ∃ t : Finset ι,
    f.toPOUFun i =ᶠ[𝓝 x] f i * ∏ j ∈ t.filter fun j => WellOrderingRel j i, (1 - f j)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(i : ι)
(x : X)

∃ t, f.toPOUFun i =ᶠ[𝓝 x] ⇑(f i) * ⇑(∏ j ∈ Finset.filter (fun j => WellOrderingRel j i) t, (1 - f j))


@[ext]
theorem ext {f g : A ≃⋆+* B} (h : ∀ a, f a = g a) : f = g

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
{f g : A ≃⋆+* B}
(h : ∀ (a : A), f a = g a)


theorem valuation_le_iff_coeff_lt_eq_zero {D : ℤ} {f : LaurentSeries K} :
    Valued.v f ≤ ↑(Multiplicative.ofAdd (-D : ℤ)) ↔ ∀ n : ℤ, n < D → f.coeff n = 0

(K : Type u_2)
[Field K]
{D : ℤ}
{f : LaurentSeries K}

Valued.v f ≤ ↑(Multiplicative.ofAdd (-D)) ↔ ∀ n < D, f.coeff n = 0


@[to_additive]
theorem le_map_add_map_div' : f x ≤ f y + f (y / x)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[OrderedAddCommMonoid β]
[GroupSeminormClass F α β]
(f : F)
(x y : α)


theorem Filter.EventuallyEq.mdifferentiableWithinAt_iff (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    MDifferentiableWithinAt I I' f s x ↔ MDifferentiableWithinAt I I' f₁ s 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]
{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 f₁ : M → M'}
{x : M}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


lemma card_le_card_of_injective {α : Type u} {β : Type v} [Finite β] (f : α → β)
    (hf : Injective f) : Nat.card α ≤ Nat.card β

{α : Type u}
{β : Type v}
[Finite β]
(f : α → β)
(hf : Function.Injective f)


/-- Equal sets are equivalent.

TODO: this is the same as `Equiv.setCongr`! -/
@[simps! apply symm_apply]
protected def ofEq {α : Type u} {s t : Set α} (h : s = t) : s ≃ t

{α : Type u}
{s t : Set α}
(h : s = t)
(b : { b // (fun x => x ∈ t) b })


theorem mem_map_iff (b : β) (v : Vector α n) (f : α → β) :
    b ∈ (v.map f).toList ↔ ∃ a : α, a ∈ v.toList ∧ f a = b

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
(b : β)
(v : Mathlib.Vector α n)
(f : α → β)

b ∈ (Mathlib.Vector.map f v).toList ↔ ∃ a ∈ v.toList, f a = b


/-- Converse to the mean value inequality: if `f` is `C`-lipschitz then
its line derivative at `x₀` in the direction `v` has norm bounded by `C * ‖v‖`.
Version using `lineDeriv`. -/
theorem norm_lineDeriv_le_of_lipschitz {f : E → F} {x₀ : E}
    {C : ℝ≥0} (hlip : LipschitzWith C f) : ‖lineDeriv 𝕜 f x₀ v‖ ≤ C * ‖v‖

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{v : E}
{f : E → F}
{x₀ : E}
{C : ℝ≥0}
(hlip : LipschitzWith C f)


theorem subset_insert_diff_singleton (x : α) (s : Set α) : s ⊆ insert x (s \ {x})


@[to_additive (attr := simp)]
theorem preimage_smul_closedBall (c : G) (x : X) (r : ℝ≥0∞) :
    (c • ·) ⁻¹' closedBall x r = closedBall (c⁻¹ • x) r

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ≥0∞)

(fun x => c +ᵥ x) ⁻¹' EMetric.closedBall x r = EMetric.closedBall (-c +ᵥ x) r


@[to_additive]
theorem map_iInf_comap_of_surjective (S : ι → Subsemigroup N) :
    (⨅ i, (S i).comap f).map f = iInf S

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{ι : Type u_5}
{f : AddHom M N}
(hf : Function.Surjective ⇑f)
(S : ι → AddSubsemigroup N)

AddSubsemigroup.map f (⨅ i, AddSubsemigroup.comap f (S i)) = iInf S


/-- The bijection `(Z ⟶ X) ≃ (Z ⟶ Y)` induced by `α : X ≅ Y`. -/
@[simps]
def homToEquiv (α : X ≅ Y) {Z : C} : (Z ⟶ X) ≃ (Z ⟶ Y)

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

α.homToEquiv f = CategoryTheory.CategoryStruct.comp f α.hom


@[simp, norm_cast] theorem ofNat_ediv (m n : Nat) : (↑(m / n) : Int) = ↑m / ↑n


theorem Γ_map_op {X Y : PresheafedSpace C} (f : X ⟶ Y) : Γ.map f.op = f.c.app (op ⊤)

{X Y : AlgebraicGeometry.PresheafedSpace C}

AlgebraicGeometry.PresheafedSpace.Γ.map f.op = f.c.app (Opposite.op ⊤)


@[to_additive Left.pow_neg]
theorem Left.pow_lt_one_of_lt [CovariantClass M M (· * ·) (· < ·)] {n : ℕ} {x : M} (hn : 0 < n)
    (h : x < 1) : x ^ n < 1

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


theorem upperBounds_Iio {a : γ} : upperBounds (Iio a) = Ici a

{γ : Type w}
[LinearOrder γ]
[DenselyOrdered γ]
{a : γ}


theorem natCast_ofNat {x : Nat} :
    @Nat.cast Int instNatCastInt (no_index (OfNat.ofNat x)) = OfNat.ofNat x


@[to_additive]
theorem subset_interior_smul : interior s • interior t ⊆ interior (s • t)

{α : Type u}
{β : Type v}
[TopologicalSpace β]
[Group α]
[MulAction α β]
[ContinuousConstSMul α β]
{s : Set α}
{t : Set β}
[TopologicalSpace α]


@[to_additive (attr := simp)]
theorem prod_inv_distrib : (∏ x ∈ s, (f x)⁻¹) = (∏ x ∈ s, f x)⁻¹

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[SubtractionCommMonoid β]


/-- The determinant of `f.symm` is the inverse of that of `f` when `f` is a linear equiv. -/
theorem LinearEquiv.det_coe_symm {𝕜 : Type*} [Field 𝕜] [Module 𝕜 M] (f : M ≃ₗ[𝕜] M) :
    LinearMap.det (f.symm : M →ₗ[𝕜] M) = (LinearMap.det (f : M →ₗ[𝕜] M))⁻¹

{M : Type u_2}
[AddCommGroup M]
{𝕜 : Type u_5}
[Field 𝕜]
[Module 𝕜 M]
(f : M ≃ₗ[𝕜] M)

LinearMap.det ↑f.symm = (LinearMap.det ↑f)⁻¹


@[simp]
theorem Quotient.out_eq [s : Setoid α] (q : Quotient s) : ⟦q.out⟧ = q

{α : Sort u_1}
[s : Setoid α]
(q : Quotient s)


@[to_additive (attr := gcongr)]
lemma zpow_lt_zpow (ha : 1 < a) (h : m < n) : a ^ m < a ^ n

{α : Type u_1}
[OrderedCommGroup α]
{m n : ℤ}
{a : α}
(ha : 1 < a)
(h : m < n)


{α : Type u}
[SemilatticeSup α]
[OrderBot α]
(a : α)


theorem empty_not_base [h : RkPos M] : ¬M.Base ∅

{α : Type u_1}
{M : Matroid α}
[h : M.RkPos]


@[simp] theorem iff_self_and : ∀(a b : Bool), (a = (a && b)) ↔ (a → b)


/-- This lemma characterizes the transition functions of an open subset in terms of the transition
functions of the original space. -/
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph X Y) :
    (f.subtypeRestr hs).symm.trans (f'.subtypeRestr hs) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : TopologicalSpace.Opens X}
(hs : Nonempty ↥s)
(f f' : PartialHomeomorph X Y)

(f.subtypeRestr hs).symm.trans (f'.subtypeRestr hs) ≈ (f.symm.trans f').restr (f.target ∩ ↑f.symm ⁻¹' ↑s)


@[simp]
lemma smul_lt_smul_iff_of_pos_left [PosSMulStrictMono α β] [PosSMulReflectLT α β] (ha : 0 < a) :
    a • b₁ < a • b₂ ↔ b₁ < b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulStrictMono α β]
[PosSMulReflectLT α β]
(ha : 0 < a)


lemma Preadditive.epi_iff_surjective' {X Y : C} (f : X ⟶ Y) :
    Epi f ↔ Function.Surjective ((forget C).map f)

CategoryTheory.Epi f ↔ Function.Surjective ((CategoryTheory.forget C).map f)


@[to_additive]
theorem unop_sup (S₁ S₂ : Submonoid Mᵐᵒᵖ) : (S₁ ⊔ S₂).unop = S₁.unop ⊔ S₂.unop

{M : Type u_2}
[MulOneClass M]
(S₁ S₂ : Submonoid Mᵐᵒᵖ)