@[simp]
theorem map_one_eq_zero : D 1 = 0

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)


lemma Functor.essImage.counit_isIso [Coreflective j] {A : D} (h : A ∈ j.essImage) :
    IsIso ((coreflectorAdjunction j).counit.app A)

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{j : CategoryTheory.Functor C D}
[CategoryTheory.Coreflective j]
{A : D}
(h : A ∈ j.essImage)

CategoryTheory.IsIso ((CategoryTheory.coreflectorAdjunction j).counit.app A)


@[simp]
theorem polar_neg_right (x y : M) : polar Q x (-y) = -polar Q x y

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(x y : M)

QuadraticMap.polar (⇑Q) x (-y) = -QuadraticMap.polar (⇑Q) x y


@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
    (hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
    (p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv')

{V : Type u}
{G : SimpleGraph V}
{u v u' v' u'' v'' : V}
(p : G.Walk u v)
(hu : u = u')
(hv : v = v')
(hu' : u' = u'')
(hv' : v' = v'')

(p.copy hu hv).copy hu' hv' = p.copy ⋯ ⋯


theorem floor_le_ceil (a : α) : ⌊a⌋ ≤ ⌈a⌉

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


protected theorem convex : Convex 𝕜 (S : Set E)

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


lemma Indep.closure_inter_eq_self_of_subset (hI : M.Indep I) (hJI : J ⊆ I) :
    M.closure J ∩ I = J

{α : Type u_2}
{M : Matroid α}
{I J : Set α}
(hI : M.Indep I)
(hJI : J ⊆ I)


/-- The equivalence, given by swapping factors, between `C × D` and `D × C`.
-/
@[simps!]
def braiding : C × D ≌ D × C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₂)
[CategoryTheory.Category.{v₂, u₂} D]
(X : D × C)

(CategoryTheory.Prod.braiding C D).inverse.obj X = (X.2, X.1)


lemma Module.mem_support_iff_of_span_eq_top {s : Set M} (hs : Submodule.span R s = ⊤) :
    p ∈ Module.support R M ↔ ∃ m ∈ s, (R ∙ m).annihilator ≤ p.asIdeal

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{p : PrimeSpectrum R}
{s : Set M}
(hs : Submodule.span R s = ⊤)

p ∈ Module.support R M ↔ ∃ m ∈ s, (Submodule.span R {m}).annihilator ≤ p.asIdeal


@[simp]
theorem comap_id : I.comap (RingHom.id R) = I


@[simp] protected theorem ediv_neg : ∀ a b : Int, a / (-b) = -(a / b)


@[simp] theorem filterMap_nil (f : α → Option β) : filterMap f [] = []

{α : Type u}
{β : Type v}
(f : α → Option β)


theorem mem_periodicPts : x ∈ periodicPts f ↔ ∃ n > 0, IsPeriodicPt f n x

x ∈ Function.periodicPts f ↔ ∃ n > 0, Function.IsPeriodicPt f n x


@[to_additive (attr := simp) lt_add_iff_pos_right]
theorem lt_mul_iff_one_lt_right' [CovariantClass α α (· * ·) (· < ·)]
    [ContravariantClass α α (· * ·) (· < ·)] (a : α) {b : α} :
    a < a * b ↔ 1 < b

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


/-- Given a family of points `p : ι' → P` and an affine basis `b`, if the matrix whose rows are the
coordinates of `p` with respect `b` has a right inverse, then `p` is affine independent. -/
theorem affineIndependent_of_toMatrix_right_inv [Fintype ι] [Finite ι'] [DecidableEq ι']
    (p : ι' → P) {A : Matrix ι ι' k} (hA : b.toMatrix p * A = 1) : AffineIndependent k p

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
{ι' : Type u_1}
[Fintype ι]
[Finite ι']
[DecidableEq ι']
(p : ι' → P)
{A : Matrix ι ι' k}
(hA : b.toMatrix p * A = 1)


theorem iInf_eq_if {p : Prop} [Decidable p] (a : α) : ⨅ _ : p, a = if p then a else ⊤

{α : Type u_1}
[CompleteLattice α]
{p : Prop}
[Decidable p]
(a : α)


/-- The `tsub` version of `sub_sub_eq_add_sub`. -/
theorem tsub_tsub_eq_add_tsub_of_le [ContravariantClass α α HAdd.hAdd LE.le]
    (h : c ≤ b) : a - (b - c) = a + c - b

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


/-- `Fin.cons` is the same as appending a one-tuple to the left. -/
theorem cons_eq_append {α : Type*} (x : α) (xs : Fin n → α) :
    cons x xs = append (cons x Fin.elim0) xs ∘ Fin.cast (Nat.add_comm ..)

{n : ℕ}
{α : Type u_1}
(x : α)
(xs : Fin n → α)

Fin.cons x xs = Fin.append (Fin.cons x Fin.elim0) xs ∘ Fin.cast ⋯


@[to_additive (attr := simp)]
theorem smul_finset_eq_empty : a • s = ∅ ↔ s = ∅

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s : Finset β}
{a : α}


@[simp] theorem atLeastTwo_false_right : atLeastTwo a b false = (a && b)


protected theorem derivWithin (hs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin f s x = f.linear 1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(f : 𝕜 →ᵃ[𝕜] E)
{s : Set 𝕜}
{x : 𝕜}
(hs : UniqueDiffWithinAt 𝕜 s x)


@[reassoc]
theorem cofan_inj_epi_naturality {Δ₁ Δ₂ : SimplexCategoryᵒᵖ} (A : IndexSet Δ₁) (p : Δ₁ ⟶ Δ₂)
    [Epi p.unop] : (s.cofan Δ₁).inj A ≫ X.map p = (s.cofan Δ₂).inj (A.epiComp p)

(A : SimplicialObject.Splitting.IndexSet Δ₁)

(p : Δ₁ ⟶ Δ₂)


@[fun_prop]
theorem differentiableOn_inv' : DifferentiableOn 𝕜 (fun x : R => x⁻¹) {x | x ≠ 0}

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedDivisionRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]

DifferentiableOn 𝕜 (fun x => x⁻¹) {x | x ≠ 0}


/--
The Kuratowski embedding is an isometry.
Theorem 2.1 of [Assaf Naor, *Metric Embeddings and Lipschitz Extensions*][Naor-2015]. -/
protected theorem kuratowskiEmbedding.isometry (α : Type u) [MetricSpace α] [SeparableSpace α] :
    Isometry (kuratowskiEmbedding α)

(α : Type u)
[MetricSpace α]
[TopologicalSpace.SeparableSpace α]


@[simp]
theorem ppred_zero : ppred 0 = none


/-- A linear order is reflexive, transitive, antisymmetric and total relation `≤`.
We assume that every linear ordered type has decidable `(≤)`, `(<)`, and `(=)`. -/
class LinearOrder (α : Type u) extends PartialOrder α, Min α, Max α, Ord α :=
  /-- A linear order is total. -/
  le_total (a b : α) : a ≤ b ∨ b ≤ a
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLE : DecidableRel (· ≤ · : α → α → Prop)
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableEq : DecidableEq α := @decidableEqOfDecidableLE _ _ decidableLE
  /-- In a linearly ordered type, we assume the order relations are all decidable. -/
  decidableLT : DecidableRel (· < · : α → α → Prop) :=
    @decidableLTOfDecidableLE _ _ decidableLE
  min := fun a b => if a ≤ b then a else b
  max := fun a b => if a ≤ b then b else a
  /-- The minimum function is equivalent to the one you get from `minOfLe`. -/
  min_def : ∀ a b, min a b = if a ≤ b then a else b := by intros; rfl
  /-- The minimum function is equivalent to the one you get from `maxOfLe`. -/
  max_def : ∀ a b, max a b = if a ≤ b then b else a := by intros; rfl
  compare a b := compareOfLessAndEq a b
  /-- Comparison via `compare` is equal to the canonical comparison given decidable `<` and `=`. -/
  compare_eq_compareOfLessAndEq : ∀ a b, compare a b = compareOfLessAndEq a b := by
    compareOfLessAndEq_rfl

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


@[simp]
theorem sqrt_ofNat (n : ℕ) : Rat.sqrt (no_index (OfNat.ofNat n) : ℚ) = Nat.sqrt (OfNat.ofNat n)

Rat.sqrt (OfNat.ofNat n) = ↑(Nat.sqrt (OfNat.ofNat n))


@[simp]
theorem starClosure_toNonunitalSubalgebra {S : NonUnitalSubalgebra R A} :
    S.starClosure.toNonUnitalSubalgebra = S ⊔ star S

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S : NonUnitalSubalgebra R A}


theorem or_and_distrib_right : ∀ (x y z : Bool), (x && y || z) = ((x || z) && (y || z))


theorem isLUB_pi {s : Set (∀ a, π a)} {f : ∀ a, π a} :
    IsLUB s f ↔ ∀ a, IsLUB (Function.eval a '' s) (f a)

{α : Type u}
{π : α → Type u_1}
[(a : α) → Preorder (π a)]
{s : Set ((a : α) → π a)}
{f : (a : α) → π a}

IsLUB s f ↔ ∀ (a : α), IsLUB (Function.eval a '' s) (f a)


theorem tendsto_comap'_iff {m : α → β} {f : Filter α} {g : Filter β} {i : γ → α} (h : range i ∈ f) :
    Tendsto (m ∘ i) (comap i f) g ↔ Tendsto m f g

{α : Type u}
{β : Type v}
{γ : Type w}
{m : α → β}
{f : Filter α}
{g : Filter β}
{i : γ → α}
(h : Set.range i ∈ f)

Filter.Tendsto (m ∘ i) (Filter.comap i f) g ↔ Filter.Tendsto m f g


theorem cos_surjective : Function.Surjective cos


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

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

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


@[to_additive]
theorem lintegral_lintegral_mul_inv [IsMulLeftInvariant ν] (f : G → G → ℝ≥0∞)
    (hf : AEMeasurable (uncurry f) (μ.prod ν)) :
    (∫⁻ x, ∫⁻ y, f (y * x) x⁻¹ ∂ν ∂μ) = ∫⁻ x, ∫⁻ y, f x y ∂ν ∂μ

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

∫⁻ (x : G), ∫⁻ (y : G), f (y + x) (-x) ∂ν ∂μ = ∫⁻ (x : G), ∫⁻ (y : G), f x y ∂ν ∂μ


lemma rank_le_natTrailingDegree_charpoly_ad :
    rank R L M ≤ (toEnd R L M x).charpoly.natTrailingDegree

(R : Type u_1)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
(x : L)

LieModule.rank R L M ≤ (LinearMap.charpoly ((LieModule.toEnd R L M) x)).natTrailingDegree


/-- Type class for manifold without boundary. This differs from `ModelWithCorners.Boundaryless`,
  which states that the `ModelWithCorners` maps to the whole model vector space. -/
class _root_.BoundarylessManifold {𝕜 : Type*} [NontriviallyNormedField 𝕜]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
    {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H)
    (M : Type*) [TopologicalSpace M] [ChartedSpace H M] : Prop where
  isInteriorPoint' : ∀ x : M, IsInteriorPoint I x

{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
{E : Type u_6}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_7}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H M]
[self : BoundarylessManifold I M]
(x : M)


theorem eq_top_iff_not_finite {a b : α} : multiplicity a b = ⊤ ↔ ¬Finite a b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}

multiplicity a b = ⊤ ↔ ¬multiplicity.Finite a b


@[simp] theorem or_append {x₁ x₂ : BitVec w} {y₁ y₂ : BitVec v} :
    (x₁ ++ y₁) ||| (x₂ ++ y₂) = (x₁ ||| x₂) ++ (y₁ ||| y₂)

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


/-- A function is `C^∞` on a domain with unique derivatives if and only if it is differentiable
there, and its derivative (expressed with `fderivWithin`) is `C^∞`. -/
theorem contDiffOn_top_iff_fderivWithin (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 ∞ f s ↔
      DifferentiableOn 𝕜 f s ∧ ContDiffOn 𝕜 ∞ (fun y => fderivWithin 𝕜 f s y) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 ⊤ f s ↔ DifferentiableOn 𝕜 f s ∧ ContDiffOn 𝕜 ⊤ (fun y => fderivWithin 𝕜 f s y) s


@[to_additive]
nonrec theorem QuotientGroup.measurable_from_quotient {G} [Group G] [MeasurableSpace G]
    {S : Subgroup G} {f : G ⧸ S → α} : Measurable f ↔ Measurable (f ∘ ((↑) : G → G ⧸ S))

{α : Type u_1}
[MeasurableSpace α]
{G : Type u_6}
[AddGroup G]
[MeasurableSpace G]
{S : AddSubgroup G}
{f : G ⧸ S → α}

Measurable f ↔ Measurable (f ∘ QuotientAddGroup.mk)


private lemma neg_hom' (α : Ext X Y n) : (-α).hom' = -α.hom'

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


theorem continuousAt_ofReal_cpow_const (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) :
    ContinuousAt (fun a => (a : ℂ) ^ y : ℝ → ℂ) x


/-- A structure that has zero and pow is reduced if it has no nonzero nilpotent elements. -/
@[mk_iff]
class IsReduced (R : Type*) [Zero R] [Pow R ℕ] : Prop where
  /-- A reduced structure has no nonzero nilpotent elements. -/
  eq_zero : ∀ x : R, IsNilpotent x → x = 0

{R : Type u_3}
[Zero R]
[Pow R ℕ]
[self : IsReduced R]
(x : R)


/-- Engel's theorem.

See also `LieModule.isNilpotent_iff_forall'` which assumes that `M` is Noetherian instead of `L`. -/
theorem LieModule.isNilpotent_iff_forall [IsNoetherian R L] :
    LieModule.IsNilpotent R L M ↔ ∀ x, _root_.IsNilpotent <| toEnd R L M x

{R : Type u₁}
{L : Type u₂}
{M : Type u₄}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R L]

LieModule.IsNilpotent R L M ↔ ∀ (x : L), IsNilpotent ((LieModule.toEnd R L M) x)


theorem coe_ne_zero {x : Icc (0 : α) 1} : (x : α) ≠ 0 ↔ x ≠ 0

{α : Type u_1}
[OrderedSemiring α]
{x : ↑(Set.Icc 0 1)}

↑x ≠ 0 ↔ x ≠ 0


@[to_additive]
theorem smul_mem_smul : a ∈ s → b ∈ t → a • b ∈ s • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
{t : Finset β}
{a : α}
{b : β}


/-- A continuous function is bounded below on a compact set. -/
theorem IsCompact.bddBelow_image [ClosedIicTopology α] [Nonempty α] {f : β → α} {K : Set β}
    (hK : IsCompact K) (hf : ContinuousOn f K) : BddBelow (f '' K)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
[Nonempty α]
{f : β → α}
{K : Set β}
(hK : IsCompact K)
(hf : ContinuousOn f K)


theorem chainHeight_eq_top_iff : s.chainHeight = ⊤ ↔ ∀ n, ∃ l ∈ s.subchain, length l = n

s.chainHeight = ⊤ ↔ ∀ (n : ℕ), ∃ l ∈ s.subchain, l.length = n


@[simp]
theorem coe_toFinset (o : Part α) [Decidable o.Dom] : (o.toFinset : Set α) = { x | x ∈ o }

{α : Type u_1}
(o : Part α)
[Decidable o.Dom]


@[simp]
theorem weightedVSubVSubWeights_apply_left [DecidableEq ι] {i j : ι} (h : i ≠ j) :
    weightedVSubVSubWeights k i j i = 1

(k : Type u_1)
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
{i j : ι}
(h : i ≠ j)

Finset.weightedVSubVSubWeights k i j i = 1


theorem monomial_natDegree_leadingCoeff_eq_self (h : p.support.card ≤ 1) :
    monomial p.natDegree p.leadingCoeff = p

{R : Type u}
[Semiring R]
{p : R[X]}
(h : p.support.card ≤ 1)

(Polynomial.monomial p.natDegree) p.leadingCoeff = p


@[to_additive]
theorem iUnion_div_right_image : ⋃ a ∈ t, (· / a) '' s = s / t


@[to_additive]
lemma mulSupport_iSup [ConditionallyCompleteLattice M] [Nonempty ι] (f : ι → α → M) :
    mulSupport (fun x ↦ ⨆ i, f i x) ⊆ ⋃ i, mulSupport (f i)

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[One M]
[ConditionallyCompleteLattice M]
[Nonempty ι]
(f : ι → α → M)

(Function.mulSupport fun x => ⨆ i, f i x) ⊆ ⋃ i, Function.mulSupport (f i)


theorem irrational_sqrt_ofNat_iff {n : ℕ} [n.AtLeastTwo] :
    Irrational (√(no_index (OfNat.ofNat n))) ↔ ¬IsSquare (OfNat.ofNat n)

Irrational √(OfNat.ofNat n) ↔ ¬IsSquare (OfNat.ofNat n)


theorem eq_of_eqOnSource_univ {e e' : PartialHomeomorph X Y} (h : e ≈ e') (s : e.source = univ)
    (t : e.target = univ) : e = e'

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e e' : PartialHomeomorph X Y}
(h : e ≈ e')
(s : e.source = Set.univ)
(t : e.target = Set.univ)


@[simp, rclike_simps]
theorem ofNat_re (n : ℕ) [n.AtLeastTwo] : re (no_index (OfNat.ofNat n) : K) = OfNat.ofNat n

{K : Type u_1}
[RCLike K]
(n : ℕ)
[n.AtLeastTwo]

RCLike.re (OfNat.ofNat n) = OfNat.ofNat n


lemma LieModule.nontrivial_of_isIrreducible [LieModule.IsIrreducible R L M] : Nontrivial M

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule.IsIrreducible R L M]


theorem fin_succ {n} : Primrec (@Fin.succ n)


lemma ShortExact.surjective_g (hS : S.ShortExact) :
    Function.Surjective ((forget₂ C Ab).map S.g)

Function.Surjective ⇑((CategoryTheory.forget₂ C Ab).map S.g)


@[simp]
theorem toIdeal_sInf (ℐ : Set (HomogeneousIdeal 𝒜)) : (sInf ℐ).toIdeal = ⨅ s ∈ ℐ, toIdeal s

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
(ℐ : Set (HomogeneousIdeal 𝒜))


@[simp]
theorem abs_arg_lt_pi_div_two_iff {z : ℂ} : |arg z| < π / 2 ↔ 0 < re z ∨ z = 0


@[to_additive]
theorem orderOf_dvd_iff_pow_eq_one {n : ℕ} : orderOf x ∣ n ↔ x ^ n = 1

{G : Type u_1}
[Monoid G]
{x : G}
{n : ℕ}


theorem isRight_right (h : LiftRel r s (inr b) y) : y.isRight

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{y : γ ⊕ δ}
{b : β}
(h : Sum.LiftRel r s (Sum.inr b) y)


theorem opow_le_of_limit {a b c : Ordinal} (a0 : a ≠ 0) (h : IsLimit b) :
    a ^ b ≤ c ↔ ∀ b' < b, a ^ b' ≤ c

{a b c : Ordinal.{u_1}}
(a0 : a ≠ 0)
(h : b.IsLimit)


/-- The supremum of a set of congruence relations is the same as the smallest congruence relation
    containing the supremum of the set's image under the map to the underlying binary relation. -/
@[to_additive "The supremum of a set of additive congruence relations is the same as the smallest
additive congruence relation containing the supremum of the set's image under the map to the
underlying binary relation."]
theorem sSup_def {S : Set (Con M)} :
    sSup S = conGen (sSup ((⇑) '' S))

{M : Type u_1}
[Mul M]
{S : Set (Con M)}

sSup S = conGen (sSup (DFunLike.coe '' S))


/-- `UniqueProds G` says that for any two nonempty `Finset`s `A` and `B` in `G`, `A × B`
  contains a unique pair with the `UniqueMul` property. Strojnowski showed that if `G` is
  a group, then we only need to check this when `A = B`.
  Here we generalize the result to cancellative semigroups.
  Non-cancellative counterexample: the AddMonoid {0,1} with 1+1=1. -/
@[to_additive] theorem of_same {G} [Semigroup G] [IsCancelMul G]
    (h : ∀ {A : Finset G}, A.Nonempty → ∃ a1 ∈ A, ∃ a2 ∈ A, UniqueMul A A a1 a2) :
    UniqueProds G


theorem not_dvd_of_natDegree_lt (hp : Monic p) (h0 : q ≠ 0) (hl : natDegree q < natDegree p) :
    ¬p ∣ q

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p.Monic)
(h0 : q ≠ 0)
(hl : q.natDegree < p.natDegree)


theorem iUnion_eq_range_psigma (s : ι → Set β) : ⋃ i, s i = range fun a : Σ'i, s i => a.2

{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set β)


theorem extentClosure_swap (s : Set α) : extentClosure (swap r) s = intentClosure r s

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(s : Set α)

extentClosure (Function.swap r) s = intentClosure r s


theorem Icc_eq_filter_powerset : Icc s t = t.powerset.filter (s ⊆ ·)

{α : Type u_1}
[DecidableEq α]
(s t : Finset α)

Finset.Icc s t = Finset.filter (fun x => s ⊆ x) t.powerset


theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
    Invariant (κ ∘ₖ η) μ

{α : Type u_1}
{mα : MeasurableSpace α}
{κ η : ProbabilityTheory.Kernel α α}
{μ : MeasureTheory.Measure α}
[ProbabilityTheory.IsSFiniteKernel κ]
(hκ : κ.Invariant μ)
(hη : η.Invariant μ)


@[simp]
theorem nndist_right_lineMap (p₁ p₂ : P) (c : 𝕜) :
    nndist p₂ (lineMap p₁ p₂ c) = ‖1 - c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist p₂ ((AffineMap.lineMap p₁ p₂) c) = ‖1 - c‖₊ * nndist p₁ p₂


@[simp]
theorem length_asString (l : List Char) : l.asString.length = l.length


/-- Bijection between `α` and `PLift α` -/
theorem PLift.up_down {α : Sort u} (b : PLift α) : Eq (up (down b)) b


@[simp]
theorem coe_setPreimage (f : α → β) : ⇑(setPreimage f) = preimage f

{α : Type u_2}
{β : Type u_3}
(f : α → β)

⇑(CompleteLatticeHom.setPreimage f) = Set.preimage f


theorem fundamentalSequenceProp_inl_some (o a) :
    FundamentalSequenceProp o (Sum.inl (some a)) ↔ o.repr = succ a.repr ∧ (o.NF → a.NF)

o.FundamentalSequenceProp (Sum.inl (some a)) ↔ o.repr = Order.succ a.repr ∧ (o.NF → a.NF)


theorem Iio_mem_nhdsSet_Iic_iff : Iio b ∈ 𝓝ˢ (Iic a) ↔ a < b

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b : α}


/-- The type of closed subsets of a topological space. -/
structure Closeds (α : Type*) [TopologicalSpace α] where
  /-- the carrier set, i.e. the points in this set -/
  carrier : Set α
  closed' : IsClosed carrier

{α : Type u_4}
[TopologicalSpace α]
(self : TopologicalSpace.Closeds α)


theorem seq_pair_mem ⦃N m n : ℕ⦄ (hm : N ≤ m) (hn : N ≤ n) :
    (seq hf U_mem m, seq hf U_mem n) ∈ U N

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
(hf : Cauchy f)
{U : ℕ → Set (α × α)}
(U_mem : ∀ (n : ℕ), U n ∈ 𝓤 α)
⦃N m n : ℕ⦄
(hm : N ≤ m)
(hn : N ≤ n)

(SequentiallyComplete.seq hf U_mem m, SequentiallyComplete.seq hf U_mem n) ∈ U N


@[to_additive (attr := simp) toProd_add]
theorem toProd_mul : (s * t).toProd = s.toProd * t.toProd

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

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


lemma ConcaveOn.smul'' (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) (hf₀ : ∀ ⦃x⦄, x ∈ s → f x ≤ 0)
    (hg₀ : ∀ ⦃x⦄, x ∈ s → g x ≤ 0) (hfg : MonovaryOn f g s) : ConvexOn 𝕜 s (f • g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[LinearOrderedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[Module E F]
[IsScalarTower 𝕜 E F]
[SMulCommClass 𝕜 E F]
[OrderedSMul 𝕜 F]
[OrderedSMul E F]
{s : Set 𝕜}
{f : 𝕜 → E}
{g : 𝕜 → F}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → f x ≤ 0)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → g x ≤ 0)
(hfg : MonovaryOn f g s)


/-- A set `s` is not bounded below if and only if for each `x` there exists `y ∈ s` such that `x`
is not less than or equal to `y`. This version only assumes `Preorder` structure and uses
`¬(x ≤ y)`. A version for linear orders is called `not_bddBelow_iff`. -/
theorem not_bddBelow_iff' : ¬BddBelow s ↔ ∀ x, ∃ y ∈ s, ¬x ≤ y

¬BddBelow s ↔ ∀ (x : α), ∃ y ∈ s, ¬x ≤ y


/-- The `p`th power of a quadratic character is itself, when `p` is the (prime) characteristic
of the target ring. -/
theorem IsQuadratic.pow_char {χ : MulChar R R'} (hχ : χ.IsQuadratic) (p : ℕ) [hp : Fact p.Prime]
    [CharP R' p] : χ ^ p = χ

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{χ : MulChar R R'}
(hχ : χ.IsQuadratic)
(p : ℕ)
[hp : Fact (Nat.Prime p)]
[CharP R' p]


/-- If a function is differentiable on the left of a point `a : ℝ`, continuous at `a`, and
its derivative also converges at `a`, then `f` is differentiable on the left at `a`. -/
theorem hasDerivWithinAt_Iic_of_tendsto_deriv {s : Set ℝ} {e : E} {a : ℝ}
    {f : ℝ → E} (f_diff : DifferentiableOn ℝ f s) (f_lim : ContinuousWithinAt f s a)
    (hs : s ∈ 𝓝[<] a) (f_lim' : Tendsto (fun x => deriv f x) (𝓝[<] a) (𝓝 e)) :
    HasDerivWithinAt f e (Iic a) a

(f_lim' : Filter.Tendsto (fun x => deriv f x) (𝓝[<] a) (𝓝 e))


theorem isRelPrime_comm : IsRelPrime x y ↔ IsRelPrime y x


@[simp]
lemma inv_bot : (⊥ : EReal)⁻¹ = 0


private lemma isCoprime_x_z : IsCoprime S.x S.z

(S : FermatLastTheoremForThreeGen.Solution hζ)

IsCoprime (FermatLastTheoremForThreeGen.Solution.x S) (FermatLastTheoremForThreeGen.Solution.z S)


@[continuity]
theorem Continuous.matrix_blockDiag {A : X → Matrix (m × p) (n × p) R} (hA : Continuous A) :
    Continuous fun x => blockDiag (A x)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{A : X → Matrix (m × p) (n × p) R}
(hA : Continuous A)


lemma ProbabilityMeasure.continuous_toLevyProkhorov :
    Continuous (ProbabilityMeasure.toLevyProkhorov (Ω := Ω))

{Ω : Type u_2}
[PseudoMetricSpace Ω]
[TopologicalSpace.SeparableSpace Ω]
[MeasurableSpace Ω]
[OpensMeasurableSpace Ω]


/-- The unit of the adjunction between locales and topological spaces, which associates with
a point `x` of the space `X` a point of the locale of opens of `X`. -/
@[simps]
def localePointOfSpacePoint (x : X) : PT (Opens X)

(X : Type u_1)
[TopologicalSpace X]
(x : X)

∀ (x_1 : TopologicalSpace.Opens X), (Locale.localePointOfSpacePoint X x) x_1 = (x ∈ x_1)


theorem le_mul_congr {l₁ l₂ m₁ m₂ : Language α} : l₁ ≤ m₁ → l₂ ≤ m₂ → l₁ * l₂ ≤ m₁ * m₂

{α : Type u_1}
{l₁ l₂ m₁ m₂ : Language α}

l₁ ≤ m₁ → l₂ ≤ m₂ → l₁ * l₂ ≤ m₁ * m₂


/-- When all four functors in a sequare are left adjoints, the mates operation can be iterated:

         L₁                  R₁                  R₁
      C --→ D             C ←-- D             C ←-- D
   F₁ ↓  ↗  ↓  F₂      F₁ ↓  ↘  ↓ F₂       U₁ ↑  ↙  ↑ U₂
      E --→ F             E ←-- F             E ←-- F
         L₂                  R₂                  R₂

In this case the iterated mate equals the conjugate of the original transformation and is thus an
isomorphism if and only if the original transformation is. This explains why some Beck-Chevalley
natural transformations are natural isomorphisms.
-/
theorem iterated_mateEquiv_conjugateEquiv (α : F₁ ⋙ L₂ ⟶ L₁ ⋙ F₂) :
    mateEquiv adj₄ adj₃ (mateEquiv adj₁ adj₂ α) =
      conjugateEquiv (adj₁.comp adj₄) (adj₃.comp adj₂) α

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
{F₁ : CategoryTheory.Functor A C}
{U₁ : CategoryTheory.Functor C A}
{F₂ : CategoryTheory.Functor B D}
{U₂ : CategoryTheory.Functor D B}
{L₁ : CategoryTheory.Functor A B}
{R₁ : CategoryTheory.Functor B A}
{L₂ : CategoryTheory.Functor C D}
{R₂ : CategoryTheory.Functor D C}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : F₁ ⊣ U₁)
(adj₄ : F₂ ⊣ U₂)
(α : F₁.comp L₂ ⟶ L₁.comp F₂)

(CategoryTheory.mateEquiv adj₄ adj₃) ((CategoryTheory.mateEquiv adj₁ adj₂) α) =
  (CategoryTheory.conjugateEquiv (adj₁.comp adj₄) (adj₃.comp adj₂)) α


theorem mem_localTrivAsPartialEquiv_source (p : Z.TotalSpace) :
    p ∈ (Z.localTrivAsPartialEquiv i).source ↔ p.1 ∈ Z.baseSet i

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i : ι)
(p : Z.TotalSpace)

p ∈ (Z.localTrivAsPartialEquiv i).source ↔ p.proj ∈ Z.baseSet i


/-- A subgroup is closed under division. -/
@[to_additive (attr := aesop safe apply (rule_sets := [SetLike]))
  "An additive subgroup is closed under subtraction."]
theorem div_mem {x y : M} (hx : x ∈ H) (hy : y ∈ H) : x / y ∈ H

{M : Type u_5}
{S : Type u_6}
[SubNegMonoid M]
[SetLike S M]
[hSM : AddSubgroupClass S M]
{H : S}
{x y : M}
(hx : x ∈ H)
(hy : y ∈ H)


theorem iSup_add_iSup_le {ι ι' : Sort*} [Nonempty ι] [Nonempty ι'] {f : ι → ℝ≥0∞} {g : ι' → ℝ≥0∞}
    {a : ℝ≥0∞} (h : ∀ i j, f i + g j ≤ a) : iSup f + iSup g ≤ a

{ι : Sort u_4}
{ι' : Sort u_5}
[Nonempty ι]
[Nonempty ι']
{f : ι → ℝ≥0∞}
{g : ι' → ℝ≥0∞}
{a : ℝ≥0∞}
(h : ∀ (i : ι) (j : ι'), f i + g j ≤ a)


theorem splits_of_isUnit [IsDomain K] {u : K[X]} (hu : IsUnit u) : u.Splits i

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
[IsDomain K]
{u : K[X]}
(hu : IsUnit u)


lemma twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] (hΔ : IsUnit W.Δ) :
    W.twoTorsionPolynomial.disc ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[Nontrivial R]
[Invertible 2]
(hΔ : IsUnit W.Δ)


/-- The composition of lax braided monoidal functors. -/
@[simps!]
def comp (F : LaxBraidedFunctor C D) (G : LaxBraidedFunctor D E) : LaxBraidedFunctor C E

(F : CategoryTheory.LaxBraidedFunctor C D)

(G : CategoryTheory.LaxBraidedFunctor D E)

∀ {X Y : C} (f : X ⟶ Y), (F.comp G).map f = G.map (F.map f)


@[simps]
instance [Add α] {a b : Thunk α} (εa εb : Type*) [EstimatorData a εa] [EstimatorData b εb] :
    EstimatorData (a + b) (εa × εb)

{α : Type u_1}
[Add α]
{a b : Thunk α}
(εa : Type u_3)
(εb : Type u_4)
[EstimatorData a εa]
[EstimatorData b εb]
(e : εa × εb)

EstimatorData.bound (a + b) e = EstimatorData.bound a e.1 + EstimatorData.bound b e.2


@[simp]
theorem LinearEquiv.coe_ofIsUnitDet {f : M →ₗ[R] M'} {v : Basis ι R M} {v' : Basis ι R M'}
    (h : IsUnit (LinearMap.toMatrix v v' f).det) :
    (LinearEquiv.ofIsUnitDet h : M →ₗ[R] M') = f

(h : IsUnit ((LinearMap.toMatrix v v') f).det)


theorem SOppSide.trans_wOppSide {s : AffineSubspace R P} {x y z : P} (hxy : s.SOppSide x y)
    (hyz : s.WOppSide y z) : s.WSameSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SOppSide x y)
(hyz : s.WOppSide y z)


@[to_additive (attr := simp)]
theorem prod_toList (s : Multiset α) : s.toList.prod = s.prod

{α : Type u_3}
[CommMonoid α]
(s : Multiset α)


@[simp]
theorem coe_con {a : A} : (L.con a : M) = a

(L : FirstOrder.Language)
{M : Type w}
[L.Structure M]
(A : Set M)
{a : ↑A}


theorem map_prod_eq_map₂ (m : α → β → γ) (f : Filter α) (g : Filter β) :
    Filter.map (fun p : α × β => m p.1 p.2) (f ×ˢ g) = map₂ m f g

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
(m : α → β → γ)
(f : Filter α)
(g : Filter β)

Filter.map (fun p => m p.1 p.2) (f ×ˢ g) = Filter.map₂ m f g


/-- The indicator of a disjoint union of two sets is the sum of the indicators of the sets. -/
theorem indicatorConstLp_disjoint_union {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
    (hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) (c : E) :
    indicatorConstLp p (hs.union ht) (measure_union_ne_top hμs hμt) c =
      indicatorConstLp p hs hμs c + indicatorConstLp p ht hμt c

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s t : Set α}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hμs : μ s ≠ ⊤)
(hμt : μ t ≠ ⊤)
(hst : s ∩ t = ∅)
(c : E)

MeasureTheory.indicatorConstLp p ⋯ ⋯ c =
  MeasureTheory.indicatorConstLp p hs hμs c + MeasureTheory.indicatorConstLp p ht hμt c


theorem Irreducible.isUnit_iff_not_associated_of_dvd [Monoid α]
    {x y : α} (hx : Irreducible x) (hy : y ∣ x) : IsUnit y ↔ ¬ Associated x y

{α : Type u_1}
[Monoid α]
{x y : α}
(hx : Irreducible x)
(hy : y ∣ x)


/-- A structure requiring that a scalar product is positive definite and symmetric, from which one
can construct an `InnerProductSpace` instance in `InnerProductSpace.ofCore`. -/
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (𝕜 : Type*) (F : Type*) [RCLike 𝕜] [AddCommGroup F]
  [Module 𝕜 F] extends Inner 𝕜 F where
  /-- The inner product is *hermitian*, taking the `conj` swaps the arguments. -/
  conj_symm : ∀ x y, conj (inner y x) = inner x y
  /-- The inner product is positive (semi)definite. -/
  nonneg_re : ∀ x, 0 ≤ re (inner x x)
  /-- The inner product is positive definite. -/
  definite : ∀ x, inner x x = 0 → x = 0
  /-- The inner product is additive in the first coordinate. -/
  add_left : ∀ x y z, inner (x + y) z = inner x z + inner y z
  /-- The inner product is conjugate linear in the first coordinate. -/
  smul_left : ∀ x y r, inner (r • x) y = conj r * inner x y

{𝕜 : Type u_4}
{F : Type u_5}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
(self : InnerProductSpace.Core 𝕜 F)
(x : F)


theorem MeasurePreserving.setLIntegral_comp_emb {mb : MeasurableSpace β} {ν : Measure β}
    {g : α → β} (hg : MeasurePreserving g μ ν) (hge : MeasurableEmbedding g) (f : β → ℝ≥0∞)
    (s : Set α) : ∫⁻ a in s, f (g a) ∂μ = ∫⁻ b in g '' s, f b ∂ν

(hg : MeasureTheory.MeasurePreserving g μ ν)

(f : β → ℝ≥0∞)

∫⁻ (a : α) in s, f (g a) ∂μ = ∫⁻ (b : β) in g '' s, f b ∂ν


@[simp]
theorem coe_snd : ⇑(snd R S) = Prod.snd

{R : Type u_3}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]


/-- Every basis vector from `adjustToOrientation` is either that from the original basis or its
negation. -/
theorem adjustToOrientation_apply_eq_or_eq_neg (i : ι) :
    e.adjustToOrientation x i = e i ∨ e.adjustToOrientation x i = -e i

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
[ne : Nonempty ι]
(e : OrthonormalBasis ι ℝ E)
(x : Orientation ℝ E ι)
(i : ι)

(e.adjustToOrientation x) i = e i ∨ (e.adjustToOrientation x) i = -e i


theorem mul_mono (hik : I ≤ K) (hjl : J ≤ L) : I * J ≤ K * L

{R : Type u}
[CommSemiring R]
{I J K L : Ideal R}
(hik : I ≤ K)
(hjl : J ≤ L)


theorem iSup_sub : (⨆ i, f i) - a = ⨆ i, f i - a

{ι : Sort u_1}
{f : ι → ℝ≥0∞}
{a : ℝ≥0∞}


@[to_additive (attr := simp) mod_card_zsmul]
theorem zpow_mod_card (a : G) (n : ℤ) : a ^ (n % Fintype.card G : ℤ) = a ^ n

{G : Type u_1}
[Group G]
[Fintype G]
(a : G)
(n : ℤ)


theorem preimage_iso [LE α] [LE β] {t : Set β} (ht : IsAntichain (· ≤ ·) t) (φ : α ≃o β) :
    IsAntichain (· ≤ ·) (φ ⁻¹' t)

(ht : IsAntichain (fun x x_1 => x ≤ x_1) t)

(φ : α ≃o β)

IsAntichain (fun x x_1 => x ≤ x_1) (⇑φ ⁻¹' t)


@[simp, norm_cast]
theorem coe_add (x y : s) : ((x + y : s) : R) = (x + y : R)

{R : Type u}
[NonUnitalNonAssocSemiring R]
(s : NonUnitalSubsemiring R)
(x y : ↥s)


/-- The Mellin transform of `f` is well-defined and equal to `P.Λ s`, for all `s`. -/
theorem hasMellin (s : ℂ) : HasMellin P.f s (P.Λ s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : StrongFEPair E)
(s : ℂ)


lemma isBoundaryPoint_iff {x : M} : I.IsBoundaryPoint x ↔ extChartAt I x x ∈ frontier (range I)

{𝕜 : 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]
{x : M}

I.IsBoundaryPoint x ↔ ↑(extChartAt I x) x ∈ frontier (Set.range ↑I)


@[simp] theorem mul_top (hm : m ≠ 0) : m * ⊤ = ⊤


@[simp]
theorem rootMultiplicity_eq_zero_iff {p : R[X]} {x : R} :
    rootMultiplicity x p = 0 ↔ IsRoot p x → p = 0

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

Polynomial.rootMultiplicity x p = 0 ↔ p.IsRoot x → p = 0


@[simp]
theorem top_toSubfield : (⊤ : IntermediateField F E).toSubfield = ⊤

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


/-- The sum of two lower semicontinuous functions is lower semicontinuous. Formulated with
`[ContinuousAdd]`. The primed version of the lemma uses an explicit continuity assumption on
addition, for application to `EReal`. -/
theorem LowerSemicontinuous.add {f g : α → γ} (hf : LowerSemicontinuous f)
    (hg : LowerSemicontinuous g) : LowerSemicontinuous fun z => f z + g z

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_4}
[LinearOrderedAddCommMonoid γ]
[TopologicalSpace γ]
[OrderTopology γ]
[ContinuousAdd γ]
{f g : α → γ}
(hf : LowerSemicontinuous f)
(hg : LowerSemicontinuous g)


@[simp, norm_cast] lemma one_le_coe : 1 ≤ (r : ℝ) ↔ 1 ≤ r

1 ≤ ↑r ↔ 1 ≤ r


@[simp]
theorem bind_apply (f : α →. β) (g : β → α →. γ) (a : α) : f.bind g a = (f a).bind fun b => g b a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α →. β)
(g : β → α →. γ)
(a : α)


theorem cofinite.bliminf_set_eq : bliminf s cofinite p = { x | { n | p n ∧ x ∉ s n }.Finite }

{α : Type u_1}
{ι : Type u_4}
{p : ι → Prop}
{s : ι → Set α}

Filter.bliminf s Filter.cofinite p = {x | {n | p n ∧ x ∉ s n}.Finite}


/-- The bijection `(Y ⟶ Z) ≃ (X ⟶ Z)` induced by `f : X ⟶ Y` when `LeftBousfield.W P f`
and `P Z`. -/
@[simps! apply]
noncomputable def W.homEquiv {X Y : C} {f : X ⟶ Y} (hf : W P f) (Z : C) (hZ : P Z) :
    (Y ⟶ Z) ≃ (X ⟶ Z)

(hf : CategoryTheory.Localization.LeftBousfield.W P f)

(hf.homEquiv Z hZ) g = CategoryTheory.CategoryStruct.comp f g


/-- Inverse statement of **LDL decomposition**: we can conjugate a positive definite matrix
by some lower triangular matrix and get a diagonal matrix. -/
theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.lowerInv hS)ᴴ

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[LinearOrder n]
[IsWellOrder n fun x x_1 => x < x_1]
[LocallyFiniteOrderBot n]
{S : Matrix n n 𝕜}
[Fintype n]
(hS : S.PosDef)

LDL.diag hS = LDL.lowerInv hS * S * (LDL.lowerInv hS).conjTranspose


theorem sdiff_sdiff_eq_self (h : t ⊆ s) : s \ (s \ t) = t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
(h : t ⊆ s)


theorem IsTopologicalBasis.insert_empty {s : Set (Set α)} (h : IsTopologicalBasis s) :
    IsTopologicalBasis (insert ∅ s)

(h : TopologicalSpace.IsTopologicalBasis s)

TopologicalSpace.IsTopologicalBasis (insert ∅ s)


@[to_additive "A right transversal is finite iff the subgroup has finite index"]
theorem finite_iff
    (h : S ∈ Subgroup.rightTransversals (H : Set G)) :
    Finite S ↔ H.FiniteIndex

(h : S ∈ AddSubgroup.rightTransversals ↑H)


@[simp]
theorem bot_left (X : C) : ((⊥ : MonoOver X) : C) = ⊥_ C


theorem comp_hasFDerivWithinAt_iff' {f : G → E} {s : Set G} {x : G} {f' : G →L[𝕜] F} :
    HasFDerivWithinAt (iso ∘ f) f' s x ↔ HasFDerivWithinAt f ((iso.symm : F →L[𝕜] E).comp f') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{s : Set G}
{x : G}
{f' : G →L[𝕜] F}

HasFDerivWithinAt (⇑iso ∘ f) f' s x ↔
  HasFDerivWithinAt f
    ((↑{ toLinearEquiv := iso.symm.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp f') s x


theorem Filter.Tendsto.fin_insertNth {n} {π : Fin (n + 1) → Type*} [∀ i, TopologicalSpace (π i)]
    (i : Fin (n + 1)) {f : Y → π i} {l : Filter Y} {x : π i} (hf : Tendsto f l (𝓝 x))
    {g : Y → ∀ j : Fin n, π (i.succAbove j)} {y : ∀ j, π (i.succAbove j)} (hg : Tendsto g l (𝓝 y)) :
    Tendsto (fun a => i.insertNth (f a) (g a)) l (𝓝 <| i.insertNth x y)

[(i : Fin (n + 1)) → TopologicalSpace (π i)]

{g : Y → (j : Fin n) → π (i.succAbove j)}

Filter.Tendsto (fun a => i.insertNth (f a) (g a)) l (𝓝 (i.insertNth x y))


@[to_additive (attr := simp)]
theorem singletonMulHom_apply (a : α) : singletonMulHom a = {a}


@[reassoc]
lemma sHom_whisker_exchange {K K' L L' : C} (f : K ⟶ K') (g : L ⟶ L') :
    sHomWhiskerLeft K' g ≫ sHomWhiskerRight f L' =
      sHomWhiskerRight f L ≫ sHomWhiskerLeft K g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.SimplicialCategory C]
{K K' L L' : C}
(f : K ⟶ K')
(g : L ⟶ L')

CategoryTheory.SimplicialCategory.sHomWhiskerLeft K' g ≫ CategoryTheory.SimplicialCategory.sHomWhiskerRight f L' =
  CategoryTheory.SimplicialCategory.sHomWhiskerRight f L ≫ CategoryTheory.SimplicialCategory.sHomWhiskerLeft K g


@[to_additive neg_one_zsmul_add]
lemma mul_zpow_neg_one (a b : α) : (a * b) ^ (-1 : ℤ) = b ^ (-1 : ℤ) * a ^ (-1 : ℤ)

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


theorem monic_denom (x : RatFunc K) : (denom x).Monic


/-- If the oriented angle between two vectors is `-π / 2`, the inner product of those vectors
is zero. -/
theorem inner_eq_zero_of_oangle_eq_neg_pi_div_two {x y : V} (h : o.oangle x y = (-π / 2 : ℝ)) :
    ⟪x, y⟫ = 0

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


@[simp]
theorem pred_coe (a : α) : pred (↑a : WithBot α) = ↑(pred a)

{α : Type u_1}
[Preorder α]
[NoMinOrder α]
[PredOrder α]
(a : α)


/-- Each element of the group defines an algebra equivalence.

This is a stronger version of `MulSemiringAction.toRingEquiv` and
`DistribMulAction.toLinearEquiv`. -/
@[simps! apply symm_apply toEquiv] -- Porting note: don't want redundant simps lemma `toEquiv_symm`
def toAlgEquiv (g : G) : A ≃ₐ[R] A

{G : Type u_2}
(R : Type u_3)
(A : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Group G]
[MulSemiringAction G A]
[SMulCommClass G R A]
(g : G)

∀ (a : A), (MulSemiringAction.toAlgEquiv R A g) a = g • a


theorem range_prod_le (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) :
    range (prod f g) ≤ (range f).prod (range g)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₂)
(g : M →ₗ[R] M₃)

LinearMap.range (f.prod g) ≤ (LinearMap.range f).prod (LinearMap.range g)


@[simp]
theorem sign_prodExtendRight (a : α) (σ : Perm β) : sign (prodExtendRight a σ) = sign σ

{α : Type u}
[DecidableEq α]
{β : Type v}
[Fintype α]
[DecidableEq β]
[Fintype β]
(a : α)
(σ : Equiv.Perm β)

Equiv.Perm.sign (Equiv.Perm.prodExtendRight a σ) = Equiv.Perm.sign σ


@[simp]
theorem union_compl (s : Finset α) : s ∪ sᶜ = univ

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(s : Finset α)


@[reassoc]
lemma ι_functorMapTgt (i : I) (t : A i ⟶ X) (b : B i ⟶ S) (w : t ≫ πX = f i ≫ b)
    (t' : A i ⟶ Y) (fac : t ≫ φ = t') :
    Sigma.ι _ (FunctorObjIndex.mk i t b w) ≫ functorMapTgt f πX πY φ hφ =
      Sigma.ι (functorObjTgtFamily f πY)
        (FunctorObjIndex.mk i t' b (by rw [← w, ← fac, assoc, hφ]))

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πY)) C]

(hφ : CategoryTheory.CategoryStruct.comp φ πY = πX)

(w : CategoryTheory.CategoryStruct.comp t πX = CategoryTheory.CategoryStruct.comp (f i) b)

(fac : CategoryTheory.CategoryStruct.comp t φ = t')

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.Sigma.ι (CategoryTheory.SmallObject.functorObjTgtFamily f πX)
      { i := i, t := t, b := b, w := w })
    (CategoryTheory.SmallObject.functorMapTgt f πX πY φ hφ) =
  CategoryTheory.Limits.Sigma.ι (CategoryTheory.SmallObject.functorObjTgtFamily f πY)
    { i := i, t := t', b := b, w := ⋯ }


theorem compl_eq_univ_sdiff (s : Finset α) : sᶜ = univ \ s


theorem stepAux_write (q : Stmt'₁) (v : σ) (a b : Γ) (L R : ListBlank Γ) :
    stepAux (write (enc a).toList q) v (trTape' enc0 L (ListBlank.cons b R)) =
      stepAux q v (trTape' enc0 (ListBlank.cons a L) R)

(enc0 : enc default = Mathlib.Vector.replicate n false)

(q : Turing.TM1.Stmt Bool Turing.TM1to1.Λ' σ)

Turing.TM1.stepAux (Turing.TM1to1.write (enc a).toList q) v (Turing.TM1to1.trTape' enc0 L (Turing.ListBlank.cons b R)) =
  Turing.TM1.stepAux q v (Turing.TM1to1.trTape' enc0 (Turing.ListBlank.cons a L) R)


@[refl, simp]
theorem dvd_refl (a : α) : a ∣ a


@[fun_prop]
theorem DifferentiableAt.const_sub (hf : DifferentiableAt 𝕜 f x) (c : F) :
    DifferentiableAt 𝕜 (fun y => c - f y) x

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


/-- For prime `p` the only prime factor of `p^k` is `p` with multiplicity `k` -/
theorem Prime.factorization_pow {p k : ℕ} (hp : Prime p) : (p ^ k).factorization = single p k

(p ^ k).factorization = Finsupp.single p k


lemma eventually_iInf_range_pow_eq (f : Module.End R M) :
    ∀ᶠ n in atTop, ⨅ m, LinearMap.range (f ^ m) = LinearMap.range (f ^ n)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
(f : Module.End R M)

∀ᶠ (n : ℕ) in Filter.atTop, ⨅ m, LinearMap.range (f ^ m) = LinearMap.range (f ^ n)


@[simp]
theorem rightOp_comp (α : F ⟶ G) (β : G ⟶ H) : NatTrans.rightOp (α ≫ β) =
    NatTrans.rightOp β ≫ NatTrans.rightOp α

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G H : CategoryTheory.Functor Cᵒᵖ D}
(α : F ⟶ G)
(β : G ⟶ H)

CategoryTheory.NatTrans.rightOp (CategoryTheory.CategoryStruct.comp α β) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.NatTrans.rightOp β) (CategoryTheory.NatTrans.rightOp α)


lemma nontrivial_iff_ne_singleton (ha : a ∈ s) : s.Nontrivial ↔ s ≠ {a}

{α : Type u}
{a : α}
{s : Set α}
(ha : a ∈ s)


theorem unitCompPartialBijective_natural [Reflective i] (A : C) {B B' : C} (h : B ⟶ B')
    (hB : B ∈ i.essImage) (hB' : B' ∈ i.essImage) (f : A ⟶ B) :
    (unitCompPartialBijective A hB') (f ≫ h) = unitCompPartialBijective A hB f ≫ h

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{i : CategoryTheory.Functor D C}
[CategoryTheory.Reflective i]
(A : C)
{B B' : C}
(h : B ⟶ B')
(hB : B ∈ i.essImage)
(hB' : B' ∈ i.essImage)
(f : A ⟶ B)

(CategoryTheory.unitCompPartialBijective A hB') (CategoryTheory.CategoryStruct.comp f h) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.unitCompPartialBijective A hB) f) h


theorem min_def' [LinearOrder α] (a b : α) : min a b = if b ≤ a then b else a

{α : Type u_2}
[LinearOrder α]
(a b : α)


@[gcongr]
theorem log_lt_log (hx : 0 < x) (h : x < y) : log x < log y


@[simp]
theorem cardinal_mk_eq_max {R : Type u} [Semiring R] [Nontrivial R] : #(R[X]) = max #R ℵ₀


@[simp]
theorem add_eq_bot : a + b = ⊥ ↔ a = ⊥ ∨ b = ⊥


theorem Zlattice.isAddFundamentalDomain {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [FiniteDimensional ℝ E] {L : AddSubgroup E} [DiscreteTopology L] [IsZlattice ℝ L] [Finite ι]
    (b : Basis ι ℤ L) [MeasurableSpace E] [OpensMeasurableSpace E] (μ : MeasureTheory.Measure E) :
    MeasureTheory.IsAddFundamentalDomain L (Zspan.fundamentalDomain (b.ofZlatticeBasis ℝ)) μ

{ι : Type u_3}
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{L : AddSubgroup E}
[DiscreteTopology ↥L]
[IsZlattice ℝ L]
[Finite ι]
(b : Basis ι ℤ ↥L)
[MeasurableSpace E]
[OpensMeasurableSpace E]
(μ : MeasureTheory.Measure E)

MeasureTheory.IsAddFundamentalDomain (↥L) (Zspan.fundamentalDomain (Basis.ofZlatticeBasis ℝ L b)) μ


theorem iUnion_image_right : ⋃ b ∈ t, (f · b) '' s = image2 f s t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
{s : Set α}
{t : Set β}

⋃ b ∈ t, (fun x => f x b) '' s = Set.image2 f s t


@[simp]
lemma comp_assoc_of_second_degree_eq_neg_third_degree {n₁ n₂ n₁₂ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K (-n₂)) (z₃ : Cochain K L n₂) (h₁₂ : n₁ + (-n₂) = n₁₂) :
    (z₁.comp z₂ h₁₂).comp z₃
      (show n₁₂ + n₂ = n₁ by rw [← h₁₂, add_assoc, neg_add_self, add_zero]) =
      z₁.comp (z₂.comp z₃ (neg_add_self n₂)) (add_zero n₁)

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

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

(z₃ : CochainComplex.HomComplex.Cochain K L n₂)

(z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ ⋯) ⋯


/-- The adjunction showing that evaluation is a left adjoint. -/
@[simps! unit_app_app counit_app]
def evaluationAdjunctionLeft (c : C) : (evaluation _ _).obj c ⊣ evaluationRightAdjoint D c

[∀ (a b : C), CategoryTheory.Limits.HasProductsOfShape (a ⟶ b) D]

((CategoryTheory.evaluationAdjunctionLeft D c).unit.app X).app t = CategoryTheory.Limits.Pi.lift fun g => X.map g


/-- The natural isomorphism `(K⟦n⟧).sc' i j k ≅ K.sc' i' j' k'` when `n + i = i'`,
`n + j = j'` and `n + k = k'`. -/
@[simps!]
def shiftShortComplexFunctor' (n i j k i' j' k' : ℤ)
    (hi : n + i = i') (hj : n + j = j') (hk : n + k = k') :
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) n) ⋙ shortComplexFunctor' C _ i j k ≅
      shortComplexFunctor' C _ i' j' k'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i j k i' j' k' : ℤ)
(hi : n + i = i')
(hj : n + j = j')
(hk : n + k = k')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctor' C n i j k i' j' k' hi hj hk).inv.app X).τ₁ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).inv


theorem ContDiff.continuous_deriv (h : ContDiff 𝕜 n f₂) (hn : 1 ≤ n) : Continuous (deriv f₂)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{f₂ : 𝕜 → F}
(h : ContDiff 𝕜 n f₂)
(hn : 1 ≤ n)


/-- A sum of finite terms is finite. -/
lemma sum_lt_bot (h : ∀ i ∈ s, f i ≠ ⊥) : ⊥ < ∑ i ∈ s, f i

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
[LT α]
{s : Finset ι}
{f : ι → WithBot α}
(h : ∀ i ∈ s, f i ≠ ⊥)


theorem isComplement'_of_disjoint_and_mul_eq_univ (h1 : Disjoint H K)
    (h2 : ↑H * ↑K = (Set.univ : Set G)) : IsComplement' H K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h1 : Disjoint H K)
(h2 : ↑H * ↑K = Set.univ)


/-- The type `∀ (i : α), β i` can be split as a product by separating the indices in `α`
depending on whether they satisfy a predicate `p` or not. -/
@[simps]
def piEquivPiSubtypeProd {α : Type*} (p : α → Prop) (β : α → Type*) [DecidablePred p] :
    (∀ i : α, β i) ≃ (∀ i : { x // p x }, β i) × ∀ i : { x // ¬p x }, β i

{α : Type u_1}
(p : α → Prop)
(β : α → Type u_2)
[DecidablePred p]
(f : (i : α) → β i)

(Equiv.piEquivPiSubtypeProd p β) f = (fun x => f ↑x, fun x => f ↑x)


@[simp]
theorem neLocus_add_right [∀ a, AddRightCancelMonoid (N a)] (f g h : Π₀ a, N a) :
    (f + h).neLocus (g + h) = f.neLocus g

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddRightCancelMonoid (N a)]
(f g h : Π₀ (a : α), N a)


theorem ae_eq_dirac' [MeasurableSingletonClass β] {a : α} {f : α → β} (hf : Measurable f) :
    f =ᵐ[dirac a] const α (f a)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSingletonClass β]
{a : α}
{f : α → β}
(hf : Measurable f)

f =ᵐ[MeasureTheory.Measure.dirac a] Function.const α (f a)


theorem Frequently.mono {p q : α → Prop} {f : Filter α} (h : ∃ᶠ x in f, p x)
    (hpq : ∀ x, p x → q x) : ∃ᶠ x in f, q x

{α : Type u}
{p q : α → Prop}
{f : Filter α}
(h : ∃ᶠ (x : α) in f, p x)
(hpq : ∀ (x : α), p x → q x)


/-- Viewing a module as an affine space modelled on itself, affine combinations are just linear
combinations. -/
@[simp]
theorem affineCombination_eq_linear_combination (s : Finset ι) (p : ι → V) (w : ι → k)
    (hw : ∑ i ∈ s, w i = 1) : s.affineCombination k p w = ∑ i ∈ s, w i • p i

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
{ι : Type u_4}
(s : Finset ι)
(p : ι → V)
(w : ι → k)
(hw : ∑ i ∈ s, w i = 1)

(Finset.affineCombination k s p) w = ∑ i ∈ s, w i • p i


@[simp]
theorem refl_comp (f : M ↪[L] N) : (refl L N).comp f = f

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Embedding M N)

(FirstOrder.Language.Embedding.refl L N).comp f = f


theorem mem_inv_smul_set_iff₀ (ha : a ≠ 0) (A : Set β) (x : β) : x ∈ a⁻¹ • A ↔ a • x ∈ A

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
(A : Set β)
(x : β)

x ∈ a⁻¹ • A ↔ a • x ∈ A


lemma le_floorDiv_iff_mul_le (ha : 0 < a) : c ≤ b ⌊/⌋ a ↔ a • c ≤ b

{α : Type u_2}
[OrderedSemiring α]
[FloorDiv α α]
{a b c : α}
(ha : 0 < a)


theorem _root_.CommGroup.center_eq_top {G : Type*} [CommGroup G] : center G = ⊤


lemma equivEssImageOfReflective_map_counitIso_app_inv [Reflective i]
    (X : Functor.EssImageSubcategory i) :
  (Functor.essImageInclusion i).map (equivEssImageOfReflective_counitIso_app X).inv =
    (NatTrans.app (reflectorAdjunction i).unit X.obj)

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{i : CategoryTheory.Functor D C}
[CategoryTheory.Reflective i]
(X : i.EssImageSubcategory)

i.essImageInclusion.map (CategoryTheory.equivEssImageOfReflective_counitIso_app X).inv =
  (CategoryTheory.reflectorAdjunction i).unit.app X.obj


/-- A universal property of the trivial square-zero extension, providing a unique
`TrivSqZeroExt R M →ₐ[R] A` for every pair of maps `f : R →ₐ[S] A` and `g : M →ₗ[S] A`,
where the range of `g` has no non-zero products, and scaling the input to `g` on the left or right
amounts to a corresponding multiplication by `f` in the output.

This isomorphism is named to match the very similar `Complex.lift`. -/
@[simps! apply symm_apply_coe]
def liftEquiv :
    {fg : (R →ₐ[S] A) × (M →ₗ[S] A) //
      (∀ x y, fg.2 x * fg.2 y = 0) ∧
      (∀ r x, fg.2 (r •> x) = fg.1 r * fg.2 x) ∧
      (∀ r x, fg.2 (x <• r) = fg.2 x * fg.1 r)} ≃ (tsze R M →ₐ[S] A)

{S : Type u_1}
{R : Type u}
{M : Type v}
[CommSemiring S]
[Semiring R]
[AddCommMonoid M]
[Algebra S R]
[Module S M]
[Module R M]
[Module Rᵐᵒᵖ M]
[SMulCommClass R Rᵐᵒᵖ M]
[IsScalarTower S R M]
[IsScalarTower S Rᵐᵒᵖ M]
{A : Type u_2}
[Semiring A]
[Algebra S A]
(F : tsze R M →ₐ[S] A)

↑(TrivSqZeroExt.liftEquiv.symm F) =
  (F.comp (TrivSqZeroExt.inlAlgHom S R M), F.toLinearMap ∘ₗ ↑S (TrivSqZeroExt.inrHom R M))


theorem sdiff_eq_filter (s₁ s₂ : Finset α) : s₁ \ s₂ = filter (· ∉ s₂) s₁

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

s₁ \ s₂ = Finset.filter (fun x => x ∉ s₂) s₁


@[simp]
theorem ker_inl : ker (inl R M M₂) = ⊥

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.ker (LinearMap.inl R M M₂) = ⊥


@[simp]
theorem mass_toFiniteMeasure (μ : ProbabilityMeasure Ω) : μ.toFiniteMeasure.mass = 1

(μ : MeasureTheory.ProbabilityMeasure Ω)


lemma integral_condKernel (hf : Integrable f ρ) :
    ∫ b, ∫ ω, f (b, ω) ∂(ρ.condKernel b) ∂ρ.fst = ∫ x, f x ∂ρ

{β : Type u_2}
{Ω : Type u_3}
{mβ : MeasurableSpace β}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{ρ : MeasureTheory.Measure (β × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
{E : Type u_4}
{f : β × Ω → E}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(hf : MeasureTheory.Integrable f ρ)

∫ (b : β), ∫ (ω : Ω), f (b, ω) ∂ρ.condKernel b ∂ρ.fst = ∫ (x : β × Ω), f x ∂ρ


/-- If the domain of a surjective function is a subsingleton, then the codomain is a subsingleton as
well. -/
protected theorem Surjective.subsingleton [Subsingleton α] (hf : Surjective f) : Subsingleton β

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
[Subsingleton α]
(hf : Function.Surjective f)


theorem map_sigma_mk_comap {π : α → Type*} {π' : β → Type*} {f : α → β}
    (hf : Function.Injective f) (g : ∀ a, π a → π' (f a)) (a : α) (l : Filter (π' (f a))) :
    map (Sigma.mk a) (comap (g a) l) = comap (Sigma.map f g) (map (Sigma.mk (f a)) l)

{α : Type u_1}
{β : Type u_2}
{π : α → Type u_6}
{π' : β → Type u_7}
{f : α → β}
(hf : Function.Injective f)
(g : (a : α) → π a → π' (f a))
(a : α)
(l : Filter (π' (f a)))

Filter.map (Sigma.mk a) (Filter.comap (g a) l) = Filter.comap (Sigma.map f g) (Filter.map (Sigma.mk (f a)) l)


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

(S : CategoryTheory.ShortComplex.SnakeInput C)

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


@[to_additive (attr := simp)]
theorem inv_singleton (a : α) : ({a} : Finset α)⁻¹ = {a⁻¹}

{α : Type u_2}
[DecidableEq α]
[Neg α]
(a : α)


lemma Complex.cot_eq_exp_ratio (z : ℂ) :
    cot z = (Complex.exp (2 * I * z) + 1) / (I * (1 - Complex.exp (2 * I * z)))

z.cot = (cexp (2 * Complex.I * z) + 1) / (Complex.I * (1 - cexp (2 * Complex.I * z)))


theorem infinitesimal_epsilon : Infinitesimal ε


@[simp]
theorem card_insert_of_not_mem (h : a ∉ s) : (insert a s).card = s.card + 1

{α : Type u_1}
{s : Finset α}
{a : α}
[DecidableEq α]
(h : a ∉ s)


theorem coe_bot [OrderBot α] [OrderBot (Subtype p)] (hbot : p ⊥) : ((⊥ : Subtype p) : α) = ⊥

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


/-- If the image of a family of points in affine space under an affine transformation is affine-
independent, then the original family of points is also affine-independent. -/
theorem AffineIndependent.of_comp {p : ι → P} (f : P →ᵃ[k] P₂) (hai : AffineIndependent k (f ∘ p)) :
    AffineIndependent k p

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{V₂ : Type u_5}
{P₂ : Type u_6}
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{p : ι → P}
(f : P →ᵃ[k] P₂)
(hai : AffineIndependent k (⇑f ∘ p))


@[to_additive]
theorem map_comap_eq (f : F) (S : Submonoid N) : (S.comap f).map f = S ⊓ MonoidHom.mrange f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)
(S : Submonoid N)

Submonoid.map f (Submonoid.comap f S) = S ⊓ MonoidHom.mrange f


theorem ext_iff {inst₁ inst₂ : NonAssocRing R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

{R : Type u}
{inst₁ inst₂ : NonAssocRing R}

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


@[simp]
theorem rangeRestrict_apply (x : L) : f.rangeRestrict x = ⟨f x, f.mem_range_self x⟩

{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₂)
(x : L)


theorem iUnion_decode₂_disjoint_on {f : β → Set α} (hd : Pairwise (Disjoint on f)) :
    Pairwise (Disjoint on fun i => ⋃ b ∈ decode₂ β i, f b)

{α : Type u_1}
{β : Type u_2}
[Encodable β]
{f : β → Set α}
(hd : Pairwise (Disjoint on f))

Pairwise (Disjoint on fun i => ⋃ b ∈ Encodable.decode₂ β i, f b)


theorem omegaLimit_eq_biInter_inter {v : Set τ} (hv : v ∈ f) :
    ω f ϕ s = ⋂ u ∈ f, closure (image2 ϕ (u ∩ v) s)

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(f : Filter τ)
(ϕ : τ → α → β)
(s : Set α)
{v : Set τ}
(hv : v ∈ f)

omegaLimit f ϕ s = ⋂ u ∈ f, closure (Set.image2 ϕ (u ∩ v) s)


theorem single_zero_one_eq_one : (Finsupp.single 0 1 : R[T;T⁻¹]) = (1 : R[T;T⁻¹])


theorem liftRingHom_apply_div {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ)
    (p q : K[X]) : liftRingHom φ hφ (algebraMap _ _ p / algebraMap _ _ q) = φ p / φ q

{K : Type u}
[CommRing K]
[IsDomain K]
{L : Type u_1}
[Field L]
(φ : K[X] →+* L)
(hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰)
(p q : K[X])

(RatFunc.liftRingHom φ hφ) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q) = φ p / φ q


lemma IsRatCondKernelCDF.tendsto_atTop_one (hf : IsRatCondKernelCDF f κ ν) (a : α) :
    ∀ᵐ b ∂(ν a), Tendsto (f (a, b)) atTop (𝓝 1)

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)

∀ᵐ (b : β) ∂ν a, Filter.Tendsto (f (a, b)) Filter.atTop (𝓝 1)


theorem lcm_dvd_lcm [GCDMonoid α] {a b c d : α} (hab : a ∣ b) (hcd : c ∣ d) : lcm a c ∣ lcm b d

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{a b c d : α}
(hab : a ∣ b)
(hcd : c ∣ d)


@[to_additive (attr := simp)]
theorem preimage_mul_right_singleton : (· * a) ⁻¹' {b} = {b * a⁻¹}


theorem mem_primeFactorsList_iff_dvd {n p : ℕ} (hn : n ≠ 0) (hp : Prime p) :
    p ∈ primeFactorsList n ↔ p ∣ n

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


@[simp]
theorem symm_symm (F : HomotopyRel f₀ f₁ S) : F.symm.symm = F

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


@[to_additive prod_comp_prodMap]
theorem prod_comp_prodMap (f : P →* M) (g : P →* N) (f' : M →* M') (g' : N →* N') :
    (f'.prodMap g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
{M' : Type u_8}
{N' : Type u_9}
[AddZeroClass M']
[AddZeroClass N']
[AddZeroClass P]
(f : P →+ M)
(g : P →+ N)
(f' : M →+ M')
(g' : N →+ N')


@[simp]
theorem not_duplicate_singleton (x y : α) : ¬x ∈+ [y]


theorem nhds_zero : 𝓝 (0 : ℝ≥0) = ⨅ (a : ℝ≥0) (_ : a ≠ 0), 𝓟 (Iio a)


theorem iInf_sum {f : β ⊕ γ → α} : ⨅ x, f x = (⨅ i, f (Sum.inl i)) ⊓ ⨅ j, f (Sum.inr j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β ⊕ γ → α}


theorem prime_def_lt {p : ℕ} : Prime p ↔ 2 ≤ p ∧ ∀ m < p, m ∣ p → m = 1

Nat.Prime p ↔ 2 ≤ p ∧ ∀ (m : ℕ), m < p → m ∣ p → m = 1


@[gcongr] lemma smul_lt_smul_of_pos_left [PosSMulStrictMono α β] (hb : b₁ < b₂) (ha : 0 < a) :
    a • b₁ < a • b₂

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


/-- A vector space over a field is isomorphic to its dual if and only if it is finite-dimensional:
  a consequence of the Erdős-Kaplansky theorem. -/
theorem linearEquiv_dual_iff_finiteDimensional [Field K] [AddCommGroup V] [Module K V] :
    Nonempty (V ≃ₗ[K] Dual K V) ↔ FiniteDimensional K V

{K : Type uK}
{V : Type uV}
[Field K]
[AddCommGroup V]
[Module K V]

Nonempty (V ≃ₗ[K] Module.Dual K V) ↔ FiniteDimensional K V


/-- The colimit cocone for `F : J ⥤ C` lifts to a cocone in `Over (colimit F)` with cone point
    `𝟙 (colimit F)`. This is automatically also a colimit cocone. -/
@[simps]
noncomputable def colimit.toOver (F : J ⥤ C) [HasColimit F] :
    Cocone (colimit.toCostructuredArrow F ⋙ CostructuredArrow.toOver _ _)

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

(CategoryTheory.Limits.colimit.toOver F).ι.app j = CategoryTheory.Over.homMk (CategoryTheory.Limits.colimit.ι F j) ⋯


theorem range_algebraMap_eq : (valuation A K).integer = (algebraMap A K).range

(A : Type u)
[CommRing A]
(K : Type v)
[Field K]
[Algebra A K]
[IsDomain A]
[ValuationRing A]
[IsFractionRing A K]

(ValuationRing.valuation A K).integer = (algebraMap A K).range


theorem integrable_finset_sum' {ι} (s : Finset ι) {f : ι → α → β}
    (hf : ∀ i ∈ s, Integrable (f i) μ) : Integrable (∑ i ∈ s, f i) μ

{f : ι → α → β}

(hf : ∀ i ∈ s, MeasureTheory.Integrable (f i) μ)

MeasureTheory.Integrable (∑ i ∈ s, f i) μ


theorem floor_lt_one (ha : 0 ≤ a) : ⌊a⌋₊ < 1 ↔ a < 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(ha : 0 ≤ a)


theorem image_mem_nhds (hf : IsOpenMap f) {x : X} {s : Set X} (hx : s ∈ 𝓝 x) : f '' s ∈ 𝓝 (f x)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
{x : X}
{s : Set X}
(hx : s ∈ 𝓝 x)


@[to_additive (attr := simp)]
theorem quot_liftOn_mk (β : Type v) (f : List (α × Bool) → β)
    (H : ∀ L₁ L₂, Red.Step L₁ L₂ → f L₁ = f L₂) : Quot.liftOn (mk L) f H = f L

(H : ∀ (L₁ L₂ : List (α × Bool)), FreeGroup.Red.Step L₁ L₂ → f L₁ = f L₂)


theorem injective_iff_hasLeftInverse : Injective f ↔ HasLeftInverse f

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

Function.Injective f ↔ Function.HasLeftInverse f


theorem TendstoUniformly.prod_map {ι' α' β' : Type*} [UniformSpace β'] {F' : ι' → α' → β'}
    {f' : α' → β'} {p' : Filter ι'} (h : TendstoUniformly F f p) (h' : TendstoUniformly F' f' p') :
    TendstoUniformly (fun i : ι × ι' => Prod.map (F i.1) (F' i.2)) (Prod.map f f') (p ×ˢ p')

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
{ι' : Type u_1}
{α' : Type u_2}
{β' : Type u_3}
[UniformSpace β']
{F' : ι' → α' → β'}
{f' : α' → β'}
{p' : Filter ι'}
(h : TendstoUniformly F f p)
(h' : TendstoUniformly F' f' p')

TendstoUniformly (fun i => Prod.map (F i.1) (F' i.2)) (Prod.map f f') (p ×ˢ p')


theorem abs_re_le_abs (z : ℂ) : |z.re| ≤ Complex.abs z


theorem mapRange.addMonoidHom_comp (f : ∀ i, β₁ i →+ β₂ i) (f₂ : ∀ i, β i →+ β₁ i) :
    (mapRange.addMonoidHom fun i => (f i).comp (f₂ i)) =
      (mapRange.addMonoidHom f).comp (mapRange.addMonoidHom f₂)

{ι : Type u}
{β : ι → Type v}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → AddZeroClass (β i)]
[(i : ι) → AddZeroClass (β₁ i)]
[(i : ι) → AddZeroClass (β₂ i)]
(f : (i : ι) → β₁ i →+ β₂ i)
(f₂ : (i : ι) → β i →+ β₁ i)

(DFinsupp.mapRange.addMonoidHom fun i => (f i).comp (f₂ i)) =
  (DFinsupp.mapRange.addMonoidHom f).comp (DFinsupp.mapRange.addMonoidHom f₂)


@[simp]
theorem symmetrify_reverse {a b : Symmetrify V} (e : a ⟶ b) : reverse e = e.swap

{V : Type u_2}
[Quiver V]
{a b : Quiver.Symmetrify V}
(e : a ⟶ b)


theorem IsPWO.image_of_monotoneOn (hs : s.IsPWO) {f : α → β} (hf : MonotoneOn f s) :
    IsPWO (f '' s)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{s : Set α}
(hs : s.IsPWO)
{f : α → β}
(hf : MonotoneOn f s)


lemma zero_zpow : ∀ n : ℤ, n ≠ 0 → (0 : G₀) ^ n = 0

{G₀ : Type u_3}
[GroupWithZero G₀]
(n : ℤ)


@[aesop safe apply (rule_sets := [finsetNonempty])]
lemma insertNone_nonempty {s : Finset α} : insertNone s |>.Nonempty


@[to_additive] lemma zpow_lt_zpow_iff' (hn : 0 < n) : a ^ n < b ^ n ↔ a < b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{n : ℤ}
{a b : α}
(hn : 0 < n)


theorem linearIndependent_iff_smaller (o : Ordinal) :
    LinearIndependent ℤ (GoodProducts.eval (π C (ord I · < o))) ↔
    LinearIndependent ℤ (fun (p : smaller C o) ↦ p.1)

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
(o : Ordinal.{u})

LinearIndependent ℤ
    (Profinite.NobelingProof.GoodProducts.eval
      (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o)) ↔
  LinearIndependent ℤ fun (p : ↑(Profinite.NobelingProof.GoodProducts.smaller C o)) => ↑p


/-- Given a localization map `f : M →* N` for a submonoid `S ⊆ M`, for all `z : N` we have that if
`x : M, y ∈ S` are such that `z * f y = f x`, then `f x * (f y)⁻¹ = z`. -/
@[to_additive (attr := simp)
    "Given a localization map `f : M →+ N` for a Submonoid `S ⊆ M`, for all `z : N`
we have that if `x : M, y ∈ S` are such that `z + f y = f x`, then `f x - f y = z`."]
theorem mk'_sec (z : N) : f.mk' (f.sec z).1 (f.sec z).2 = z

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


theorem pure_sets (a : α) : (pure a : Filter α).sets = { s | a ∈ s }


theorem pair_eq_singleton (a : α) : ({a, a} : Finset α) = {a}


/-- If `f` tends to negative infinity along a nontrivial filter `l`, then
`fun x ↦ f x * r` tends to negative infinity if and only if `0 < r. `-/
theorem tendsto_mul_const_atBot_iff_pos [NeBot l] (h : Tendsto f l atBot) :
    Tendsto (fun x => f x * r) l atBot ↔ 0 < r

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]
(h : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x * r) l Filter.atBot ↔ 0 < r


theorem compl_section_ordSeparatingSet_mem_nhdsWithin_Iic (hd : Disjoint s (closure t))
    (ha : a ∈ s) : (ordConnectedSection <| ordSeparatingSet s t)ᶜ ∈ 𝓝[≤] a

{X : Type u_1}
[LinearOrder X]
[TopologicalSpace X]
[OrderTopology X]
{a : X}
{s t : Set X}
(hd : Disjoint s (closure t))
(ha : a ∈ s)

(s.ordSeparatingSet t).ordConnectedSectionᶜ ∈ 𝓝[≤] a


/-- Prepending the head of a vector to its tail gives the vector. -/
@[simp]
theorem cons_head_tail : ∀ v : Vector α (succ n), cons (head v) (tail v) = v

{α : Type u}
{n : ℕ}
(v : Mathlib.Vector α n.succ)


theorem IsAntichain.maximals_eq (h : IsAntichain r s) : maximals r s = s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(h : IsAntichain r s)


theorem isAtom_iff_eq_single [DecidableEq ι] [∀ i, PartialOrder (π i)]
    [∀ i, OrderBot (π i)] {f : ∀ i, π i} :
    IsAtom f ↔ ∃ i a, IsAtom a ∧ f = Function.update ⊥ i a

{ι : Type u_4}
{π : ι → Type u}
[DecidableEq ι]
[(i : ι) → PartialOrder (π i)]
[(i : ι) → OrderBot (π i)]
{f : (i : ι) → π i}


/-- A natural transformation `R₁ ⟶ R₂` induces a functor `Comma L R₁ ⥤ Comma L R₂`. -/
@[simps]
def mapRight (r : R₁ ⟶ R₂) : Comma L R₁ ⥤ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(r : R₁ ⟶ R₂)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRight L r).obj X).hom = CategoryTheory.CategoryStruct.comp X.hom (r.app X.right)


theorem quasiMeasurePreserving_smul {r : ℝ} (hr : r ≠ 0) :
    QuasiMeasurePreserving (r • ·) μ μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{r : ℝ}
(hr : r ≠ 0)

MeasureTheory.Measure.QuasiMeasurePreserving (fun x => r • x) μ μ


/-- Build a `MulEquiv` from an isomorphism in the category `CommGroup`. -/
@[to_additive (attr := simps!)]
def commGroupIsoToMulEquiv {X Y : CommGrp} (i : X ≅ Y) : X ≃* Y


theorem Continuous.rpow (hf : Continuous f) (hg : Continuous g) (h : ∀ x, f x ≠ 0 ∨ 0 < g x) :
    Continuous fun x => f x ^ g x

{α : Type u_1}
[TopologicalSpace α]
{f g : α → ℝ}
(hf : Continuous f)
(hg : Continuous g)
(h : ∀ (x : α), f x ≠ 0 ∨ 0 < g x)


@[simp]
theorem im_sum (f : α → ℂ) : (∑ i ∈ s, f i).im = ∑ i ∈ s, (f i).im

{α : Type u_1}
(s : Finset α)
(f : α → ℂ)


/-- If `f` is a function to a T₃ space `Y` which has a limit within `A` at any
point of a set `B ⊆ closure A`, then `extendFrom A f` is continuous on `B`. -/
theorem continuousOn_extendFrom [RegularSpace Y] {f : X → Y} {A B : Set X} (hB : B ⊆ closure A)
    (hf : ∀ x ∈ B, ∃ y, Tendsto f (𝓝[A] x) (𝓝 y)) : ContinuousOn (extendFrom A f) B

(hf : ∀ x ∈ B, ∃ y, Filter.Tendsto f (𝓝[A] x) (𝓝 y))


/-- A complete space is defined here using uniformities. A uniform space
  is complete if every Cauchy filter converges. -/
class CompleteSpace (α : Type u) [UniformSpace α] : Prop where
  /-- In a complete uniform space, every Cauchy filter converges. -/
  complete : ∀ {f : Filter α}, Cauchy f → ∃ x, f ≤ 𝓝 x

{α : Type u}
[UniformSpace α]
[self : CompleteSpace α]
{f : Filter α}


lemma Module.not_mem_support_iff :
    p ∉ Module.support R M ↔ Subsingleton (LocalizedModule p.asIdeal.primeCompl M)

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


/-- 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)


theorem eq_C_coeff_zero_iff_natDegree_eq_zero : p = C (p.coeff 0) ↔ p.natDegree = 0

p = Polynomial.C (p.coeff 0) ↔ p.natDegree = 0


@[simp]
theorem compl_bihimp : (a ⇔ b)ᶜ = a ∆ b

{α : Type u_2}
[BooleanAlgebra α]
(a b : α)


theorem rpow_pos_of_nonneg {p : ℝ} {x : ℝ≥0∞} (hx_pos : 0 < x) (hp_nonneg : 0 ≤ p) : 0 < x ^ p


theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
    normAtPlace w x = ‖x.2 ⟨w, hw⟩‖

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

(NumberField.mixedEmbedding.normAtPlace w) x = ‖x.2 ⟨w, hw⟩‖


theorem innerContent_of_isCompact {K : Set G} (h1K : IsCompact K) (h2K : IsOpen K) :
    μ.innerContent ⟨K, h2K⟩ = μ ⟨K, h1K⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
{K : Set G}
(h1K : IsCompact K)
(h2K : IsOpen K)

μ.innerContent { carrier := K, is_open' := h2K } = (fun s => ↑(μ.toFun s)) { carrier := K, isCompact' := h1K }


theorem uniformContinuous {β : Type*} [UniformSpace β] {f : β → Matrix m n 𝕜} :
    UniformContinuous f ↔ ∀ i j, UniformContinuous fun x => f x i j

(m : Type u_1)
(n : Type u_2)
(𝕜 : Type u_3)
[UniformSpace 𝕜]
{β : Type u_4}
[UniformSpace β]
{f : β → Matrix m n 𝕜}

UniformContinuous f ↔ ∀ (i : m) (j : n), UniformContinuous fun x => f x i j


@[to_additive (attr := simp)]
theorem ofQuotientStabilizer_mk (g : α) : ofQuotientStabilizer α x (QuotientGroup.mk g) = g • x

(α : Type u)
{β : Type v}
[AddGroup α]
[AddAction α β]
(x : β)
(g : α)

AddAction.ofQuotientStabilizer α x ↑g = g +ᵥ x


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cone F ≌ Cone (e.functor ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(e : K ≌ J)

(CategoryTheory.Limits.Cones.whiskeringEquivalence e).inverse =
  CategoryTheory.Limits.Cones.whiskering e.inverse ⋙ CategoryTheory.Limits.Cones.postcompose (e.invFunIdAssoc F).hom


/-- A topological basis is one that satisfies the necessary conditions so that
  it suffices to take unions of the basis sets to get a topology (without taking
  finite intersections as well). -/
structure IsTopologicalBasis (s : Set (Set α)) : Prop where
  /-- For every point `x`, the set of `t ∈ s` such that `x ∈ t` is directed downwards.  -/
  exists_subset_inter : ∀ t₁ ∈ s, ∀ t₂ ∈ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
  /-- The sets from `s` cover the whole space. -/
  sUnion_eq : ⋃₀ s = univ
  /-- The topology is generated by sets from `s`. -/
  eq_generateFrom : t = generateFrom s

(self : TopologicalSpace.IsTopologicalBasis s)


@[simp]
theorem coe_zpow (x : { x : K // 0 < x }) (n : ℤ) : ↑(x ^ n) = (x : K) ^ n

{K : Type u_1}
[LinearOrderedField K]
(x : { x // 0 < x })
(n : ℤ)


@[simp, norm_cast]
lemma cast_prod {R : Type*} [CommRing R] (f : α → ℤ) (s : Finset α) :
    (↑(∏ i ∈ s, f i) : R) = ∏ i ∈ s, (f i : R)

{α : Type u_2}
{R : Type u_7}
[CommRing R]
(f : α → ℤ)
(s : Finset α)


theorem mem_cycle {a : α} {l : List α} : ∀ h : l ≠ [], a ∈ l → a ∈ cycle l h

{α : Type u}
{a : α}
{l : List α}
(h : l ≠ [])


theorem subsingleton_or_norm_symm_pos [RingHomIsometric σ₁₂] (e : E ≃SL[σ₁₂] F) :
    Subsingleton E ∨ 0 < ‖(e.symm : F →SL[σ₂₁] E)‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomIsometric σ₂₁]
[RingHomIsometric σ₁₂]
(e : E ≃SL[σ₁₂] F)


@[measurability]
theorem measurable_cos : Measurable cos


theorem dom_denumerable {α β} [Denumerable α] [Primcodable β] {f : α → β} :
    Primrec f ↔ Nat.Primrec fun n => encode (f (ofNat α n))

{α : Type u_4}
{β : Type u_5}
[Denumerable α]
[Primcodable β]
{f : α → β}

Primrec f ↔ Nat.Primrec fun n => Encodable.encode (f (Denumerable.ofNat α n))


@[simp]
theorem cliqueSet_one (G : SimpleGraph α) : G.cliqueSet 1 = Set.range singleton


theorem Ideal.homogeneousCore.gc : GaloisConnection toIdeal (Ideal.homogeneousCore 𝒜)

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]

GaloisConnection HomogeneousIdeal.toIdeal (Ideal.homogeneousCore 𝒜)


theorem sum_def {S : Type*} [AddCommMonoid S] (p : R[X]) (f : ℕ → R → S) :
    p.sum f = ∑ n ∈ p.support, f n (p.coeff n)

{R : Type u}
[Semiring R]
{S : Type u_1}
[AddCommMonoid S]
(p : R[X])
(f : ℕ → R → S)


lemma lt_of_mem_primesBelow {p n : ℕ} (h : p ∈ n.primesBelow) : p < n


theorem intervalIntegral_tendsto_integral_Iic (b : ℝ) (hfi : IntegrableOn f (Iic b) μ)
    (ha : Tendsto a l atBot) :
    Tendsto (fun i => ∫ x in a i..b, f x ∂μ) l (𝓝 <| ∫ x in Iic b, f x ∂μ)

(hfi : MeasureTheory.IntegrableOn f (Set.Iic b) μ)

Filter.Tendsto (fun i => ∫ (x : ℝ) in a i..b, f x ∂μ) l (𝓝 (∫ (x : ℝ) in Set.Iic b, f x ∂μ))


/-- The map from the selfadjoint real subspace to the unitary group. This map only makes sense
over ℂ. -/
@[simps]
noncomputable def selfAdjoint.expUnitary (a : selfAdjoint A) : unitary A

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[StarRing A]
[ContinuousStar A]
[CompleteSpace A]
[StarModule ℂ A]
(a : ↥(selfAdjoint A))

↑(selfAdjoint.expUnitary a) = NormedSpace.exp ℂ (Complex.I • ↑a)


protected lemma connected_iff' {H : G.Subgraph} :
    H.Connected ↔ H.coe.Connected

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}


lemma sum_piFinset_apply (f : κ → α) (s : Finset κ) (i : ι) :
    ∑ g ∈ piFinset fun _ : ι ↦ s, f (g i) = s.card ^ (card ι - 1) • ∑ b ∈ s, f b

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_3}
[DecidableEq ι]
[Fintype ι]
[AddCommMonoid α]
(f : κ → α)
(s : Finset κ)
(i : ι)

∑ g ∈ Fintype.piFinset fun x => s, f (g i) = s.card ^ (Fintype.card ι - 1) • ∑ b ∈ s, f b


/-- In a complete normed ring, a perturbation of `1` by an element `t` of distance less than `1`
from `1` is a unit.  Here we construct its `Units` structure.  -/
@[simps val]
def oneSub (t : R) (h : ‖t‖ < 1) : Rˣ

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(t : R)
(h : ‖t‖ < 1)


theorem isNoetherianRing_of_ringEquiv (R) [Ring R] {S} [Ring S] (f : R ≃+* S) [IsNoetherianRing R] :
    IsNoetherianRing S

(R : Type u_1)
[Ring R]
{S : Type u_2}
[Ring S]
(f : R ≃+* S)
[IsNoetherianRing R]


@[to_additive (attr := simp)]
theorem inv_iSup {ι : Sort*} (S : ι → Submonoid G) : (⨆ i, S i)⁻¹ = ⨆ i, (S i)⁻¹

{G : Type u_2}
[AddGroup G]
{ι : Sort u_6}
(S : ι → AddSubmonoid G)


lemma Algebra.adjoin_nonUnitalSubalgebra (s : Set A) :
    adjoin R (NonUnitalAlgebra.adjoin R s : Set A) = adjoin R s

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

Algebra.adjoin R ↑(NonUnitalAlgebra.adjoin R s) = Algebra.adjoin R s


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

{R : Type u_3}
{A : Type u_4}
[Neg R]
[Neg A]
(x : Unitization R A)


@[to_additive (attr := simp)]
theorem coe_trans (e₁ : M ≃* N) (e₂ : N ≃* P) : ↑(e₁.trans e₂) = e₂ ∘ e₁

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[Mul M]
[Mul N]
[Mul P]
(e₁ : M ≃* N)
(e₂ : N ≃* P)


@[simp]
theorem lcm_dvd_iff {x y z : R} : lcm x y ∣ z ↔ x ∣ z ∧ y ∣ z

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
{x y z : R}

EuclideanDomain.lcm x y ∣ z ↔ x ∣ z ∧ y ∣ z


@[simp]
theorem bot_ne_hyperfilter : (⊥ : Filter α) ≠ hyperfilter α


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

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


theorem isLeft_right (h : LiftRel r s (inl a) y) : y.isLeft

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{y : γ ⊕ δ}
{a : α}
(h : Sum.LiftRel r s (Sum.inl a) y)


theorem minimum_mem {l : List α} {m : α} : (minimum l : WithBot α) = m → m ∈ l

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
{l : List α}
{m : α}


/-- The equivalence between the quaternions over `R` and `R × R × R × R`. -/
@[simps!]
def Quaternion.equivProd (R : Type*) [One R] [Neg R] : ℍ[R] ≃ R × R × R × R

(Quaternion.equivProd R) a = (a.re, a.imI, a.imJ, a.imK)


lemma lt_one_add_iff : m < 1 + n ↔ m ≤ n


theorem card_support_eq_zero {f : α →₀ M} : card f.support = 0 ↔ f = 0

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


theorem lintegral_deterministic' {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    (hf : Measurable f) : ∫⁻ x, f x ∂deterministic g hg a = f (g a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : β → ℝ≥0∞}
{g : α → β}
{a : α}
(hg : Measurable g)
(hf : Measurable f)

∫⁻ (x : β), f x ∂(ProbabilityTheory.Kernel.deterministic g hg) a = f (g a)


theorem mul_inv_eq_one {I : FractionalIdeal A⁰ K} (hI : I ≠ 0) : I * I⁻¹ = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(h : IsDedekindDomainInv A)
{I : FractionalIdeal A⁰ K}
(hI : I ≠ 0)


theorem iteratedFDeriv_succ_const (n : ℕ) (c : F) :
    (iteratedFDeriv 𝕜 (n + 1) fun _ : E ↦ c) = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(n : ℕ)
(c : F)

(iteratedFDeriv 𝕜 (n + 1) fun x => c) = 0


theorem Codisjoint.inf_left (ha : Codisjoint a c) (hb : Codisjoint b c) : Codisjoint (a ⊓ b) c

{α : Type u_1}
[DistribLattice α]
[OrderTop α]
{a b c : α}
(ha : Codisjoint a c)
(hb : Codisjoint b c)


/-- (An auxiliary definition for `functorCategoryMonoidal`.)
Tensor product of natural transformations into `D`, when `D` is monoidal.
-/
@[simps]
def tensorHom : tensorObj F F' ⟶ tensorObj G G'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F G F' G' : C ⥤ D}
(α : F ⟶ G)
(β : F' ⟶ G')
(X : C)

(CategoryTheory.Monoidal.FunctorCategory.tensorHom α β).app X = α.app X ⊗ β.app X


@[simp, norm_cast]
theorem coe_map {f : α → β} (hf : Continuous f) (s : Compacts α) : (s.map f hf : Set β) = f '' s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Continuous f)
(s : TopologicalSpace.Compacts α)

↑(TopologicalSpace.Compacts.map f hf s) = f '' ↑s


@[simp] theorem lmarginal_empty (f : (∀ i, π i) → ℝ≥0∞) : ∫⋯∫⁻_∅, f ∂μ = f

(μ : (i : δ) → MeasureTheory.Measure (π i))

∫⋯∫⁻_∅, f ∂μ = f


/-- If `f : ℕ → F` is multiplicative on coprime arguments, `p ∉ s` is a prime and `m`
is `s`-factored, then `f (p^e * m) = f (p^e) * f m`. -/
lemma factoredNumbers.map_prime_pow_mul {F : Type*} [CommSemiring F] {f : ℕ → F}
    (hmul : ∀ {m n}, Coprime m n → f (m * n) = f m * f n) {s : Finset ℕ} {p : ℕ}
    (hp : p.Prime) (hs : p ∉ s) (e : ℕ) {m : factoredNumbers s} :
    f (p ^ e * m) = f (p ^ e) * f m

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)


theorem coeFn_zpow (f : α →ₘ[μ] γ) (n : ℤ) : ⇑(f ^ n) =ᵐ[μ] (⇑f) ^ n

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[Group γ]
[TopologicalGroup γ]
(f : α →ₘ[μ] γ)
(n : ℤ)


/-- The canonical isomorphism relating `Span f.op g.op` and `(Cospan f g).op` -/
@[simps!]
def spanOp {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    span f.op g.op ≅ walkingCospanOpEquiv.inverse ⋙ (cospan f g).op

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

∀ (X_1 : CategoryTheory.Limits.WalkingSpan),
  (CategoryTheory.Limits.spanOp f g).hom.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op Z))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op X))
            (CategoryTheory.Iso.refl (Opposite.op Y)) val)
        X_1).hom


lemma mul_left_inj_of_invertible [Invertible A] {x y : Matrix m n α} : x * A = y * A ↔ x = y

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


@[to_additive]
nonrec theorem measurableSet_mulSupport {m : MeasurableSpace α} [One β] [TopologicalSpace β]
    [MetrizableSpace β] (hf : StronglyMeasurable f) : MeasurableSet (mulSupport f)

(hf : MeasureTheory.StronglyMeasurable f)


@[to_additive]
theorem op_sup (S₁ S₂ : Submonoid M) : (S₁ ⊔ S₂).op = S₁.op ⊔ S₂.op

{M : Type u_2}
[AddZeroClass M]
(S₁ S₂ : AddSubmonoid M)


/-- Summing the translates of `f` by `ℤ • p` gives a map which is periodic with period `p`.
(This is true without any convergence conditions, since if the sum doesn't converge it is taken to
be the zero map, which is periodic.) -/
theorem periodic_tsum_comp_add_zsmul [AddCommGroup X] [TopologicalAddGroup X] [AddCommMonoid Y]
    [ContinuousAdd Y] [T2Space Y] (f : C(X, Y)) (p : X) :
    Function.Periodic (⇑(∑' n : ℤ, f.comp (ContinuousMap.addRight (n • p)))) p

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[AddCommGroup X]
[TopologicalAddGroup X]
[AddCommMonoid Y]
[ContinuousAdd Y]
[T2Space Y]
(f : C(X, Y))
(p : X)

Function.Periodic (⇑(∑' (n : ℤ), f.comp (ContinuousMap.addRight (n • p)))) p


@[to_additive (attr := simp) toProd_zero]
theorem toProd_one : (1 : NonemptyInterval α).toProd = 1


theorem of_mem_filter {a : α} {l} (h : a ∈ filter p l) : p a

{α : Type u}
{p : α → Bool}
{a : α}
{l : List α}
(h : a ∈ List.filter p l)


lemma app_cond {Z : C} (p : Z ⟶ Y) (hp : S (p ≫ g)) :
    app hG x hx g ≫ G.map p.op = F.map p.op ≫ (x (p ≫ g) hp).app ⟨Over.mk (𝟙 Z)⟩

(hG :
  ⦃Y : C⦄ →
    (f : Y ⟶ X) → CategoryTheory.Limits.IsLimit (G.mapCone (CategoryTheory.Sieve.pullback f S).arrows.cocone.op))

(x : CategoryTheory.Presieve.FamilyOfElements (CategoryTheory.presheafHom F G) S.arrows)

(hp : S.arrows (CategoryTheory.CategoryStruct.comp p g))

CategoryTheory.CategoryStruct.comp (CategoryTheory.PresheafHom.IsSheafFor.app hG x hx g) (G.map p.op) =
  CategoryTheory.CategoryStruct.comp (F.map p.op)
    ((x (CategoryTheory.CategoryStruct.comp p g) hp).app
      (Opposite.op (CategoryTheory.Over.mk (CategoryTheory.CategoryStruct.id Z))))


theorem reverse_trailingCoeff (f : R[X]) : f.reverse.trailingCoeff = f.leadingCoeff

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


@[simp]
theorem pointwise_smul_toAddSubgroup (m : M) (S : Subring R) :
    (m • S).toAddSubgroup = m • S.toAddSubgroup

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Ring R]
[MulSemiringAction M R]
(m : M)
(S : Subring R)


@[simp]
theorem single_pow [Monoid G] {a : G} {b : k} : ∀ n : ℕ, single a b ^ n = single (a ^ n) (b ^ n)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Monoid G]
{a : G}
{b : k}
(n : ℕ)

MonoidAlgebra.single a b ^ n = MonoidAlgebra.single (a ^ n) (b ^ n)


theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α)
    [h : HasCountableSeparatingOn α p t] :
    ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧
      ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y

(α : Type u_1)
(p : Set α → Prop)
(t : Set α)
[h : HasCountableSeparatingOn α p t]

∃ S, S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y


theorem strictMonoOn_rpow_Ici_of_exponent_pos {r : ℝ} (hr : 0 < r) :
    StrictMonoOn (fun (x : ℝ) => x ^ r) (Set.Ici 0)

StrictMonoOn (fun x => x ^ r) (Set.Ici 0)


theorem pushout.mapLift_comp {X Y S T S' : C} (f : T ⟶ X) (g : T ⟶ Y) (i : S ⟶ T) (i' : S' ⟶ S)
    [HasPushout f g] [HasPushout (i ≫ f) (i ≫ g)] [HasPushout (i' ≫ i ≫ f) (i' ≫ i ≫ g)]
    [HasPushout ((i' ≫ i) ≫ f) ((i' ≫ i) ≫ g)] :
    pushout.mapLift f g (i' ≫ i) =
      (pushout.congrHom (Category.assoc _ _ _) (Category.assoc _ _ _)).hom ≫
        pushout.mapLift _ _ i' ≫ pushout.mapLift f g i

[CategoryTheory.Limits.HasPushout (i ≫ f) (i ≫ g)]

[CategoryTheory.Limits.HasPushout (i' ≫ i ≫ f) (i' ≫ i ≫ g)]

[CategoryTheory.Limits.HasPushout ((i' ≫ i) ≫ f) ((i' ≫ i) ≫ g)]

CategoryTheory.Limits.pushout.mapLift f g (i' ≫ i) =
  (CategoryTheory.Limits.pushout.congrHom ⋯ ⋯).hom ≫
    CategoryTheory.Limits.pushout.mapLift (i ≫ f) (i ≫ g) i' ≫ CategoryTheory.Limits.pushout.mapLift f g i


/--
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Coalgebra G} (h : A.A ≅ B.A)
    (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a := by aesop_cat) : A ≅ B

(w : CategoryTheory.CategoryStruct.comp A.a (G.map h.hom) = CategoryTheory.CategoryStruct.comp h.hom B.a := by
  aesop_cat)

(CategoryTheory.Comonad.Coalgebra.isoMk h w).hom.f = h.hom


@[to_additive (attr := measurability)]
theorem Finset.measurable_prod (s : Finset ι) (hf : ∀ i ∈ s, Measurable (f i)) :
    Measurable fun a => ∏ i ∈ s, f i a

{M : Type u_2}
{ι : Type u_3}
{α : Type u_4}
[AddCommMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
{f : ι → α → M}
(s : Finset ι)
(hf : ∀ i ∈ s, Measurable (f i))


theorem distortion_le_iff {c : ℝ≥0} : π.distortion ≤ c ↔ ∀ J ∈ π, Box.distortion J ≤ c

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
[Fintype ι]
{c : ℝ≥0}

π.distortion ≤ c ↔ ∀ J ∈ π, J.distortion ≤ c


/-- To bound the Hausdorff measure (or, more generally, for a measure defined using
`MeasureTheory.Measure.mkMetric`) of a set, one may use coverings with maximum diameter tending to
`0`, indexed by any sequence of countable types. -/
theorem mkMetric_le_liminf_tsum {β : Type*} {ι : β → Type*} [∀ n, Countable (ι n)] (s : Set X)
    {l : Filter β} (r : β → ℝ≥0∞) (hr : Tendsto r l (𝓝 0)) (t : ∀ n : β, ι n → Set X)
    (ht : ∀ᶠ n in l, ∀ i, diam (t n i) ≤ r n) (hst : ∀ᶠ n in l, s ⊆ ⋃ i, t n i) (m : ℝ≥0∞ → ℝ≥0∞) :
    mkMetric m s ≤ liminf (fun n => ∑' i, m (diam (t n i))) l

(r : β → ℝ≥0∞)

(ht : ∀ᶠ (n : β) in l, ∀ (i : ι n), EMetric.diam (t n i) ≤ r n)

(m : ℝ≥0∞ → ℝ≥0∞)

(MeasureTheory.Measure.mkMetric m) s ≤ Filter.liminf (fun n => ∑' (i : ι n), m (EMetric.diam (t n i))) l


@[simp] lemma isNilpotent_C_iff :
    IsNilpotent (C r) ↔ IsNilpotent r

IsNilpotent (Polynomial.C r) ↔ IsNilpotent r


@[to_additive (attr := simp)]
theorem unit_one (h : IsUnit (1 : M)) : h.unit = 1

{M : Type u_1}
[AddMonoid M]
(h : IsAddUnit 0)


/-- An affine map on the result of adding a vector to a point produces
the same result as the linear map applied to that vector, added to the
affine map applied to that point. -/
@[simp]
theorem map_vadd (f : P1 →ᵃ[k] P2) (p : P1) (v : V1) : f (v +ᵥ p) = f.linear v +ᵥ f p

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


theorem inverse_compare : pkg.compare pkg' ∘ pkg'.compare pkg = id

{α : Type u_1}
[UniformSpace α]
(pkg pkg' : AbstractCompletion α)


theorem exists_dual_map_eq_bot_of_lt_top (hp : p < ⊤) (hp' : Free R (M ⧸ p)) :
    ∃ f : Dual R M, f ≠ 0 ∧ p.map f = ⊥

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{p : Submodule R M}
(hp : p < ⊤)
(hp' : Module.Free R (M ⧸ p))


theorem exists_finite_card_le_of_finite_of_linearIndependent_of_span (ht : t.Finite)
    (hs : LinearIndependent K (fun x => x : s → V)) (hst : s ⊆ span K t) :
    ∃ h : s.Finite, h.toFinset.card ≤ ht.toFinset.card

(hs : LinearIndependent K fun (x : ↑s) => ↑x)

∃ (h : s.Finite), h.toFinset.card ≤ ht.toFinset.card


theorem projective_def :
    Projective R P ↔ ∃ s : P →ₗ[R] P →₀ R, Function.LeftInverse (Finsupp.total P P R id) s

{R : Type u_1}
[Semiring R]
{P : Type u_2}
[AddCommMonoid P]
[Module R P]

Module.Projective R P ↔ ∃ s, Function.LeftInverse ⇑(Finsupp.total P P R id) ⇑s


@[simp, mfld_simps]
theorem range_id : range (@id α) = univ


@[to_additive, field_simps] -- The attributes are out of order on purpose
theorem div_div_eq_mul_div : a / (b / c) = a * c / b

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


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff₀ {a : M} (ha : a ≠ 0) {S T : Subsemiring R} :
    a • S ≤ a • T ↔ S ≤ T

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


@[to_additive]
theorem smul_finset_subset_smul {s : Finset α} : a ∈ s → a • t ⊆ s • t

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


@[to_additive (attr := simp)]
lemma inv_univ [Fintype α] : (univ : Finset α)⁻¹ = univ

{α : Type u_2}
[DecidableEq α]
[InvolutiveNeg α]
[Fintype α]


@[refl]
theorem antisymmRel_refl [IsRefl α r] (a : α) : AntisymmRel r a a

{α : Type u_1}
(r : α → α → Prop)
[IsRefl α r]
(a : α)


/-- If every finite set of algebraically independent element has cardinality at most `n`,
then the same is true for arbitrary sets of algebraically independent elements. -/
theorem algebraicIndependent_bounded_of_finset_algebraicIndependent_bounded {n : ℕ}
    (H : ∀ s : Finset A, (AlgebraicIndependent R fun i : s => (i : A)) → s.card ≤ n) :
    ∀ s : Set A, AlgebraicIndependent R ((↑) : s → A) → Cardinal.mk s ≤ n

(H : ∀ (s : Finset A), (AlgebraicIndependent R fun i => ↑i) → s.card ≤ n)

AlgebraicIndependent R Subtype.val → Cardinal.mk ↑s ≤ ↑n


theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ

{n : ℕ}
{P : MvPFunctor.{u} n}
{α : TypeVec.{u} n}
(a : P.A)
(f : P.B a ⟹ α)
(i : Fin2 n)

MvFunctor.supp ⟨a, f⟩ i = f i '' Set.univ


theorem dedup_add (s t : Multiset α) : dedup (s + t) = ndunion s (dedup t)

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


theorem infinitePos_add_infinitePos {x y : ℝ*} :
    InfinitePos x → InfinitePos y → InfinitePos (x + y)

x.InfinitePos → y.InfinitePos → (x + y).InfinitePos


theorem mul_left_eq_iff_eq_invOf_mul : c * a = b ↔ a = ⅟c * b

{α : Type u}
[Monoid α]
{a b c : α}
[Invertible c]


@[to_additive]
theorem MonoidHom.comp_assoc {Q : Type*} [MulOneClass M] [MulOneClass N] [MulOneClass P]
    [MulOneClass Q] (f : M →* N) (g : N →* P) (h : P →* Q) :
    (h.comp g).comp f = h.comp (g.comp f)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_10}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
[AddZeroClass Q]
(f : M →+ N)
(g : N →+ P)
(h : P →+ Q)


theorem injective_of_mono_of_preservesPullback {X Y : C} (f : X ⟶ Y) [Mono f]
    [PreservesLimitsOfShape WalkingCospan (forget C)] : Function.Injective f

[CategoryTheory.Limits.PreservesLimitsOfShape CategoryTheory.Limits.WalkingCospan (CategoryTheory.forget C)]


/-- If `‖r‖ < 1`, then `∑' n : ℕ, n * r ^ n = r / (1 - r) ^ 2`. -/
theorem tsum_coe_mul_geometric_of_norm_lt_one {𝕜 : Type*} [NormedDivisionRing 𝕜] [CompleteSpace 𝕜]
    {r : 𝕜} (hr : ‖r‖ < 1) : (∑' n : ℕ, n * r ^ n : 𝕜) = r / (1 - r) ^ 2

{𝕜 : Type u_4}
[NormedDivisionRing 𝕜]
[CompleteSpace 𝕜]
{r : 𝕜}
(hr : ‖r‖ < 1)


@[simp]
theorem sumCompl_apply_inr {α : Type u} (s : Set α) [DecidablePred (· ∈ s)] (x : (sᶜ : Set α)) :
    Equiv.Set.sumCompl s (Sum.inr x) = x

{α : Type u}
(s : Set α)
[DecidablePred fun x => x ∈ s]
(x : ↑sᶜ)


@[simp]
theorem norm_snd (a : 𝓜(𝕜, A)) : ‖a.snd‖ = ‖a‖

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


@[simp]
theorem quotientEquiv_apply_mk [Fintype ι] (x : E) :
    quotientEquiv b (Submodule.Quotient.mk x) = fractRestrict b x

{E : Type u_1}
{ι : Type u_2}
{K : Type u_3}
[NormedLinearOrderedField K]
[NormedAddCommGroup E]
[NormedSpace K E]
(b : Basis ι K E)
[FloorRing K]
[Fintype ι]
(x : E)

(Zspan.quotientEquiv b) (Submodule.Quotient.mk x) = Zspan.fractRestrict b x


theorem closed_nhds_basis (x : X) : (𝓝 x).HasBasis (fun s : Set X => s ∈ 𝓝 x ∧ IsClosed s) id

{X : Type u_1}
[TopologicalSpace X]
[RegularSpace X]
(x : X)

(𝓝 x).HasBasis (fun s => s ∈ 𝓝 x ∧ IsClosed s) id


theorem insert_inter_of_not_mem (h : a ∉ t) : insert a s ∩ t = s ∩ t

{α : Type u}
{a : α}
{s t : Set α}
(h : a ∉ t)


/-- The associator isomorphism can be passed through a map by swapping the order. -/
@[reassoc]
theorem biprod.associator_natural {U V W X Y Z : C} (f : U ⟶ X) (g : V ⟶ Y) (h : W ⟶ Z) :
    biprod.map (biprod.map f g) h ≫ (biprod.associator _ _ _).hom
      = (biprod.associator _ _ _).hom ≫ biprod.map f (biprod.map g h)

CategoryTheory.Limits.biprod.map (CategoryTheory.Limits.biprod.map f g) h ≫
    (CategoryTheory.Limits.biprod.associator X Y Z).hom =
  (CategoryTheory.Limits.biprod.associator U V W).hom ≫
    CategoryTheory.Limits.biprod.map f (CategoryTheory.Limits.biprod.map g h)


theorem cmp_mul_pos_right [MulPosStrictMono α]
    (ha : 0 < a) (b c : α) : cmp (b * a) (c * a) = cmp b c

{α : Type u}
[Semiring α]
[LinearOrder α]
{a : α}
[MulPosStrictMono α]
(ha : 0 < a)
(b c : α)


/-- `x` is in a monomial ideal generated by `s` iff every element of its support dominates one of
the generators. Note that `si ≤ xi` is analogous to saying that the monomial corresponding to `si`
divides the monomial corresponding to `xi`. -/
theorem mem_ideal_span_monomial_image {x : MvPolynomial σ R} {s : Set (σ →₀ ℕ)} :
    x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ ∀ xi ∈ x.support, ∃ si ∈ s, si ≤ xi

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{x : MvPolynomial σ R}
{s : Set (σ →₀ ℕ)}

x ∈ Ideal.span ((fun s => (MvPolynomial.monomial s) 1) '' s) ↔ ∀ xi ∈ x.support, ∃ si ∈ s, si ≤ xi


@[to_additive (attr := elab_as_elim)]
theorem induction_on₃ {p : Localization S → Localization S → Localization S → Prop} (x y z)
    (H : ∀ x y z : M × S, p (mk x.1 x.2) (mk y.1 y.2) (mk z.1 z.2)) : p x y z

(H : ∀ (x y z : M × ↥S), p (Localization.mk x.1 x.2) (Localization.mk y.1 y.2) (Localization.mk z.1 z.2))


theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
    {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] {μ : Measure β}
    (hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : HasFiniteIntegral (fun x => f x - y₀) μ) :
    Tendsto (fun n => ∫⁻ x, ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ∂μ) atTop (𝓝 0)

(hi : MeasureTheory.HasFiniteIntegral (fun x => f x - y₀) μ)

Filter.Tendsto (fun n => ∫⁻ (x : β), ↑‖↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) x - f x‖₊ ∂μ) Filter.atTop
  (𝓝 0)


theorem moveLeft_le {x : PGame} (o : Numeric x) (i) : x.moveLeft i ≤ x

{x : SetTheory.PGame}
(o : x.Numeric)
(i : x.LeftMoves)


theorem lift_mk_fin (n : ℕ) : lift #(Fin n) = n

Cardinal.lift.{u_1, 0} (Cardinal.mk (Fin n)) = ↑n


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

(f : CategoryTheory.StructuredArrow S T)

f.eta.hom.right = CategoryTheory.CategoryStruct.id f.right


/-- Variant of `mul_lt_of_lt_one_left` for `b` negative instead of positive. -/
theorem lt_mul_of_lt_one_left [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    (hb : b < 0) (h : a < 1) : b < a * b

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

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


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


@[simp]
theorem volumeForm_neg_orientation : (-o).volumeForm = -o.volumeForm

[_i : Fact (FiniteDimensional.finrank ℝ E = n)]


@[to_additive]
theorem exists_list_of_mem_closure {s : Set G} {a : G} (h : a ∈ closure s) :
    ∃ l : List G, (∀ x ∈ l, x ∈ s ∨ x⁻¹ ∈ s) ∧ l.prod = a

{G : Type u_1}
[Group G]
{s : Set G}
{a : G}
(h : a ∈ Group.closure s)

∃ l, (∀ x ∈ l, x ∈ s ∨ x⁻¹ ∈ s) ∧ l.prod = a


lemma isBoundedUnder_ge_add [Add R]
    [CovariantClass R R (fun a b ↦ a + b) (· ≤ ·)] [CovariantClass R R (fun a b ↦ b + a) (· ≤ ·)]
    {u v : α → R} (u_bdd_ge : f.IsBoundedUnder (· ≥ ·) u) (v_bdd_ge : f.IsBoundedUnder (· ≥ ·) v) :
    f.IsBoundedUnder (· ≥ ·) (u + v)

[CovariantClass R R (fun a b => a + b) fun x x_1 => x ≤ x_1]

[CovariantClass R R (fun a b => b + a) fun x x_1 => x ≤ x_1]

(u_bdd_ge : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u)

(v_bdd_ge : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f v)

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f (u + v)


protected theorem SequentialSpace.iSup {ι : Sort*} {t : ι → TopologicalSpace X}
    (h : ∀ i, @SequentialSpace X (t i)) : @SequentialSpace X (⨆ i, t i)

{X : Type u_1}
{ι : Sort u_3}
{t : ι → TopologicalSpace X}
(h : ∀ (i : ι), SequentialSpace X)


theorem symm_le_uniformity : map (@Prod.swap α α) (𝓤 _) ≤ 𝓤 _


@[simp]
theorem smulRight_one_one (c : R₁ →L[R₁] M₂) : smulRight (1 : R₁ →L[R₁] R₁) (c 1) = c

{R₁ : Type u_1}
[Semiring R₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₂]
[TopologicalSpace R₁]
[ContinuousSMul R₁ M₂]
(c : R₁ →L[R₁] M₂)

ContinuousLinearMap.smulRight 1 (c 1) = c


protected theorem add_lt_add_of_le_of_lt [CovariantClass α α (· + ·) (· < ·)]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] (hb : b ≠ ⊥) (hab : a ≤ b) (hcd : c < d) :
    a + c < b + d

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

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


theorem Perm.rec_heq {β : List α → Sort _} {f : ∀ a l, β l → β (a :: l)} {b : β []} {l l' : List α}
    (hl : l ~ l') (f_congr : ∀ {a l l' b b'}, l ~ l' → HEq b b' → HEq (f a l b) (f a l' b'))
    (f_swap : ∀ {a a' l b}, HEq (f a (a' :: l) (f a' l b)) (f a' (a :: l) (f a l b))) :
    HEq (@List.rec α β b f l) (@List.rec α β b f l')

{f : (a : α) → (l : List α) → β l → β (a :: l)}

(f_congr : ∀ {a : α} {l l' : List α} {b : β l} {b' : β l'}, l ~ l' → HEq b b' → HEq (f a l b) (f a l' b'))

(f_swap : ∀ {a a' : α} {l : List α} {b : β l}, HEq (f a (a' :: l) (f a' l b)) (f a' (a :: l) (f a l b)))


@[simp]
theorem Set.Iic.isCoatom_iff {a : Set.Iic b} : IsCoatom a ↔ ↑a ⋖ b

{α : Type u_2}
[PartialOrder α]
{b : α}
{a : ↑(Set.Iic b)}


theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset α → _)


@[to_additive (attr := simp, norm_cast)]
lemma unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q


lemma act_self_act_eq (x y : S) : x ◃ (x ◃ y) = x ◃ y

{S : Type u_1}
[UnitalShelf S]
(x y : S)


protected theorem sub_le_add_right_sub (a i j : Nat) : a - i ≤ a + j - i


/-- A family of sets with the exchange property is an antichain. -/
theorem antichain (hB : Base B) (hB' : Base B') (h : B ⊆ B') : B = B'

{α : Type u_1}
{Base : Set α → Prop}
(exch : Matroid.ExchangeProperty Base)
{B B' : Set α}
(hB : Base B)
(hB' : Base B')
(h : B ⊆ B')