theorem isCycle_swap_mul_aux₁ {α : Type*} [DecidableEq α] :
    ∀ (n : ℕ) {b x : α} {f : Perm α} (_ : (swap x (f x) * f) b ≠ b) (_ : (f ^ n) (f x) = b),
      ∃ i : ℤ, ((swap x (f x) * f) ^ i) (f x) = b

{α : Type u_4}
[DecidableEq α]
(n : ℕ)
{b x : α}
{f : Equiv.Perm α}

(Equiv.swap x (f x) * f) b ≠ b → (f ^ n) (f x) = b → ∃ i, ((Equiv.swap x (f x) * f) ^ i) (f x) = b


@[simp] lemma Finset.univ_sigma_univ : univ.sigma (fun _ ↦ univ) = (univ : Finset (Σ i, κ i))

{ι : Type u_1}
{κ : ι → Type u_5}
[(i : ι) → Fintype (κ i)]
[Fintype ι]

(Finset.univ.sigma fun x => Finset.univ) = Finset.univ


/-- The subpresheaf as a presheaf. -/
@[simps!]
def Subpresheaf.toPresheaf : Cᵒᵖ ⥤ Type w

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)


lemma normalClosure_mono (h : K ≤ K') : normalClosure F K L ≤ normalClosure F K' L

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
(K K' : IntermediateField F L)
[Normal F L]
(h : K ≤ K')

normalClosure F (↥K) L ≤ normalClosure F (↥K') L


@[to_additive]
protected theorem mul_le_iff_le_one_left [MulOneClass α] [i : IsSymmOp α α (· * ·)]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (ha : MulLECancellable a) :
    b * a ≤ a ↔ b ≤ 1

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


@[simp]
theorem upcrossingsBefore_zero' : upcrossingsBefore a b f 0 = 0

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}

MeasureTheory.upcrossingsBefore a b f 0 = 0


@[to_additive (attr := simp)]
theorem coeMonoidHom_apply (s : Finset α) : coeMonoidHom s = s

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


@[simp]
theorem Ico_insert_right (h : a ≤ b) : insert b (Ico a b) = Icc a b

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

insert b (Finset.Ico a b) = Finset.Icc a b


theorem functor_galoisConnection (X : C) :
    GaloisConnection (Sieve.functorPushforward F : Sieve X → Sieve (F.obj X))
      (Sieve.functorPullback F)

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

GaloisConnection (CategoryTheory.Sieve.functorPushforward F) (CategoryTheory.Sieve.functorPullback F)


@[simp]
theorem hadamard_smul [Mul α] [SMul R α] [SMulCommClass R α α] (k : R) : A ⊙ (k • B) = k • A ⊙ B

{α : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_6}
(A B : Matrix m n α)
[Mul α]
[SMul R α]
[SMulCommClass R α α]
(k : R)


theorem mk_eq {f g : PadicSeq p} : mk f = mk g ↔ f ≈ g

(p : ℕ)
[Fact (Nat.Prime p)]
{f g : PadicSeq p}


theorem setOf_dep_eq (M : Matroid α) : {D | M.Dep D} = {I | M.Indep I}ᶜ ∩ Iic M.E

{D | M.Dep D} = {I | M.Indep I}ᶜ ∩ Set.Iic M.E


@[simp]
theorem support_refl : support (Equiv.refl α) = ∅

{α : Type u_1}
[DecidableEq α]
[Fintype α]


theorem IsCompl.compl_eq (h : IsCompl a b) : aᶜ = b

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}
(h : IsCompl a b)


theorem periodic_with_period_zero [AddZeroClass α] (f : α → β) : Periodic f 0

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


theorem comp_apply (f : N →ₗ⁅R,L⁆ P) (g : M →ₗ⁅R,L⁆ N) (m : M) : f.comp g m = f (g m)

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[LieRingModule L M]
[LieRingModule L N]
[LieRingModule L P]
(f : N →ₗ⁅R,L⁆ P)
(g : M →ₗ⁅R,L⁆ N)
(m : M)


theorem sqrt_div (x y : ℝ≥0) : sqrt (x / y) = sqrt x / sqrt y

NNReal.sqrt (x / y) = NNReal.sqrt x / NNReal.sqrt y


@[simp]
theorem darts_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    (p.concat h).darts = p.darts.concat ⟨(v, w), h⟩

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(p : G.Walk u v)
(h : G.Adj v w)

(p.concat h).darts = p.darts.concat { toProd := (v, w), adj := h }


/-- Lagrange multipliers theorem: if `φ : E → ℝ` has a local extremum on the set `{x | f x = f x₀}`
at `x₀`, both `f : E → F` and `φ` are strictly differentiable at `x₀`, and the codomain of `f` is
a complete space, then there exist `Λ : dual ℝ F` and `Λ₀ : ℝ` such that `(Λ, Λ₀) ≠ 0` and
`Λ (f' x) + Λ₀ • φ' x = 0` for all `x`. -/
theorem IsLocalExtrOn.exists_linear_map_of_hasStrictFDerivAt
    (hextr : IsLocalExtrOn φ {x | f x = f x₀} x₀) (hf' : HasStrictFDerivAt f f' x₀)
    (hφ' : HasStrictFDerivAt φ φ' x₀) :
    ∃ (Λ : Module.Dual ℝ F) (Λ₀ : ℝ), (Λ, Λ₀) ≠ 0 ∧ ∀ x, Λ (f' x) + Λ₀ • φ' x = 0

∃ Λ Λ₀, (Λ, Λ₀) ≠ 0 ∧ ∀ (x : E), Λ (f' x) + Λ₀ • φ' x = 0


lemma ofHom_injective {f₁ f₂ : F ⟶ G} (h : ofHom f₁ = ofHom f₂) : f₁ = f₂

(h : CochainComplex.HomComplex.Cochain.ofHom f₁ = CochainComplex.HomComplex.Cochain.ofHom f₂)


/-- The modified completed Riemann zeta function `Λ(s) + 1 / s + 1 / (1 - s)` is entire. -/
theorem differentiable_completedZeta₀ : Differentiable ℂ completedRiemannZeta₀


/-- The element `0` is `M`-regular if and only if `M` is trivial. -/
protected theorem subsingleton (h : IsSMulRegular M (0 : R)) : Subsingleton M

{R : Type u_1}
{M : Type u_3}
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]
(h : IsSMulRegular M 0)


theorem mem_grade_iff' (m : M) (a : R[M]) :
    a ∈ grade R m ↔ a ∈ (LinearMap.range (Finsupp.lsingle m : R →ₗ[R] M →₀ R) :
      Submodule R R[M])

{M : Type u_1}
(R : Type u_3)
[CommSemiring R]
(m : M)
(a : AddMonoidAlgebra R M)

a ∈ AddMonoidAlgebra.grade R m ↔ a ∈ LinearMap.range (Finsupp.lsingle m)


@[simp]
theorem polar_add_right (x y y' : M) : polar Q x (y + y') = 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 y' : M)

QuadraticMap.polar (⇑Q) x (y + y') = QuadraticMap.polar (⇑Q) x y + QuadraticMap.polar (⇑Q) x y'


theorem sub_coe_pi_eq_add_coe_pi (θ : Angle) : θ - π = θ + π

θ - ↑π = θ + ↑π


theorem rpow_lt_one_of_one_lt_of_neg {x : ℝ≥0} {z : ℝ} (hx : 1 < x) (hz : z < 0) : x ^ z < 1


theorem IsAlgebraic.of_pow {r : A} {n : ℕ} (hn : 0 < n) (ht : IsAlgebraic R (r ^ n)) :
    IsAlgebraic R r

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{r : A}
{n : ℕ}
(hn : 0 < n)
(ht : IsAlgebraic R (r ^ n))


@[simp]
theorem coe_sub (f g : SlashInvariantForm Γ k) : ⇑(f - g) = f - g

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : SlashInvariantForm Γ k)


theorem depth_pos (t : WType β) : 0 < t.depth

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → Fintype (β a)]
(t : WType β)


{α : Type u_1}
{β : Type u_2}
(r : Rel α β)


theorem IsLittleO.add_add (h₁ : f₁ =o[l] g₁) (h₂ : f₂ =o[l] g₂) :
    (fun x => f₁ x + f₂ x) =o[l] fun x => ‖g₁ x‖ + ‖g₂ x‖

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{l : Filter α}
{f₁ f₂ : α → E'}
{g₁ g₂ : α → F'}
(h₁ : f₁ =o[l] g₁)
(h₂ : f₂ =o[l] g₂)


lemma funext_iff_of_subsingleton [Subsingleton α] {g : α → β} (x y : α) :
    f x = g y ↔ f = g

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
[Subsingleton α]
{g : α → β}
(x y : α)


theorem edgeDensity_sub_edgeDensity_le_one_sub_mul (hs : s₂ ⊆ s₁) (ht : t₂ ⊆ t₁) (hs₂ : s₂.Nonempty)
    (ht₂ : t₂.Nonempty) :
    edgeDensity r s₂ t₂ - edgeDensity r s₁ t₁ ≤ 1 - s₂.card / s₁.card * (t₂.card / t₁.card)

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}
(hs : s₂ ⊆ s₁)
(ht : t₂ ⊆ t₁)
(hs₂ : s₂.Nonempty)
(ht₂ : t₂.Nonempty)

Rel.edgeDensity r s₂ t₂ - Rel.edgeDensity r s₁ t₁ ≤ 1 - ↑s₂.card / ↑s₁.card * (↑t₂.card / ↑t₁.card)


theorem abs_zpow (z : ℂ) (n : ℤ) : Complex.abs (z ^ n) = Complex.abs z ^ n


lemma latticeClosure_idem (s : Set α) : latticeClosure (latticeClosure s) = latticeClosure s


@[to_additive]
theorem map_le_of_le_comap {T : Subsemigroup N} {f : M →ₙ* N} : S ≤ T.comap f → S.map f ≤ T

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(S : Subsemigroup M)
{T : Subsemigroup N}
{f : M →ₙ* N}

S ≤ Subsemigroup.comap f T → Subsemigroup.map f S ≤ T


@[to_additive]
theorem ContinuousWithinAt.zpow {f : α → G} {x : α} {s : Set α} (hf : ContinuousWithinAt f s x)
    (z : ℤ) : ContinuousWithinAt (fun x => f x ^ z) s x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[TopologicalSpace α]
{f : α → G}
{x : α}
{s : Set α}
(hf : ContinuousWithinAt f s x)
(z : ℤ)


@[norm_cast]
theorem coe_natCast (n : ℕ) : ↑(n : R) = (n : ℍ[R,c₁,c₂])

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(n : ℕ)


theorem inits_eq_tails : ∀ l : List α, l.inits = (reverse <| map reverse <| tails <| reverse l)

l.inits = (List.map List.reverse l.reverse.tails).reverse


theorem circleMap_mem_closedBall (c : ℂ) {R : ℝ} (hR : 0 ≤ R) (θ : ℝ) :
    circleMap c R θ ∈ closedBall c R


lemma prod_swap : (μ.prod ν).map measurable_swap.aemeasurable = ν.prod μ

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)


@[to_additive]
theorem le_tprod (hf : Multipliable f) (i : ι) (hb : ∀ j, j ≠ i → 1 ≤ f j) : f i ≤ ∏' i, f i

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : Multipliable f)
(i : ι)
(hb : ∀ (j : ι), j ≠ i → 1 ≤ f j)


theorem preimage_basicOpen (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) :
    toFun f ⁻¹' (sbo (HomogeneousLocalization.mk z) : Set (PrimeSpectrum (A⁰_ f))) =
      Subtype.val ⁻¹' (pbo z.num.1 : Set (ProjectiveSpectrum 𝒜))

(z : HomogeneousLocalization.NumDenSameDeg 𝒜 (Submonoid.powers f))

AlgebraicGeometry.ProjIsoSpecTopComponent.ToSpec.toFun f ⁻¹' ↑(PrimeSpectrum.basicOpen (HomogeneousLocalization.mk z)) =
  Subtype.val ⁻¹' ↑(ProjectiveSpectrum.basicOpen 𝒜 ↑z.num)


theorem map_map (S : NonUnitalStarSubalgebra R A) (g : B →⋆ₙₐ[R] C) (f : A →⋆ₙₐ[R] B) :
    (S.map f).map g = S.map (g.comp f)

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type w'}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[Module R C]
[Star C]
(S : NonUnitalStarSubalgebra R A)
(g : B →⋆ₙₐ[R] C)
(f : A →⋆ₙₐ[R] B)

NonUnitalStarSubalgebra.map g (NonUnitalStarSubalgebra.map f S) = NonUnitalStarSubalgebra.map (g.comp f) S


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

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

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


theorem denseEmbedding_coe_real : DenseEmbedding ((↑) : ℚ → ℝ)


@[rclike_simps] -- porting note (#10618): was `simp`
theorem norm_conj {z : K} : ‖conj z‖ = ‖z‖


@[to_additive]
theorem Multiset.prod_eq_prod_coe [CommMonoid α] (m : Multiset α) : m.prod = ∏ x : m, (x : α)

{α : Type u_1}
[DecidableEq α]
[AddCommMonoid α]
(m : Multiset α)


protected theorem Nodup.set :
    ∀ {l : List α} {n : ℕ} {a : α} (_ : l.Nodup) (_ : a ∉ l), (l.set n a).Nodup

{α : Type u}
{l : List α}
{n : ℕ}
{a : α}


theorem EventuallyEq.inter {s t s' t' : Set α} {l : Filter α} (h : s =ᶠ[l] t) (h' : s' =ᶠ[l] t') :
    (s ∩ s' : Set α) =ᶠ[l] (t ∩ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s =ᶠ[l] t)
(h' : s' =ᶠ[l] t')


/-- The cartesian product of `C^n` functions at a point is `C^n`. -/
theorem ContDiffAt.prod {f : E → F} {g : E → G} (hf : ContDiffAt 𝕜 n f x)
    (hg : ContDiffAt 𝕜 n g x) : ContDiffAt 𝕜 n (fun x : E => (f x, g x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{n : ℕ∞}
{f : E → F}
{g : E → G}
(hf : ContDiffAt 𝕜 n f x)
(hg : ContDiffAt 𝕜 n g x)


@[to_additive]
lemma tprod_of_nat_of_neg [T2Space G] {f : ℤ → G}
    (hf₁ : Multipliable fun n : ℕ ↦ f n) (hf₂ : Multipliable fun n : ℕ ↦ f (-n)) :
    ∏' n : ℤ, f n = (∏' n : ℕ, f n) * (∏' n : ℕ, f (-n)) / f 0

{G : Type u_2}
[CommGroup G]
[TopologicalSpace G]
[TopologicalGroup G]
[T2Space G]
{f : ℤ → G}
(hf₁ : Multipliable fun n => f ↑n)
(hf₂ : Multipliable fun n => f (-↑n))


@[simp, norm_cast, rclike_simps]
theorem ofReal_re : ∀ r : ℝ, re (r : K) = r


theorem reindexFinsetRange_self (i : ι) (h := Finset.mem_image_of_mem b (Finset.mem_univ i)) :
    b.reindexFinsetRange ⟨b i, h⟩ = b i

(h : b i ∈ Finset.image (⇑b) Finset.univ := ⋯)


theorem convex_Iio (r : β) : Convex 𝕜 (Iio r)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r : β)


@[simp] -- Porting note: adjusted LHS because `simpNF` complained it simplified.
theorem linearIsometryBoundedOfCompact_toAddEquiv :
    ((linearIsometryBoundedOfCompact α E 𝕜).toLinearEquiv : C(α, E) ≃+ (α →ᵇ E)) =
      addEquivBoundedOfCompact α E

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
{𝕜 : Type u_4}
[NormedField 𝕜]
[NormedSpace 𝕜 E]

↑(ContinuousMap.linearIsometryBoundedOfCompact α E 𝕜).toLinearEquiv = ContinuousMap.addEquivBoundedOfCompact α E


theorem eq_zero_or_eq_succ {n : Nat} : ∀ i : Fin (n + 1), i = 0 ∨ ∃ j : Fin n, i = j.succ


@[to_additive]
theorem MonoidHom.toOneHom_injective [MulOneClass M] [MulOneClass N] :
    Function.Injective (MonoidHom.toOneHom : (M →* N) → OneHom M N)

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]


theorem isSeparatedMap_iff_isClosed_diagonal {f : X → Y} :
    IsSeparatedMap f ↔ IsClosed f.pullbackDiagonal

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

IsSeparatedMap f ↔ IsClosed (Function.pullbackDiagonal f)


/-- Additive subgroups of an additive group `A` are isomorphic to subgroups of `Multiplicative A`.
-/
@[simps!]
def AddSubgroup.toSubgroup : AddSubgroup A ≃o Subgroup (Multiplicative A)

{A : Type u_4}
[AddGroup A]
(S : AddSubgroup A)

↑(AddSubgroup.toSubgroup S) = ⇑Multiplicative.toAdd ⁻¹' ↑S


theorem coordinate_eval_5 :
    (coordinate 5).eval (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: t)) = a5

{a0 a1 a2 a3 a4 a5 : Int}
{t : List Int}

(Lean.Omega.LinearCombo.coordinate 5).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: t)) = a5


@[to_additive]
theorem r_of_eq {x y : M × S} (h : ↑y.2 * x.1 = ↑x.2 * y.1) : r S x y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{x y : M × ↥S}
(h : ↑y.2 + x.1 = ↑x.2 + y.1)


/-- This can be used to prove
```lean
example (a b c d : α) : transpose !![a, b; c, d] = !![a, c; b, d] := (transposeᵣ_eq _).symm
```
-/
@[simp]
theorem transposeᵣ_eq : ∀ {m n} (A : Matrix (Fin m) (Fin n) α), transposeᵣ A = transpose A

{α : Type u_1}
{m n : ℕ}
(A : Matrix (Fin m) (Fin n) α)


@[simp]
theorem ceil_natCast (n : ℕ) : ⌈(n : α)⌉₊ = n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(n : ℕ)


/-- In this situation, `F` is also initial, see
    `Functor.initial_of_exists_of_isCofiltered_of_fullyFaithful`. -/
theorem IsCofilteredOrEmpty.of_exists_of_isCofiltered_of_fullyFaithful [IsCofilteredOrEmpty D]
    [F.Full] [F.Faithful] (h : ∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) : IsCofilteredOrEmpty C

(h : ∀ (d : D), ∃ c, Nonempty (F.obj c ⟶ d))


theorem sups_union_right : s ⊻ (t₁ ∪ t₂) = s ⊻ t₁ ∪ s ⊻ t₂

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


@[simp] theorem mul_cons₂ : (x::xs : IntList) * (y::ys) = (x * y) :: (xs * ys)

{x : Int}
{xs : List Int}
{y : Int}
{ys : List Int}


@[reassoc (attr := simp)]
lemma π₁Toπ₂_comp_π₂Toπ₃ : (π₁Toπ₂ : (_ : _ ⥤ C) ⟶ _) ≫ π₂Toπ₃ = 0

CategoryTheory.CategoryStruct.comp CategoryTheory.ShortComplex.π₁Toπ₂ CategoryTheory.ShortComplex.π₂Toπ₃ = 0


@[simp] lemma Quotient.range_mk'' {sa : Setoid α} : range (Quotient.mk'' (s₁ := sa)) = univ


/--
To prove Fermat's Last Theorem, it suffices to prove it for odd prime exponents.
-/
theorem FermatLastTheorem.of_odd_primes
    (hprimes : ∀ p : ℕ, Nat.Prime p → Odd p → FermatLastTheoremFor p) : FermatLastTheorem

(hprimes : ∀ (p : ℕ), Nat.Prime p → Odd p → FermatLastTheoremFor p)


/-- The map `g` from `V` to `V₂` corresponding to a map `f` from `P` to `P₂`, at a base point `p`,
is an isometry if `f` is one. -/
theorem vadd_vsub {f : P → P₂} (hf : Isometry f) {p : P} {g : V → V₂}
    (hg : ∀ v, g v = f (v +ᵥ p) -ᵥ f p) : Isometry g

(hg : ∀ (v : V), g v = f (v +ᵥ p) -ᵥ f p)


@[simp]
theorem lift_symm_apply (f : G →* H) (a : Generators G) : (lift.symm f) a = f (of a)

{G : Type u_1}
[Group G]
[IsFreeGroup G]
{H : Type u_2}
[Group H]
(f : G →* H)
(a : IsFreeGroup.Generators G)

IsFreeGroup.lift.symm f a = f (IsFreeGroup.of a)


lemma induce_pair_connected_of_adj {u v : V} (huv : G.Adj u v) :
    (G.induce {u, v}).Connected

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(huv : G.Adj u v)


/-- Taking a subset of the rows and permuting the columns reduces the rank. -/
theorem rank_submatrix_le [StrongRankCondition R] [Fintype m] (f : n → m) (e : n ≃ m)
    (A : Matrix m m R) : rank (A.submatrix f e) ≤ rank A

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[StrongRankCondition R]
[Fintype m]
(f : n → m)
(e : n ≃ m)
(A : Matrix m m R)


theorem subset_vanishingIdeal_zeroLocus (s : Set R) : s ⊆ vanishingIdeal (zeroLocus s)

{R : Type u}
[CommSemiring R]
(s : Set R)

s ⊆ ↑(PrimeSpectrum.vanishingIdeal (PrimeSpectrum.zeroLocus s))


theorem doset_union_leftCoset (H K : Subgroup G) (a : G) :
    ⋃ h : H, (h * a : G) • ↑K = doset a H K

{G : Type u_1}
[Group G]
(H K : Subgroup G)
(a : G)

⋃ h, (↑h * a) • ↑K = Doset.doset a ↑H ↑K


theorem leftMoves_nim (o : Ordinal) : (nim o).LeftMoves = o.out.α

(SetTheory.PGame.nim o).LeftMoves = (Quotient.out o).α


nonrec theorem Filter.EventuallyEq.self_of_nhdsSet {f g : X → Y} (h : f =ᶠ[𝓝ˢ s] g) : EqOn f g s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{s : Set X}
{f g : X → Y}
(h : f =ᶠ[𝓝ˢ s] g)


/-- Subtracting two points in the affine span produces a vector in the spanning submodule. -/
theorem vsub_mem_vectorSpan_of_mem_spanPoints_of_mem_spanPoints {s : Set P} {p1 p2 : P}
    (hp1 : p1 ∈ spanPoints k s) (hp2 : p2 ∈ spanPoints k s) : p1 -ᵥ p2 ∈ vectorSpan k s

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p1 p2 : P}
(hp1 : p1 ∈ spanPoints k s)
(hp2 : p2 ∈ spanPoints k s)


/-- A perfect field.

See also `PerfectRing` for a generalisation in positive characteristic. -/
class PerfectField (K : Type*) [Field K] : Prop where
  /-- A field is perfect if every irreducible polynomial is separable. -/
  separable_of_irreducible : ∀ {f : K[X]}, Irreducible f → f.Separable

{K : Type u_1}
[Field K]
[self : PerfectField K]
{f : K[X]}


@[simp, norm_cast]
theorem coe_neg : ((-x : R) : ℍ[R,c₁,c₂]) = -x

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)


@[simp, norm_cast]
theorem cast_inv (n) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹

{α : Type u_3}
[DivisionRing α]
[CharZero α]
(n : ℚ)

↑n⁻¹ = (↑n)⁻¹


@[simp]
theorem center_eq_top (R) [NonUnitalCommSemiring R] : center R = ⊤

(R : Type u_1)
[NonUnitalCommSemiring R]


theorem nfpFamily_lt_ord_lift_of_isRegular {ι} {f : ι → Ordinal → Ordinal} {c} (hc : IsRegular c)
    (hι : Cardinal.lift.{v, u} #ι < c) (hc' : c ≠ ℵ₀) (hf : ∀ (i), ∀ b < c.ord, f i b < c.ord) {a}
    (ha : a < c.ord) : nfpFamily.{u, v} f a < c.ord

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

(hf : ∀ (i : ι), ∀ b < c.ord, f i b < c.ord)


theorem MonotoneOn.convex_gt (hf : MonotoneOn f s) (hs : Convex 𝕜 s) (r : β) :
    Convex 𝕜 ({ x ∈ s | r < f x })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : MonotoneOn f s)
(hs : Convex 𝕜 s)
(r : β)


theorem blockDiagonal_injective [DecidableEq o] :
    Function.Injective (blockDiagonal : (o → Matrix m n α) → Matrix _ _ α)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[Zero α]
[DecidableEq o]


/-- Every split mono whose retraction is mono is an iso. -/
theorem IsIso.of_mono_retraction {X Y : C} (f : X ⟶ Y) [hf : IsSplitMono f]
    [hf' : Mono <| retraction f] : IsIso f

[hf' : CategoryTheory.Mono (CategoryTheory.retraction f)]


theorem pointCount_eq [Finite P] [Finite L] (l : L) : pointCount P l = order P L + 1

(P : Type u_1)
{L : Type u_2}
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]
(l : L)

Configuration.pointCount P l = Configuration.ProjectivePlane.order P L + 1


theorem inv_invApp (U : Opens X) :
    inv (H.invApp U) =
      f.1.c.app (op (opensFunctor f |>.obj U)) ≫
        X.presheaf.map (eqToHom (by simp [Opens.map, Set.preimage_image_eq _ H.base_open.inj]))

{X Y : AlgebraicGeometry.LocallyRingedSpace}

[H : AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion f]

(U : TopologicalSpace.Opens ↑X.toTopCat)

CategoryTheory.inv (AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion.invApp f U) =
  f.val.c.app (Opposite.op ((AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion.opensFunctor f).obj U)) ≫
    X.presheaf.map (CategoryTheory.eqToHom ⋯)


lemma isPushout_iff_op_map_yoneda_isPullback :
    sq.IsPushout ↔ ∀ (X : C), (sq.op.map (yoneda.obj X)).IsPullback

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

sq.IsPushout ↔ ∀ (X : C), (sq.op.map (CategoryTheory.yoneda.obj X)).IsPullback


/-- `reflectionCircumcenterWeightsWithCircumcenter` sums to 1. -/
@[simp]
theorem sum_reflectionCircumcenterWeightsWithCircumcenter {n : ℕ} {i₁ i₂ : Fin (n + 1)}
    (h : i₁ ≠ i₂) : ∑ i, reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i = 1

∑ i : Affine.Simplex.PointsWithCircumcenterIndex n,
    Affine.Simplex.reflectionCircumcenterWeightsWithCircumcenter i₁ i₂ i =
  1


/-- The identity monad. -/
@[simps!]
def id : Monad C

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

(CategoryTheory.Monad.id C).μ.app X = CategoryTheory.CategoryStruct.id X


theorem sigma_subset_iff :
    s.sigma t ⊆ u ↔ ∀ ⦃i⦄, i ∈ s → ∀ ⦃a⦄, a ∈ t i → (⟨i, a⟩ : Σ i, α i) ∈ u

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{u : Set ((i : ι) × α i)}

s.sigma t ⊆ u ↔ ∀ ⦃i : ι⦄, i ∈ s → ∀ ⦃a : α i⦄, a ∈ t i → ⟨i, a⟩ ∈ u


/--
If `α` is a natural transformation between right adjoints whose conjugate natural transformation is
an isomorphism, then `α` is an isomorphism. The converse is given in `conjugateEquiv_symm_iso`.
-/
theorem conjugateEquiv_symm_of_iso (α : R₁ ⟶ R₂)
    [IsIso ((conjugateEquiv adj₁ adj₂).symm α)] : IsIso α

[CategoryTheory.IsIso ((CategoryTheory.conjugateEquiv adj₁ adj₂).symm α)]


theorem min'_lt_of_mem_erase_min' [DecidableEq α] {a : α} (ha : a ∈ s.erase (s.min' H)) :
    s.min' H < a

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)
[DecidableEq α]
{a : α}
(ha : a ∈ s.erase (s.min' H))


@[simp]
lemma NatTrans.rightDerivedToHomotopyCategory_id (F : C ⥤ D) [F.Additive] :
    NatTrans.rightDerivedToHomotopyCategory (𝟙 F) = 𝟙 _

CategoryTheory.NatTrans.rightDerivedToHomotopyCategory (CategoryTheory.CategoryStruct.id F) =
  CategoryTheory.CategoryStruct.id F.rightDerivedToHomotopyCategory


theorem tensorHom_toLinearMap (f : M →ₗc[R] N) (g : P →ₗc[R] Q) :
    (CoalgebraCat.ofHom f ⊗ CoalgebraCat.ofHom g).1.toLinearMap
      = TensorProduct.map f.toLinearMap g.toLinearMap

{R : Type u}
[CommRing R]
{M N P Q : Type u}
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[AddCommGroup Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Coalgebra R M]
[Coalgebra R N]
[Coalgebra R P]
[Coalgebra R Q]
(f : M →ₗc[R] N)
(g : P →ₗc[R] Q)

(CategoryTheory.MonoidalCategory.tensorHom (CoalgebraCat.ofHom f) (CoalgebraCat.ofHom g)).toCoalgHom.toLinearMap =
  TensorProduct.map f.toLinearMap g.toLinearMap


theorem indep_iff : M.Indep I ↔ ∃ B, M.Base B ∧ I ⊆ B

{α : Type u_1}
{M : Matroid α}
{I : Set α}


theorem swap_mem_antidiagonal [AddCommMonoid A] [HasAntidiagonal A] {n : A} {xy : A × A} :
    xy.swap ∈ antidiagonal n ↔ xy ∈ antidiagonal n

{A : Type u_1}
[AddCommMonoid A]
[Finset.HasAntidiagonal A]
{n : A}
{xy : A × A}

xy.swap ∈ Finset.antidiagonal n ↔ xy ∈ Finset.antidiagonal n


/-- This is basically just `yoneda.obj η : (Over A)ᵒᵖ ⥤ Type (max u v)` restricted along the
    forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way that we land in a
    smaller universe. -/
@[simps]
def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v

{A F : CategoryTheory.Functor Cᵒᵖ (Type v)}

∀ {X Y : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ} (f : X ⟶ Y)
  (u : CategoryTheory.OverPresheafAux.OverArrows η (Opposite.unop X).hom),
  (CategoryTheory.OverPresheafAux.restrictedYonedaObj η).map f u = u.map₂ f.unop.left ⋯


theorem triangle (X Y : Dial C) :
    (associator X (𝟙_ (Dial C)) Y).hom ≫ tensorHom (𝟙 X) (leftUnitor Y).hom =
    tensorHom (rightUnitor X).hom (𝟙 Y)

CategoryTheory.CategoryStruct.comp (X.associator (𝟙_ (CategoryTheory.Dial C)) Y).hom
    (CategoryTheory.Dial.tensorHom (CategoryTheory.CategoryStruct.id X) Y.leftUnitor.hom) =
  CategoryTheory.Dial.tensorHom X.rightUnitor.hom (CategoryTheory.CategoryStruct.id Y)


/-- A content is an additive function on compact sets taking values in `ℝ≥0`. It is a device
from which one can define a measure. -/
structure Content (G : Type w) [TopologicalSpace G] where
  toFun : Compacts G → ℝ≥0
  mono' : ∀ K₁ K₂ : Compacts G, (K₁ : Set G) ⊆ K₂ → toFun K₁ ≤ toFun K₂
  sup_disjoint' :
    ∀ K₁ K₂ : Compacts G, Disjoint (K₁ : Set G) K₂ → IsClosed (K₁ : Set G) → IsClosed (K₂ : Set G)
      → toFun (K₁ ⊔ K₂) = toFun K₁ + toFun K₂
  sup_le' : ∀ K₁ K₂ : Compacts G, toFun (K₁ ⊔ K₂) ≤ toFun K₁ + toFun K₂

{G : Type w}
[TopologicalSpace G]
(self : MeasureTheory.Content G)
(K₁ K₂ : TopologicalSpace.Compacts G)

Disjoint ↑K₁ ↑K₂ → IsClosed ↑K₁ → IsClosed ↑K₂ → self.toFun (K₁ ⊔ K₂) = self.toFun K₁ + self.toFun K₂


lemma LinearEquiv.isSMulRegular_congr' [AddCommMonoid N] [Module S N]
    (e : M ≃ₛₗ[σ] N) (r : R) : IsSMulRegular M r ↔ IsSMulRegular N (σ r)

{R : Type u_3}
{S : Type u_2}
{M : Type u_4}
{N : Type u_1}
[Semiring R]
[Semiring S]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module S N]
(e : M ≃ₛₗ[σ] N)
(r : R)


theorem DifferentiableWithinAt.of_dslope (h : DifferentiableWithinAt 𝕜 (dslope f a) s b) :
    DifferentiableWithinAt 𝕜 f s b


/-- This is the characteristic property of the interpolation: the interpolation is the
unique polynomial of `degree < Fintype.card ι` which takes the value of the `r i` on the `v i`.
-/
theorem eq_interpolate_iff {f : F[X]} (hvs : Set.InjOn v s) :
    (f.degree < s.card ∧ ∀ i ∈ s, eval (v i) f = r i) ↔ f = interpolate s v r

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r : ι → F)
{f : F[X]}
(hvs : Set.InjOn v ↑s)

(f.degree < ↑s.card ∧ ∀ i ∈ s, Polynomial.eval (v i) f = r i) ↔ f = (Lagrange.interpolate s v) r


@[to_additive (attr := simp)] lemma op_inv [Inv α] (x : α) : op x⁻¹ = (op x)⁻¹

MulOpposite.op x⁻¹ = (MulOpposite.op x)⁻¹


@[simp, mfld_simps]
theorem prod_coe (e : PartialEquiv α β) (e' : PartialEquiv γ δ) :
    (e.prod e' : α × γ → β × δ) = fun p => (e p.1, e' p.2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : PartialEquiv α β)
(e' : PartialEquiv γ δ)

↑(e.prod e') = fun p => (↑e p.1, ↑e' p.2)


lemma cfcₙ_sum {ι : Type*} (f : ι → R → R) (a : A) (s : Finset ι)
    (hf : ∀ i ∈ s, ContinuousOn (f i) (σₙ R a) := by cfc_cont_tac)
    (hf0 : ∀ i ∈ s, f i 0 = 0 := by cfc_zero_tac) :
    cfcₙ (∑ i in s, f i) a = ∑ i in s, cfcₙ (f i) a

cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a


theorem gcd_eq_iff (xs : IntList) (g : Nat) :
    xs.gcd = g ↔
      (∀ {a : Int}, a ∈ xs → (g : Int) ∣ a) ∧
        (∀ (c : Nat), (∀ {a : Int}, a ∈ xs → (c : Int) ∣ a) → c ∣ g)

xs.gcd = g ↔ (∀ {a : Int}, a ∈ xs → ↑g ∣ a) ∧ ∀ (c : Nat), (∀ {a : Int}, a ∈ xs → ↑c ∣ a) → c ∣ g


@[simp]
theorem iUnion_ball_nat (x : α) : ⋃ n : ℕ, ball x n = univ

{α : Type u}
[PseudoMetricSpace α]
(x : α)


/-- **AM-GM inequality**: The geometric mean is less than or equal to the arithmetic mean, weighted
version for two `NNReal` numbers. -/
theorem geom_mean_le_arith_mean2_weighted (w₁ w₂ p₁ p₂ : ℝ≥0) :
    w₁ + w₂ = 1 → p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) ≤ w₁ * p₁ + w₂ * p₂

w₁ + w₂ = 1 → p₁ ^ ↑w₁ * p₂ ^ ↑w₂ ≤ w₁ * p₁ + w₂ * p₂


@[simp] theorem cons_append (a : α) (as bs : List α) : (a::as) ++ bs = a::(as ++ bs)


/-- The canonical map out of a direct sum of a family of additive subgroups is injective when the
additive subgroups are `CompleteLattice.Independent`. -/
theorem Independent.dfinsupp_sumAddHom_injective {p : ι → AddSubgroup N} (h : Independent p) :
    Function.Injective (sumAddHom fun i => (p i).subtype)

{ι : Type u_1}
{N : Type u_5}
[DecidableEq ι]
[AddCommGroup N]
{p : ι → AddSubgroup N}
(h : CompleteLattice.Independent p)

Function.Injective ⇑(DFinsupp.sumAddHom fun i => (p i).subtype)


/-- The order isomorphism between the factors of `mk m` and the factors of `mk n` induced by a
  bijection between the factors of `m` and the factors of `n` that preserves `∣`. -/
@[simps]
def mkFactorOrderIsoOfFactorDvdEquiv {m : M} {n : N} {d : { l : M // l ∣ m } ≃ { l : N // l ∣ n }}
    (hd : ∀ l l', (d l : N) ∣ d l' ↔ (l : M) ∣ (l' : M)) :
    Set.Iic (Associates.mk m) ≃o Set.Iic (Associates.mk n)

(hd : ∀ (l l' : { l // l ∣ m }), ↑(d l) ∣ ↑(d l') ↔ ↑l ∣ ↑l')

↑((mkFactorOrderIsoOfFactorDvdEquiv hd) l) = Associates.mk ↑(d ⟨associatesEquivOfUniqueUnits ↑l, ⋯⟩)


theorem norm_embedding_eq (w : InfinitePlace K) (x : K) :
    ‖(embedding w) x‖ = w x

{K : Type u_2}
[Field K]
(w : NumberField.InfinitePlace K)
(x : K)


theorem approx_apply [TopologicalSpace β] [OrderClosedTopology β] [MeasurableSpace β]
    [OpensMeasurableSpace β] {i : ℕ → β} {f : α → β} {n : ℕ} (a : α) (hf : Measurable f) :
    (approx i f n : α →ₛ β) a = (Finset.range n).sup fun k => if i k ≤ f a then i k else 0

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[SemilatticeSup β]
[OrderBot β]
[Zero β]
[TopologicalSpace β]
[OrderClosedTopology β]
[MeasurableSpace β]
[OpensMeasurableSpace β]
{i : ℕ → β}
{f : α → β}
{n : ℕ}
(a : α)
(hf : Measurable f)

↑(MeasureTheory.SimpleFunc.approx i f n) a = (Finset.range n).sup fun k => if i k ≤ f a then i k else 0


/-- A diagram `WalkingCospan ⥤ C` is isomorphic to some `PullbackCone.mk` after
composing with `diagramIsoCospan`. -/
@[simps!]
def PullbackCone.isoMk {F : WalkingCospan ⥤ C} (t : Cone F) :
    (Cones.postcompose (diagramIsoCospan.{v} _).hom).obj t ≅
      PullbackCone.mk (t.π.app WalkingCospan.left) (t.π.app WalkingCospan.right)
        ((t.π.naturality inl).symm.trans (t.π.naturality inr : _))

{F : CategoryTheory.Limits.WalkingCospan ⥤ C}

(CategoryTheory.Limits.PullbackCone.isoMk t).inv.hom = 𝟙 t.pt


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem inner_mul_symm_re_eq_norm (x y : E) : re (⟪x, y⟫ * ⟪y, x⟫) = ‖⟪x, y⟫ * ⟪y, x⟫‖

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

RCLike.re (⟪x, y⟫_𝕜 * ⟪y, x⟫_𝕜) = ‖⟪x, y⟫_𝕜 * ⟪y, x⟫_𝕜‖


/-- Two measures are equal if they have equal restrictions on a spanning collection of sets
  (formulated using `biUnion`). -/
theorem ext_iff_of_biUnion_eq_univ {S : Set ι} {s : ι → Set α} (hc : S.Countable)
    (hs : ⋃ i ∈ S, s i = univ) : μ = ν ↔ ∀ i ∈ S, μ.restrict (s i) = ν.restrict (s i)

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{S : Set ι}
{s : ι → Set α}
(hc : S.Countable)
(hs : ⋃ i ∈ S, s i = Set.univ)


theorem ne_top (h : v₁.IsEquiv v₂) {r : R} : v₁ r ≠ (⊤ : Γ₀) ↔ v₂ r ≠ (⊤ : Γ'₀)

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

v₁ r ≠ ⊤ ↔ v₂ r ≠ ⊤


theorem moebius_apply_prime {p : ℕ} (hp : p.Prime) : μ p = -1


theorem tr_ret_comp (f k) : tr (Λ'.ret (Cont'.comp f k)) = goto fun _ => trNormal f k

(f : Turing.ToPartrec.Code)
(k : Turing.PartrecToTM2.Cont')

Turing.PartrecToTM2.tr (Turing.PartrecToTM2.Λ'.ret (Turing.PartrecToTM2.Cont'.comp f k)) =
  Turing.TM2.Stmt.goto fun x => Turing.PartrecToTM2.trNormal f k


class IncidenceGeometry where
  Point : Type u₁
  Line : Type u₂
  Circle : Type u₃

  between : Point → Point → Point → Prop -- implies colinearity
  onLine : Point → Line → Prop
  onCircle : Point → Circle → Prop
  inCircle : Point → Circle → Prop
  centerCircle : Point → Circle → Prop
  circlesInter : Circle → Circle → Prop

  ne_23_of_between : ∀ {a b c : Point}, between a b c → b ≠ c
  line_unique_of_pts : ∀ {a b : Point}, ∀ {L M : Line},
    a ≠ b → onLine a L → onLine b L → onLine a M → onLine b M → L = M
  onLine_2_of_between : ∀ {a b c : Point}, ∀ {L : Line},
    between a b c → onLine a L → onLine c L → onLine b L
  line_of_pts : ∀ a b, ∃ L, onLine a L ∧ onLine b L
  circle_of_ne : ∀ a b, a ≠ b → ∃ C, centerCircle a C ∧ onCircle b C
  circlesInter_of_onCircle_inCircle :
    ∀ {a b α β}, onCircle b α → onCircle a β → inCircle a α →
    inCircle b β → circlesInter α β
  pts_of_circlesInter : ∀ {α β}, circlesInter α β →
    ∃ a b, a ≠ b ∧ onCircle a α ∧ onCircle a β ∧ onCircle b α ∧ onCircle b β
  inCircle_of_centerCircle : ∀ {a α}, centerCircle a α → inCircle a α

[self : IncidenceGeometry]
{a : IncidenceGeometry.Point}
{α : IncidenceGeometry.Circle}

IncidenceGeometry.centerCircle a α → IncidenceGeometry.inCircle a α


/-- If `f` is locally integrable with respect to `μ.restrict s`, it is locally integrable on `s`.
(See `locallyIntegrableOn_iff_locallyIntegrable_restrict` for an iff statement when `s` is
closed.) -/
theorem locallyIntegrableOn_of_locallyIntegrable_restrict [OpensMeasurableSpace X]
    (hf : LocallyIntegrable f (μ.restrict s)) : LocallyIntegrableOn f s μ

(hf : MeasureTheory.LocallyIntegrable f (μ.restrict s))


/-- If `p` is a finite formal multilinear series, then so is `p.changeOriginSeries k` for every
`k` in `ℕ`. More precisely, if `p m = 0` for `n ≤ m`, then `p.changeOriginSeries k m = 0` for
`n ≤ k + m`.  -/
lemma changeOriginSeries_finite_of_finite (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ}
    (hn : ∀ (m : ℕ), n ≤ m → p m = 0) (k : ℕ) : ∀ {m : ℕ}, n ≤ k + m →
    p.changeOriginSeries k m = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{n : ℕ}
(hn : ∀ (m : ℕ), n ≤ m → p m = 0)
(k : ℕ)
{m : ℕ}


/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

groupCohomology.dTwo A ∘ₗ ↑(groupCohomology.twoCochainsLequiv A) =
  ↑(groupCohomology.threeCochainsLequiv A) ∘ₗ (groupCohomology.inhomogeneousCochains A).d 2 3


/-- Every Galois connection induces a lower adjoint. -/
@[simps]
def GaloisConnection.lowerAdjoint [Preorder α] [Preorder β] {l : α → β} {u : β → α}
    (gc : GaloisConnection l u) : LowerAdjoint u

{α : Type u_1}
{β : Type u_4}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)

∀ (a : α), gc.lowerAdjoint.toFun a = l a


@[simp]
theorem normalizedFactorsEquivOfQuotEquiv_symm (hI : I ≠ ⊥) (hJ : J ≠ ⊥) :
    (normalizedFactorsEquivOfQuotEquiv f hI hJ).symm =
      normalizedFactorsEquivOfQuotEquiv f.symm hJ hI

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[IsDedekindDomain A]
{I : Ideal R}
{J : Ideal A}
[IsDedekindDomain R]
(f : R ⧸ I ≃+* A ⧸ J)
(hI : I ≠ ⊥)
(hJ : J ≠ ⊥)


lemma singularPart_add_rnDeriv (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
    μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) = μ

{α : Type u_1}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)
[μ.HaveLebesgueDecomposition ν]


@[simp]
theorem ofBoxProdLeft_boxProdRight [DecidableEq α] [DecidableRel G.Adj] {a b₁ b₂ : α} :
    ∀ (w : G.Walk b₁ b₂), (w.boxProdRight G a).ofBoxProdRight = w

{α : Type u_1}
{G : SimpleGraph α}
[DecidableEq α]
[DecidableRel G.Adj]
{a b₁ b₂ : α}
(w : G.Walk b₁ b₂)

(SimpleGraph.Walk.boxProdRight G a w).ofBoxProdRight = w


theorem isCobounded_def {s : Set α} : IsCobounded s ↔ s ∈ cobounded α

∀ {x : Bornology α} {s : Set α}, Bornology.IsCobounded s ↔ s ∈ Bornology.cobounded α


/-- If `Y` is a zero object, `X ≅ X ⊞ Y` for any `X`. -/
@[simps!]
def isoBiprodZero {X Y : C} [HasBinaryBiproduct X Y] (hY : IsZero Y) : X ≅ X ⊞ Y

(CategoryTheory.Limits.isoBiprodZero hY).inv = CategoryTheory.Limits.biprod.fst


/-- Indexed version of the above lemma `exists_lt_of_csInf_lt`
When `iInf f < a`, there is an element `i` such that `f i < a`.
-/
theorem exists_lt_of_ciInf_lt [Nonempty ι] {f : ι → α} (h : iInf f < a) : ∃ i, f i < a

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrder α]
{a : α}
[Nonempty ι]
{f : ι → α}
(h : iInf f < a)


private theorem List.of_toArrayAux_eq_toArrayAux {as bs : List α} {cs ds : Array α} (h : as.toArrayAux cs = bs.toArrayAux ds) (hlen : cs.size = ds.size) : as = bs ∧ cs = ds


/-- Suppose we are given a triangle `t₁`, and replace one of its
vertices by its orthocenter, yielding triangle `t₂` (with vertices not
necessarily listed in the same order).  Then the orthocenter of `t₂`
is the vertex of `t₁` that was replaced. -/
theorem orthocenter_replace_orthocenter_eq_point {t₁ t₂ : Triangle ℝ P} {i₁ i₂ i₃ j₁ j₂ j₃ : Fin 3}
    (hi₁₂ : i₁ ≠ i₂) (hi₁₃ : i₁ ≠ i₃) (hi₂₃ : i₂ ≠ i₃) (hj₁₂ : j₁ ≠ j₂) (hj₁₃ : j₁ ≠ j₃)
    (hj₂₃ : j₂ ≠ j₃) (h₁ : t₂.points j₁ = t₁.orthocenter) (h₂ : t₂.points j₂ = t₁.points i₂)
    (h₃ : t₂.points j₃ = t₁.points i₃) : t₂.orthocenter = t₁.points i₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{t₁ t₂ : Affine.Triangle ℝ P}
{i₁ i₂ i₃ j₁ j₂ j₃ : Fin 3}
(hi₁₂ : i₁ ≠ i₂)
(hi₁₃ : i₁ ≠ i₃)
(hi₂₃ : i₂ ≠ i₃)
(hj₁₂ : j₁ ≠ j₂)
(hj₁₃ : j₁ ≠ j₃)
(hj₂₃ : j₂ ≠ j₃)
(h₁ : t₂.points j₁ = t₁.orthocenter)
(h₂ : t₂.points j₂ = t₁.points i₂)
(h₃ : t₂.points j₃ = t₁.points i₃)


theorem hasBasis_iInf' {ι : Type*} {ι' : ι → Type*} {l : ι → Filter α} {p : ∀ i, ι' i → Prop}
    {s : ∀ i, ι' i → Set α} (hl : ∀ i, (l i).HasBasis (p i) (s i)) :
    (⨅ i, l i).HasBasis (fun If : Set ι × ∀ i, ι' i => If.1.Finite ∧ ∀ i ∈ If.1, p i (If.2 i))
      fun If : Set ι × ∀ i, ι' i => ⋂ i ∈ If.1, s i (If.2 i)

(hl : ∀ (i : ι), (l i).HasBasis (p i) (s i))

(⨅ i, l i).HasBasis (fun If => If.1.Finite ∧ ∀ i ∈ If.1, p i (If.2 i)) fun If => ⋂ i ∈ If.1, s i (If.2 i)


lemma isLocallyInjective_whisker [H.IsCocontinuous J K] [IsLocallyInjective K f] :
    IsLocallyInjective J (whiskerLeft H.op f)

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

CategoryTheory.Presheaf.IsLocallyInjective J (CategoryTheory.whiskerLeft H.op f)


@[to_additive (attr := simp)]
theorem toLex_div [Div α] (a b : α) : toLex (a / b) = toLex a / toLex b


theorem eq_empty_of_forall_not_mem {s : Finset α} (H : ∀ x, x ∉ s) : s = ∅

{α : Type u_1}
{s : Finset α}
(H : ∀ (x : α), x ∉ s)


theorem EventuallyLE.congr {f f' g g' : α → β} (H : f ≤ᶠ[l] g) (hf : f =ᶠ[l] f') (hg : g =ᶠ[l] g') :
    f' ≤ᶠ[l] g'

{α : Type u}
{β : Type v}
[LE β]
{l : Filter α}
{f f' g g' : α → β}
(H : f ≤ᶠ[l] g)
(hf : f =ᶠ[l] f')
(hg : g =ᶠ[l] g')


/-- Given a category of complexes with objects in `Vᵒᵖ`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `V`. -/
@[simps]
def unopEquivalence : (HomologicalComplex Vᵒᵖ c)ᵒᵖ ≌ HomologicalComplex V c.symm

(HomologicalComplex.unopEquivalence V c).unitIso = HomologicalComplex.unopUnitIso V c


@[simp]
theorem flip_a : (flip u).a = u.b


theorem Quotient.liftₐ_comp (I : Ideal A) (f : A →ₐ[R₁] B) (hI : ∀ a : A, a ∈ I → f a = 0) :
    (Ideal.Quotient.liftₐ I f hI).comp (Ideal.Quotient.mkₐ R₁ I) = f

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[Semiring B]
[Algebra R₁ B]
(I : Ideal A)
(f : A →ₐ[R₁] B)
(hI : ∀ a ∈ I, f a = 0)


/-- The intersection of a compact set and a closed set is a compact set. -/
theorem IsCompact.inter_right (hs : IsCompact s) (ht : IsClosed t) : IsCompact (s ∩ t)

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


/-- Auxiliary definition for `opEquivalence`. -/
@[simps]
def opFunctor : (HomologicalComplex V c)ᵒᵖ ⥤ HomologicalComplex Vᵒᵖ c.symm

(HomologicalComplex.opFunctor V c).obj X = (Opposite.unop X).op


@[to_additive tsum_sum]
theorem tprod_of_prod {f : γ → β → α} {s : Finset γ} (hf : ∀ i ∈ s, Multipliable (f i)) :
    ∏' b, ∏ i ∈ s, f i b = ∏ i ∈ s, ∏' b, f i b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
[T2Space α]
[ContinuousMul α]
{f : γ → β → α}
{s : Finset γ}
(hf : ∀ i ∈ s, Multipliable (f i))

∏' (b : β), ∏ i ∈ s, f i b = ∏ i ∈ s, ∏' (b : β), f i b


theorem coinduced_id [t : TopologicalSpace α] : t.coinduced id = t


theorem interior_nonempty (s : PositiveCompacts α) : (interior (s : Set α)).Nonempty

(s : TopologicalSpace.PositiveCompacts α)


theorem mem_closure {x : K} {s : Set K} : x ∈ closure s ↔ ∀ S : Subfield K, s ⊆ S → x ∈ S

{K : Type u}
[DivisionRing K]
{x : K}
{s : Set K}

x ∈ Subfield.closure s ↔ ∀ (S : Subfield K), s ⊆ ↑S → x ∈ S


theorem exists_set_subtype {t : Set α} (p : Set α → Prop) :
    (∃ s : Set t, p (((↑) : t → α) '' s)) ↔ ∃ s : Set α, s ⊆ t ∧ p s

{α : Type u_1}
{t : Set α}
(p : Set α → Prop)

(∃ s, p (Subtype.val '' s)) ↔ ∃ s ⊆ t, p s


@[simp]
theorem const_apply (μβ : Measure β) (a : α) : const α μβ a = μβ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(μβ : MeasureTheory.Measure β)
(a : α)

(ProbabilityTheory.Kernel.const α μβ) a = μβ


theorem fold_union_inter [DecidableEq α] {s₁ s₂ : Finset α} {b₁ b₂ : β} :
    ((s₁ ∪ s₂).fold op b₁ f * (s₁ ∩ s₂).fold op b₂ f) = s₁.fold op b₂ f * s₂.fold op b₁ f

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
[DecidableEq α]
{s₁ s₂ : Finset α}
{b₁ b₂ : β}

op (Finset.fold op b₁ f (s₁ ∪ s₂)) (Finset.fold op b₂ f (s₁ ∩ s₂)) =
  op (Finset.fold op b₂ f s₁) (Finset.fold op b₁ f s₂)


@[to_additive]
theorem rangeKerLift_injective : Injective (rangeKerLift φ)

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(φ : G →* H)


theorem coe_equiv_lpPiLp_symm (f : PiLp p E) : (Equiv.lpPiLp.symm f : ∀ i, E i) = f

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


@[norm_cast]
theorem coe_rpow_of_ne_zero {x : ℝ≥0} (h : x ≠ 0) (y : ℝ) : (x : ℝ≥0∞) ^ y = (x ^ y : ℝ≥0)


/-- If `L` is a finite separable extension of `K = Frac(A)`, where `A` is a Dedekind domain,
the integral closure of `A` in `L` is a Dedekind domain.

This cannot be an instance since `K` can't be inferred. See also the instance
`integralClosure.isDedekindDomain_fractionRing` where `K := FractionRing A`. -/
theorem integralClosure.isDedekindDomain [IsDedekindDomain A] :
    IsDedekindDomain (integralClosure A L)

(A : Type u_2)
(K : Type u_3)
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(L : Type u_4)
[Field L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsDedekindDomain A]


theorem coeFn_fourierLp (p : ℝ≥0∞) [Fact (1 ≤ p)] (n : ℤ) :
    @fourierLp T hT p _ n =ᵐ[haarAddCircle] fourier n

↑↑(fourierLp p n) =ᵐ[AddCircle.haarAddCircle] ⇑(fourier n)


/-- If an element `b` becomes left-regular after multiplying it on the left by a left-regular
element, then `b` is left-regular. -/
@[to_additive "If an element `b` becomes add-left-regular after adding to it on the left
an add-left-regular element, then `b` is add-left-regular."]
theorem IsLeftRegular.of_mul (ab : IsLeftRegular (a * b)) : IsLeftRegular b

{R : Type u_1}
[Semigroup R]
{a b : R}
(ab : IsLeftRegular (a * b))


/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly
supported. Version where `g` depends on an additional parameter in an open subset `s` of a
parameter space `P` (and the compact support `k` is independent of the parameter in `s`).
In this version, all the types belong to the same universe (to get an induction working in the
proof). Use instead `contDiffOn_convolution_right_with_param`, which removes this restriction. -/
theorem contDiffOn_convolution_right_with_param_aux {G : Type uP} {E' : Type uP} {F : Type uP}
    {P : Type uP} [NormedAddCommGroup E'] [NormedAddCommGroup F] [NormedSpace 𝕜 E']
    [NormedSpace ℝ F] [NormedSpace 𝕜 F] [CompleteSpace F] [MeasurableSpace G]
    {μ : Measure G}
    [NormedAddCommGroup G] [BorelSpace G] [NormedSpace 𝕜 G] [NormedAddCommGroup P] [NormedSpace 𝕜 P]
    {f : G → E} {n : ℕ∞} (L : E →L[𝕜] E' →L[𝕜] F) {g : P → G → E'} {s : Set P} {k : Set G}
    (hs : IsOpen s) (hk : IsCompact k) (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0)
    (hf : LocallyIntegrable f μ) (hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ)) :
    ContDiffOn 𝕜 n (fun q : P × G => (f ⋆[L, μ] g q.1) q.2) (s ×ˢ univ)

(hgs : ∀ (p : P) (x : G), p ∈ s → x ∉ k → g p x = 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ Set.univ))

ContDiffOn 𝕜 n (fun q => MeasureTheory.convolution f (g q.1) L μ q.2) (s ×ˢ Set.univ)


@[simp]
theorem IsCycle.zpowersEquivSupport_apply {σ : Perm α} (hσ : IsCycle σ) {n : ℕ} :
    hσ.zpowersEquivSupport ⟨σ ^ n, n, rfl⟩ =
      ⟨(σ ^ n) (Classical.choose hσ),
        pow_apply_mem_support.2 (mem_support.2 (Classical.choose_spec hσ).1)⟩

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{σ : Equiv.Perm α}
(hσ : σ.IsCycle)
{n : ℕ}

hσ.zpowersEquivSupport ⟨σ ^ n, ⋯⟩ = ⟨(σ ^ n) (Classical.choose hσ), ⋯⟩


theorem coe_algEquiv_lpBCF (f : lp (fun _ : α ↦ A) ∞) : (AlgEquiv.lpBCF α A 𝕜 f : α → A) = f

{α : Type u_1}
{A : Type u_4}
{𝕜 : Type u_5}
[TopologicalSpace α]
[DiscreteTopology α]
[NormedRing A]
[NormOneClass A]
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 A]
(f : ↥(lp (fun x => A) ⊤))


theorem lt_of_mul_lt_mul_of_nonpos_left [ExistsAddOfLE α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (h : c * a < c * b) (hc : c ≤ 0) : b < a

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


protected theorem Finite.image2 (f : α → β → γ) (hs : s.Finite) (ht : t.Finite) :
    (image2 f s t).Finite

{α : Type u}
{β : Type v}
{γ : Type x}
{s : Set α}
{t : Set β}
(f : α → β → γ)
(hs : s.Finite)
(ht : t.Finite)


theorem coe_ne_zero {f : Polynomial F} (hf : f ≠ 0) : (↑f : PowerSeries F) ≠ 0

{F : Type u}
[Field F]
{f : F[X]}
(hf : f ≠ 0)


protected theorem IsUpperSet.interior (h : IsUpperSet s) : IsUpperSet (interior s)

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


protected theorem mk.inj_iff {n a b : Nat} {ha : a < n} {hb : b < n} :
    (⟨a, ha⟩ : Fin n) = ⟨b, hb⟩ ↔ a = b


@[simp, mfld_simps]
theorem mfderiv_snd {x : M × M'} :
    mfderiv (I.prod I') I' Prod.snd x =
      ContinuousLinearMap.snd 𝕜 (TangentSpace I x.1) (TangentSpace I' x.2)

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


theorem unitsSMul_one_group_smul (g : A) (w : NormalWord d) :
    unitsSMul φ 1 ((g : G) • w) = (φ g : G) • (unitsSMul φ 1 w)

{d : HNNExtension.NormalWord.TransversalPair G A B}

HNNExtension.NormalWord.unitsSMul φ 1 (↑g • w) = ↑(φ g) • HNNExtension.NormalWord.unitsSMul φ 1 w


/-- Any category with coproducts and coequalizers has all colimits.

See <https://stacks.math.columbia.edu/tag/002P>.
-/
theorem has_colimits_of_hasCoequalizers_and_coproducts [HasCoproducts.{w} C] [HasCoequalizers C] :
    HasColimitsOfSize.{w, w} C

CategoryTheory.Limits.HasColimitsOfSize.{w, w, v, u} C


theorem comap_le_comap_iff_of_surjective (hf : Function.Surjective f) (I J : Ideal S) :
    comap f I ≤ comap f J ↔ I ≤ J

{R : Type u}
{S : Type v}
{F : Type u_1}
[Ring R]
[Ring S]
[FunLike F R S]
[RingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)
(I J : Ideal S)

Ideal.comap f I ≤ Ideal.comap f J ↔ I ≤ J


theorem Limit.map_π_apply {F G : J ⥤ Type u} [HasLimit F] [HasLimit G] (α : F ⟶ G) (j : J)
    (x : limit F) : limit.π G j (limMap α x) = α.app j (limit.π F j x)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F G : J ⥤ Type u}
[CategoryTheory.Limits.HasLimit F]
[CategoryTheory.Limits.HasLimit G]
(α : F ⟶ G)
(j : J)
(x : CategoryTheory.Limits.limit F)

CategoryTheory.Limits.limit.π G j (CategoryTheory.Limits.limMap α x) = α.app j (CategoryTheory.Limits.limit.π F j x)


theorem Eventually.ne_of_lt [Preorder β] {l : Filter α} {f g : α → β} (h : ∀ᶠ x in l, f x < g x) :
    ∀ᶠ x in l, f x ≠ g x

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{f g : α → β}
(h : ∀ᶠ (x : α) in l, f x < g x)


@[simp]
theorem natSepDegree_pow {n : ℕ} : (f ^ n).natSepDegree = if n = 0 then 0 else f.natSepDegree

{F : Type u}
[Field F]
(f : F[X])
{n : ℕ}


@[elementwise (attr := simp)]
theorem binaryCoproductIso_inl_comp_inv (X Y : Type u) :
    ↾(Sum.inl : X ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inl

↾Sum.inl ≫ (CategoryTheory.Limits.Types.binaryCoproductIso X Y).inv = CategoryTheory.Limits.coprod.inl


theorem negOfNat_eq : negOfNat n = -ofNat n


@[simp] theorem HashMapBucket.size_update {α : Type u} {β : Type v} (data : HashMapBucket α β) (i : USize) (d : AssocList α β)
    (h : i.toNat < data.val.size) : (data.update i d h).val.size = data.val.size

{α : Type u}
{β : Type v}
(data : Lean.HashMapBucket α β)
(i : USize)
(d : Lean.AssocList α β)
(h : i.toNat < data.val.size)


@[simp, mfld_simps]
theorem tangentBundle_model_space_coe_chartAt (p : TangentBundle I H) :
    ⇑(chartAt (ModelProd H E) p) = TotalSpace.toProd H E

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(p : TangentBundle I H)

↑(chartAt (ModelProd H E) p) = ⇑(Bundle.TotalSpace.toProd H E)


@[simp]
theorem map_comp_comul_apply (f : F) (x : A) :
    TensorProduct.map f f (comul x) = comul (R := R) (f x)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{F : Type u_4}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[FunLike F A B]
[CoalgHomClass F R A B]
(f : F)
(x : A)

(TensorProduct.map ↑f ↑f) (Coalgebra.comul x) = Coalgebra.comul (f x)


theorem bind₁_monomial (f : σ → MvPolynomial τ R) (d : σ →₀ ℕ) (r : R) :
    bind₁ f (monomial d r) = C r * ∏ i ∈ d.support, f i ^ d i

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
(f : σ → MvPolynomial τ R)
(d : σ →₀ ℕ)
(r : R)

(MvPolynomial.bind₁ f) ((MvPolynomial.monomial d) r) = MvPolynomial.C r * ∏ i ∈ d.support, f i ^ d i


@[to_additive (attr := simp)]
theorem restrict_apply {N : Type*} [Mul N] [SetLike σ M] [MulMemClass σ M] (f : M →ₙ* N) {S : σ}
    (x : S) : f.restrict S x = f x

{M : Type u_1}
{σ : Type u_4}
[Mul M]
{N : Type u_5}
[Mul N]
[SetLike σ M]
[MulMemClass σ M]
(f : M →ₙ* N)
{S : σ}
(x : ↥S)


theorem frontier_union_subset (s t : Set X) :
    frontier (s ∪ t) ⊆ frontier s ∩ closure tᶜ ∪ closure sᶜ ∩ frontier t

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


theorem mem_closed_iff_bsup (hs : IsClosed s) :
    a ∈ s ↔
      ∃ (o : Ordinal) (_ho : o ≠ 0) (f : ∀ a < o, Ordinal),
        (∀ i hi, f i hi ∈ s) ∧ bsup.{u, u} o f = a

{s : Set Ordinal.{u}}
{a : Ordinal.{u}}
(hs : IsClosed s)

a ∈ s ↔ ∃ o, ∃ (_ : o ≠ 0), ∃ f, (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) ∧ o.bsup f = a


@[to_additive mem_addCentralizer]
lemma mem_centralizer_iff {c : M} : c ∈ centralizer S ↔ ∀ m ∈ S, m * c = c * m

{M : Type u_1}
{S : Set M}
[Mul M]
{c : M}

c ∈ S.centralizer ↔ ∀ m ∈ S, m * c = c * m


@[to_additive]
theorem subtype_comp_rangeRestrict (f : G →* N) : f.range.subtype.comp f.rangeRestrict = f

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)


lemma essSurj_mapComposableArrows_of_hasRightCalculusOfFractions
    [W.HasRightCalculusOfFractions] (n : ℕ) :
    (L.mapComposableArrows n).EssSurj

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasRightCalculusOfFractions]
(n : ℕ)


@[simp]
lemma coe_neg (f : C(X, R)₀) : ⇑(-f) = -⇑f

{X : Type u_3}
{R : Type u_4}
[Zero X]
[TopologicalSpace X]
[CommRing R]
[TopologicalSpace R]
[TopologicalRing R]
(f : ContinuousMapZero X R)


theorem nhds_basis_ball_pow {r : ℝ} (h0 : 0 < r) (h1 : r < 1) :
    (𝓝 x).HasBasis (fun _ => True) fun n : ℕ => ball x (r ^ n)

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{r : ℝ}
(h0 : 0 < r)
(h1 : r < 1)

(𝓝 x).HasBasis (fun x => True) fun n => Metric.ball x (r ^ n)


theorem g_ne_h (x : B) (hx : x ∉ f.range) : g ≠ h

{A B : Grp}
(f : A ⟶ B)
(x : ↑B)
(hx : x ∉ MonoidHom.range f)

Grp.SurjectiveOfEpiAuxs.g f ≠ Grp.SurjectiveOfEpiAuxs.h f


@[fun_prop]
theorem HasStrictFDerivAt.mul_const' (ha : HasStrictFDerivAt a a' x) (b : 𝔸) :
    HasStrictFDerivAt (fun y => a y * b) (a'.smulRight b) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
{a' : E →L[𝕜] 𝔸}
(ha : HasStrictFDerivAt a a' x)
(b : 𝔸)


@[simp] theorem bmod_zero : Int.bmod 0 m = 0


@[simp]
theorem liftEquiv_comp_apply :
    liftEquiv M g p (liftEquiv M i p j) = liftEquiv M (g.comp i) p j

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing K]
[CommRing L]
[CommRing M]
[CommRing N]
(i : K →+* L)
(j : K →+* M)
(g : L →+* N)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[ExpChar N p]
[PerfectRing M p]
[IsPRadical i p]
[IsPRadical g p]
[IsPRadical (g.comp i) p]

(PerfectRing.liftEquiv M g p) ((PerfectRing.liftEquiv M i p) j) = (PerfectRing.liftEquiv M (g.comp i) p) j


theorem ncard_le_ncard (hst : s ⊆ t) (ht : t.Finite := by toFinite_tac) :
    s.ncard ≤ t.ncard

{α : Type u_1}
{s t : Set α}
(hst : s ⊆ t)
(ht : t.Finite := by toFinite_tac)


@[to_additive exists_le_of_sum_le]
theorem exists_le_of_prod_le' (hs : s.Nonempty) (Hle : ∏ i ∈ s, f i ≤ ∏ i ∈ s, g i) :
    ∃ i ∈ s, f i ≤ g i

{ι : Type u_1}
{M : Type u_4}
[LinearOrderedCancelCommMonoid M]
{f g : ι → M}
{s : Finset ι}
(hs : s.Nonempty)
(Hle : ∏ i ∈ s, f i ≤ ∏ i ∈ s, g i)


@[simp]
theorem coe_dedup (l : List α) : @dedup α _ l = l.dedup

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


lemma _root_.Filter.Tendsto.compCM {α : Type*} {l : Filter α} {g : α → C(Y, Z)} {g₀ : C(Y, Z)}
    {f : α → C(X, Y)} {f₀ : C(X, Y)} (hg : Tendsto g l (𝓝 g₀)) (hf : Tendsto f l (𝓝 f₀)) :
    Tendsto (fun a ↦ (g a).comp (f a)) l (𝓝 (g₀.comp f₀))

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[LocallyCompactPair Y Z]
{α : Type u_6}
{l : Filter α}
{g : α → C(Y, Z)}
{g₀ : C(Y, Z)}
{f : α → C(X, Y)}
{f₀ : C(X, Y)}
(hg : Filter.Tendsto g l (𝓝 g₀))
(hf : Filter.Tendsto f l (𝓝 f₀))

Filter.Tendsto (fun a => (g a).comp (f a)) l (𝓝 (g₀.comp f₀))


lemma HomologyData.right_homologyIso_eq_left_homologyIso_trans_iso
    (h : S.HomologyData) [S.HasHomology] :
    h.right.homologyIso = h.left.homologyIso ≪≫ h.iso


/-- The rank of the range of a linear map is at most the rank of the source. -/
-- The proof is: a free submodule of the range lifts to a free submodule of the
-- source, by arbitrarily lifting a basis.
theorem lift_rank_range_le (f : M →ₗ[R] M') : Cardinal.lift.{v}
    (Module.rank R (LinearMap.range f)) ≤ Cardinal.lift.{v'} (Module.rank R M)

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')

Cardinal.lift.{v, v'} (Module.rank R ↥(LinearMap.range f)) ≤ Cardinal.lift.{v', v} (Module.rank R M)


lemma tendsto_stieltjesOfMeasurableRat_atBot (hf : Measurable f) (a : α) :
    Tendsto (stieltjesOfMeasurableRat f hf a) atBot (𝓝 0)

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

Filter.Tendsto (↑(ProbabilityTheory.stieltjesOfMeasurableRat f hf a)) Filter.atBot (𝓝 0)


theorem flip (p : CommSq f g h i) : CommSq g f i h

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
(p : CategoryTheory.CommSq f g h i)


theorem revPosOf_eq (s c) : revPosOf s c = revFind s (· == c)

s.revPosOf c = s.revFind fun x => x == c


@[simp]
theorem coe_basisOfTopLeSpanOfCardEqFinrank {ι : Type*} [Fintype ι] (b : ι → V)
    (le_span : ⊤ ≤ span K (Set.range b)) (card_eq : Fintype.card ι = finrank K V) :
    ⇑(basisOfTopLeSpanOfCardEqFinrank b le_span card_eq) = b

(le_span : ⊤ ≤ Submodule.span K (Set.range b))

(card_eq : Fintype.card ι = FiniteDimensional.finrank K V)


/-- `constantCoeff p` returns the constant term of the polynomial `p`,
  defined as `coeff p 0`. This is a ring homomorphism. -/
@[simps]
def constantCoeff : R[X] →+* R


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

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

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).functor.obj c).hom = c.π


@[simp]
theorem snd_comp_prod  (f : A →A[R] B) (g : A →A[R] C) :
    (snd R B C).comp (f.prod g) = g

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

(ContinuousAlgHom.snd R B C).comp (f.prod g) = g


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

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

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

a₁ • b ≤ a₂ • b


protected theorem exists_add_pow_prime_eq (hp : p.Prime) (h : Commute x y) :
    ∃ r, (x + y) ^ p = x ^ p + y ^ p + p * r

{R : Type u_1}
[Semiring R]
{p : ℕ}
{x y : R}
(hp : Nat.Prime p)
(h : Commute x y)

∃ r, (x + y) ^ p = x ^ p + y ^ p + ↑p * r


theorem Tendsto.nsmul_atTop (hf : Tendsto f l atTop) {n : ℕ} (hn : 0 < n) :
    Tendsto (fun x => n • f x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f : α → β}
(hf : Filter.Tendsto f l Filter.atTop)
{n : ℕ}
(hn : 0 < n)

Filter.Tendsto (fun x => n • f x) l Filter.atTop


theorem det_updateColumn_add_smul_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) (c : R) :
    det (updateColumn A i fun k => A k i + c • A k j) = det A

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix n n R)
{i j : n}
(hij : i ≠ j)
(c : R)

(A.updateColumn i fun k => A k i + c • A k j).det = A.det


theorem coeff_eq_zero_of_lt_order {x : HahnSeries Γ R} {i : Γ} (hi : i < x.order) :
    x.coeff i = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
[Zero Γ]
{x : HahnSeries Γ R}
{i : Γ}
(hi : i < x.order)


@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {β} [MeasurableSpace β] [TopologicalSpace β]
    [PseudoMetrizableSpace β] [BorelSpace β] {f : α → β} (hf : AEStronglyMeasurable f μ) :
    AEMeasurable f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


@[simp]
protected theorem run_map {α β} (h : α → β) (x : Comp F G α) :
    (h <$> x).run = (h <$> ·) <$> x.run

{F : Type u → Type w}
{G : Type v → Type u}
[Functor F]
[Functor G]
{α β : Type v}
(h : α → β)
(x : Functor.Comp F G α)


@[simp]
theorem matches'_zero : (0 : RegularExpression α).matches' = 0


theorem single_add_single_eq_single_add_single [AddCommMonoid M] {k l m n : α} {u v : M}
    (hu : u ≠ 0) (hv : v ≠ 0) :
    single k u + single l v = single m u + single n v ↔
      (k = m ∧ l = n) ∨ (u = v ∧ k = n ∧ l = m) ∨ (u + v = 0 ∧ k = l ∧ m = n)

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{k l m n : α}
{u v : M}
(hu : u ≠ 0)
(hv : v ≠ 0)

Finsupp.single k u + Finsupp.single l v = Finsupp.single m u + Finsupp.single n v ↔
  k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n


@[simp]
theorem coe_nnreal_smul_apply {_m : MeasurableSpace α} (c : ℝ≥0) (μ : Measure α) (s : Set α) :
    (c • μ) s = c * μ s

{α : Type u_1}
{_m : MeasurableSpace α}
(c : NNReal)
(μ : MeasureTheory.Measure α)
(s : Set α)


lemma homMk_eq_iff_leftFractionRel {X Y : C} (z₁ z₂ : W.LeftFraction X Y) :
    homMk z₁ = homMk z₂ ↔ LeftFractionRel z₁ z₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(z₁ z₂ : W.LeftFraction X Y)

CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₁ =
    CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₂ ↔
  CategoryTheory.MorphismProperty.LeftFractionRel z₁ z₂


@[to_additive (attr := simp)]
theorem toTopologicalSpace_top : (⊤ : GroupTopology α).toTopologicalSpace = ⊤


@[to_additive (attr := simp)] lemma isSquare_mul_self (m : α) : IsSquare (m * m)


theorem op_injective : Function.Injective (op : α → αᵒᵖ)


theorem eq_of_mem_uIcc_of_mem_uIcc' : b ∈ [[a, c]] → c ∈ [[a, b]] → b = c

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


/-- Left multiplication by a unit of a semiring as an additive automorphism. -/
@[simps! (config := { simpRhs := true })]
def mulLeft : Rˣ →* AddAut R

∀ (a : R), (AddEquiv.symm (AddAut.mulLeft x)) a = x⁻¹ • a


theorem Continuous.comp₃ {g : X × Y × Z → ε} (hg : Continuous g) {e : W → X} (he : Continuous e)
    {f : W → Y} (hf : Continuous f) {k : W → Z} (hk : Continuous k) :
    Continuous fun w => g (e w, f w, k w)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
{ε : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
[TopologicalSpace ε]
{g : X × Y × Z → ε}
(hg : Continuous g)
{e : W → X}
(he : Continuous e)
{f : W → Y}
(hf : Continuous f)
{k : W → Z}
(hk : Continuous k)


/-- The integral of `f (R⁻¹ • x)` with respect to an additive Haar measure is a multiple of the
integral of `f`. The formula we give works even when `f` is not integrable or `R = 0`
thanks to the convention that a non-integrable function has integral zero. -/
theorem integral_comp_inv_smul_of_nonneg (f : E → F) {R : ℝ} (hR : 0 ≤ R) :
    ∫ x, f (R⁻¹ • x) ∂μ = R ^ finrank ℝ E • ∫ x, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E → F)
{R : ℝ}
(hR : 0 ≤ R)

∫ (x : E), f (R⁻¹ • x) ∂μ = R ^ FiniteDimensional.finrank ℝ E • ∫ (x : E), f x ∂μ


theorem closed_complemented_range_of_isCompl_of_ker_eq_bot {F : Type*} [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] (f : E →L[𝕜] F) (G : Submodule 𝕜 F)
    (h : IsCompl (LinearMap.range f) G) (hG : IsClosed (G : Set F)) (hker : ker f = ⊥) :
    IsClosed (LinearMap.range f : Set F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(f : E →L[𝕜] F)
(G : Submodule 𝕜 F)
(h : IsCompl (LinearMap.range f) G)
(hG : IsClosed ↑G)
(hker : LinearMap.ker f = ⊥)


@[simp] theorem induction_zero {motive : Fin (n + 1) → Sort _} (zero : motive 0)
    (hs : ∀ i : Fin n, motive (castSucc i) → motive i.succ) :
    (induction zero hs : ∀ i : Fin (n + 1), motive i) 0 = zero

(hs : (i : Fin n) → motive i.castSucc → motive i.succ)

(fun i => Fin.induction zero hs i) 0 = zero


theorem coe_coe_eq_natCast (n : ℕ) : (n : ℝ) = (n : EReal)


@[to_additive (attr := simp)]
theorem apply_ofInjective_symm {f : G →* N} (hf : Function.Injective f) (x : f.range) :
    f ((ofInjective hf).symm x) = x

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
(hf : Function.Injective ⇑f)
(x : ↥f.range)

f ((MonoidHom.ofInjective hf).symm x) = ↑x


/-- An order is strongly atomic if every nontrivial interval `[a, b]`
contains an element covering `a`. -/
@[mk_iff]
class IsStronglyAtomic (α : Type*) [Preorder α] : Prop where
  exists_covBy_le_of_lt : ∀ (a b : α), a < b → ∃ x, a ⋖ x ∧ x ≤ b

IsStronglyAtomic α ↔ ∀ (a b : α), a < b → ∃ x, a ⋖ x ∧ x ≤ b


/-- If `dist (f n) (f (n+1))` is bounded by `C * r^n`, `r < 1`, then the distance from
`f 0` to the limit of `f` is bounded above by `C / (1 - r)`. -/
theorem dist_le_of_le_geometric_of_tendsto {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    dist (f n) a ≤ C * r ^ n / (1 - r)

(hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n)

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


theorem setLIntegral_pdf_le_map {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) (s : Set E) :
    ∫⁻ x in s, pdf X ℙ μ x ∂μ ≤ map X ℙ s

(μ : MeasureTheory.Measure E := by volume_tac)

∫⁻ (x : E) in s, MeasureTheory.pdf X ℙ μ x ∂μ ≤ (MeasureTheory.Measure.map X ℙ) s


theorem hasseDeriv_apply_one (hk : 0 < k) : hasseDeriv k (1 : R[X]) = 0

{R : Type u_1}
[Semiring R]
(k : ℕ)
(hk : 0 < k)


theorem le_of_dvd {m n : ℕ+} : m ∣ n → m ≤ n


@[simp]
lemma toMvPolynomial_zero : (0 : M₁ →ₗ[R] M₂).toMvPolynomial b₁ b₂ = 0

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{ι₁ : Type u_4}
{ι₂ : Type u_5}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Fintype ι₁]
[Finite ι₂]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)


theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
    (hf : ∀ b, Injective fun a => f a b) : s.card ≤ (image₂ f s t).card

{f : α → β → γ}

(hf : ∀ (b : β), Function.Injective fun a => f a b)


/-- Every polynomial is a polynomial in finitely many variables. -/
theorem exists_fin_rename (p : MvPolynomial σ R) :
    ∃ (n : ℕ) (f : Fin n → σ) (_hf : Injective f) (q : MvPolynomial (Fin n) R), p = rename f q

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

∃ n f, ∃ (_ : Function.Injective f), ∃ q, p = (MvPolynomial.rename f) q


/-- `rpow` variant of `List.prod_map_pow` for `ℝ≥0`-/
theorem list_prod_map_rpow (l : List ℝ≥0) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r

(List.map (fun x => x ^ r) l).prod = l.prod ^ r


@[simp]
theorem sheafificationWhiskerLeftIso_inv_app (P : Cᵒᵖ ⥤ D) (F : D ⥤ E)
    [∀ (F : D ⥤ E) (X : C), PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]
    [∀ (F : D ⥤ E) (X : C) (W : J.Cover X) (P : Cᵒᵖ ⥤ D),
        PreservesLimit (W.index P).multicospan F] :
    (sheafificationWhiskerLeftIso J P).inv.app F = (J.sheafifyCompIso F P).inv

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w₁} D]

[CategoryTheory.Category.{max v u, w₂} E]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(F : CategoryTheory.Functor D E) → (X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

[(F : CategoryTheory.Functor D E) →
    (X : C) →
      (W : J.Cover X) →
        (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

(J.sheafificationWhiskerLeftIso P).inv.app F = (J.sheafifyCompIso F P).inv


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

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

(CategoryTheory.Monad.Algebra.isoMk h w).hom.f = h.hom


/-- Given a Killing Lie algebra `L`, if `L'` is isomorphic to `L`, then `L'` is Killing too. -/
lemma isKilling_of_equiv [IsKilling R L] (e : L ≃ₗ⁅R⁆ L') : IsKilling R L'

{R : Type u_1}
{L : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L' : Type u_5}
[LieRing L']
[LieAlgebra R L']
[LieAlgebra.IsKilling R L]
(e : L ≃ₗ⁅R⁆ L')


theorem integral_Iic_eq_integral_Iio' (hx : μ {x} = 0) :
    ∫ t in Iic x, f t ∂μ = ∫ t in Iio x, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x : X}
(hx : μ {x} = 0)

∫ (t : X) in Set.Iic x, f t ∂μ = ∫ (t : X) in Set.Iio x, f t ∂μ


theorem NF.zero_of_zero {e n a} (h : NF (ONote.oadd e n a)) (e0 : e = 0) : a = 0

{e : ONote}
{n : ℕ+}
{a : ONote}
(h : (e.oadd n a).NF)
(e0 : e = 0)


@[simp] lemma empty_sub_empty (v w : Fin 0 → α) : v - w = ![]

{α : Type u_1}
[Sub α]
(v w : Fin 0 → α)


@[simp] lemma ofEquiv_specializes_ofEquiv {a b : Specialization α} :
  ofEquiv a ⤳ ofEquiv b ↔ b ≤ a

{α : Type u_1}
[TopologicalSpace α]
{a b : Specialization α}

Specialization.ofEquiv a ⤳ Specialization.ofEquiv b ↔ b ≤ a


/--
`R_p →+* S_q` is surjective if and only if
every `x : S` is of the form `f x / f r` for some `f r ∉ q`.
This is useful when proving `SurjectiveOnStalks`.
-/
lemma surjective_localRingHom_iff (P : Ideal S) [P.IsPrime] :
    Function.Surjective (Localization.localRingHom _ P f rfl) ↔
      ∀ s : S, ∃ x r : R, ∃ c ∉ P, f r ∉ P ∧ c * f r * s = c * f x

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}
(P : Ideal S)
[P.IsPrime]

Function.Surjective ⇑(Localization.localRingHom (Ideal.comap f P) P f ⋯) ↔
  ∀ (s : S), ∃ x r, ∃ c ∉ P, f r ∉ P ∧ c * f r * s = c * f x


/-- A family of vectors is linearly independent if they are nonzero
and orthogonal. -/
theorem linearIndependent_of_ne_zero_of_inner_eq_zero {ι : Type*} {v : ι → E} (hz : ∀ i, v i ≠ 0)
    (ho : Pairwise fun i j => ⟪v i, v j⟫ = 0) : LinearIndependent 𝕜 v

(ho : Pairwise fun i j => ⟪v i, v j⟫_𝕜 = 0)


lemma CharP.addOrderOf_one : CharP R (addOrderOf (1 : R))


theorem convexBodyLT'_volume :
    volume (convexBodyLT' K f w₀) = convexBodyLT'Factor K * ∏ w, (f w) ^ (mult w)

(f : NumberField.InfinitePlace K → NNReal)

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


/-- A simple graph is an irreflexive symmetric relation `Adj` on a vertex type `V`.
The relation describes which pairs of vertices are adjacent.
There is exactly one edge for every pair of adjacent vertices;
see `SimpleGraph.edgeSet` for the corresponding edge set.
-/
@[ext, aesop safe constructors (rule_sets := [SimpleGraph])]
structure SimpleGraph (V : Type u) where
  /-- The adjacency relation of a simple graph. -/
  Adj : V → V → Prop
  symm : Symmetric Adj := by aesop_graph
  loopless : Irreflexive Adj := by aesop_graph


theorem centroid_univ (s : Finset P) : univ.centroid k ((↑) : s → P) = s.centroid k id

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : Finset P)

Finset.centroid k Finset.univ Subtype.val = Finset.centroid k s id


theorem minimalPeriod_eq_prime_pow {p k : ℕ} [hp : Fact p.Prime] (hk : ¬IsPeriodicPt f (p ^ k) x)
    (hk1 : IsPeriodicPt f (p ^ (k + 1)) x) : minimalPeriod f x = p ^ (k + 1)

(hk : ¬Function.IsPeriodicPt f (p ^ k) x)

(hk1 : Function.IsPeriodicPt f (p ^ (k + 1)) x)

Function.minimalPeriod f x = p ^ (k + 1)


@[simp]
theorem conjTranspose_submatrix [Star α] (A : Matrix m n α) (r_reindex : l → m)
    (c_reindex : o → n) : (A.submatrix r_reindex c_reindex)ᴴ = Aᴴ.submatrix c_reindex r_reindex

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Star α]
(A : Matrix m n α)
(r_reindex : l → m)
(c_reindex : o → n)


/-- Consider a parameterized integral `x ↦ ∫ y, f x y` where `f` is continuous and uniformly
compactly supported. Then the integral depends continuously on `x`. -/
lemma continuousOn_integral_of_compact_support
    {f : X → Y → E} {s : Set X} {k : Set Y} [IsFiniteMeasureOnCompacts μ]
    (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ univ))
    (hfs : ∀ p, ∀ x, p ∈ s → x ∉ k → f p x = 0) :
    ContinuousOn (fun x ↦ ∫ y, f x y ∂μ) s

(hf : ContinuousOn (Function.uncurry f) (s ×ˢ Set.univ))

(hfs : ∀ (p : X) (x : Y), p ∈ s → x ∉ k → f p x = 0)

ContinuousOn (fun x => ∫ (y : Y), f x y ∂μ) s


theorem MinFacHelper.one_lt {n k : ℕ} (h : MinFacHelper n k) : 1 < n

(h : Mathlib.Meta.NormNum.MinFacHelper n k)


@[to_additive (attr := simp)]
theorem mulRight_symm (u : Mˣ) : u.mulRight.symm = u⁻¹.mulRight


theorem Function.Surjective.isEmpty [IsEmpty α] {f : α → β} (hf : f.Surjective) : IsEmpty β

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


theorem preimage_units_mul_eq_swap_mul {a b : A} :
    ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{a b : A}

Units.val ⁻¹' spectrum R (a * b) = Units.val ⁻¹' spectrum R (b * a)


@[simp]
theorem ofFn_getElem_eq_map {β : Type*} (l : List α) (f : α → β) :
    ofFn (fun i : Fin l.length => f <| l[(i : Nat)]) = l.map f

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

(List.ofFn fun i => f l[↑i]) = List.map f l


/-- An angle in a right-angled triangle expressed using `arctan`, where one side is a multiple
of a rotation of another by `π / 2`. -/
theorem oangle_add_right_smul_rotation_pi_div_two {x : V} (h : x ≠ 0) (r : ℝ) :
    o.oangle x (x + r • o.rotation (π / 2 : ℝ) x) = Real.arctan r

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

o.oangle x (x + r • (o.rotation ↑(π / 2)) x) = ↑(Real.arctan r)


@[simp]
theorem toBoolAlg_symm_eq : (@toBoolAlg α).symm = ofBoolAlg


/-- A morphism `P ⟶ Q` in the category `Karoubi C` is a morphism in the underlying category
`C` which satisfies a relation, which in the preadditive case, expresses that it induces a
map between the corresponding "formal direct factors" and that it vanishes on the complement
formal direct factor. -/
@[ext]
structure Hom (P Q : Karoubi C) where
  /-- a morphism between the underlying objects -/
  f : P.X ⟶ Q.X
  /-- compatibility of the given morphism with the given idempotents -/
  comm : f = P.p ≫ f ≫ Q.p := by aesop_cat

{P Q : CategoryTheory.Idempotents.Karoubi C}

self.f = CategoryTheory.CategoryStruct.comp P.p (CategoryTheory.CategoryStruct.comp self.f Q.p)


theorem HasStrictDerivAt.comp (hh₂ : HasStrictDerivAt h₂ h₂' (h x)) (hh : HasStrictDerivAt h h' x) :
    HasStrictDerivAt (h₂ ∘ h) (h₂' * h') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' : 𝕜'}
(hh₂ : HasStrictDerivAt h₂ h₂' (h x))
(hh : HasStrictDerivAt h h' x)


/-- P1 follows from the induction hypothesis. -/
theorem P1_of_ih (ih : ∀ a, ArgsRel a (Args.P1 x y) → P124 a) (hx : x.Numeric) (hy : y.Numeric) :
    (x * y).Numeric

(ih :
  ∀ (a : Surreal.Multiplication.Args),
    Surreal.Multiplication.ArgsRel a (Surreal.Multiplication.Args.P1 x y) → Surreal.Multiplication.P124 a)


theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M)
    (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i)

{M : Type u_5}
[CommMonoid M]
{ι : Type u_6}
(s : Finset ι)
(f g : ι → M)
(h : ∀ i ∈ s, f i ~ᵤ g i)


protected theorem lt_add_iff_pos_right {x y : PartENat} (hx : x ≠ ⊤) : x < x + y ↔ 0 < y


/-- If the Hausdorff distance is `< r`, then any point in one of the sets has
a corresponding point at distance `< r` in the other set. -/
theorem exists_edist_lt_of_hausdorffEdist_lt {r : ℝ≥0∞} (h : x ∈ s) (H : hausdorffEdist s t < r) :
    ∃ y ∈ t, edist x y < r

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s t : Set α}
{r : ℝ≥0∞}
(h : x ∈ s)
(H : EMetric.hausdorffEdist s t < r)


@[simp]
theorem id (ℱ : X.Presheaf C) (x : X) :
    ℱ.stalkPushforward C (𝟙 X) x = (stalkFunctor C x).map (Pushforward.id ℱ).hom

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X : TopCat}
(ℱ : TopCat.Presheaf C X)
(x : ↑X)

TopCat.Presheaf.stalkPushforward C (𝟙 X) ℱ x =
  (TopCat.Presheaf.stalkFunctor C x).map (TopCat.Presheaf.Pushforward.id ℱ).hom


@[simp]
theorem coe_restrictScalars' (f : A ≃ₐ[S] B) : (restrictScalars R f : A → B) = f

(R : Type u)
{S : Type v}
{A : Type w}
{B : Type u₁}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A ≃ₐ[S] B)


/-- The map from an arbitrary cone over an indexed family of abelian groups
to the cartesian product of those groups.
-/
@[simps]
def lift (s : Fan f) : s.pt ⟶ ModuleCat.of R (∀ j, f j)

{R : Type u}
[Ring R]
{J : Type w}
(f : J → ModuleCat R)
(s : CategoryTheory.Limits.Fan f)
(x : ↑s.pt)
(j : J)

(ModuleCat.HasLimit.lift f s) x j = (s.π.app { as := j }) x


lemma setIntegral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E]
    {s : Set α} (hs : MeasurableSet s) {t : Set β} (ht : MeasurableSet t)
    {f : α × β → E} (hf : IntegrableOn f (s ×ˢ t) (μ ⊗ₘ κ))  :
    ∫ x in s ×ˢ t, f x ∂(μ ⊗ₘ κ) = ∫ a in s, ∫ b in t, f (a, b) ∂(κ a) ∂μ

(hf : MeasureTheory.IntegrableOn f (s ×ˢ t) (μ ⊗ₘ κ))

∫ (x : α × β) in s ×ˢ t, f x ∂μ ⊗ₘ κ = ∫ (a : α) in s, ∫ (b : β) in t, f (a, b) ∂κ a ∂μ


theorem IsPrefix.trans : ∀ {l₁ l₂ l₃ : List α}, l₁ <+: l₂ → l₂ <+: l₃ → l₁ <+: l₃


theorem smul_def [SMul R α] {S : Subring R} (g : S) (m : α) : g • m = (g : R) • m

{R : Type u}
[Ring R]
{α : Type u_1}
[SMul R α]
{S : Subring R}
(g : ↥S)
(m : α)


theorem isTwoCocycle_of_twoCocycles (f : twoCocycles (Rep.ofDistribMulAction k G A)) :
    IsTwoCocycle (A := A) f.1

(f : ↥(groupCohomology.twoCocycles (Rep.ofDistribMulAction k G A)))


lemma nz_of_isNegNat {n : ℕ} [StrictOrderedRing A]
    (h : NormNum.IsInt e (.negOfNat n)) (w : Nat.ble 1 n = true) : (e : A) ≠ 0

(h : Mathlib.Meta.NormNum.IsInt e (Int.negOfNat n))


theorem decide_false {p : Prop} [Decidable p] : ¬p → decide p = false


protected theorem IsCycle.sameCycle (hf : IsCycle f) (hx : f x ≠ x) (hy : f y ≠ y) :
    SameCycle f x y

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}
(hf : f.IsCycle)
(hx : f x ≠ x)
(hy : f y ≠ y)


theorem UniformCauchySeqOnFilter.mono_left {p'' : Filter ι} (hf : UniformCauchySeqOnFilter F p p')
    (hp : p'' ≤ p) : UniformCauchySeqOnFilter F p'' p'

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{p : Filter ι}
{p' : Filter α}
{p'' : Filter ι}
(hf : UniformCauchySeqOnFilter F p p')
(hp : p'' ≤ p)


/-- A strong natural transformation between oplax functors `F` and `G` is a natural transformation
that is "natural up to 2-isomorphisms".

More precisely, it consists of the following:
* a 1-morphism `η.app a : F.obj a ⟶ G.obj a` for each object `a : B`.
* a 2-isomorphism `η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism
`f : a ⟶ b`.
* These 2-isomorphisms satisfy the naturality condition, and preserve the identities and the
compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure StrongOplaxNatTrans (F G : OplaxFunctor B C) where
  app (a : B) : F.obj a ⟶ G.obj a
  naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ≅ app a ≫ G.map f
  naturality_naturality :
    ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
      F.map₂ η ▷ app b ≫ (naturality g).hom = (naturality f).hom ≫ app a ◁ G.map₂ η := by
    aesop_cat
  naturality_id :
    ∀ a : B,
      (naturality (𝟙 a)).hom ≫ app a ◁ G.mapId a =
        F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by
    aesop_cat
  naturality_comp :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
      (naturality (f ≫ g)).hom ≫ app a ◁ G.mapComp f g =
        F.mapComp f g ▷ app c ≫ (α_ _ _ _).hom ≫ F.map f ◁ (naturality g).hom ≫
        (α_ _ _ _).inv ≫ (naturality f).hom ▷ G.map g ≫ (α_ _ _ _).hom := by
    aesop_cat

(self : CategoryTheory.StrongOplaxNatTrans F G)

CategoryTheory.CategoryStruct.comp (self.naturality (CategoryTheory.CategoryStruct.id a)).hom
    (CategoryTheory.Bicategory.whiskerLeft (self.app a) (G.mapId a)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapId a) (self.app a))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (self.app a)).hom
      (CategoryTheory.Bicategory.rightUnitor (self.app a)).inv)


theorem isClosed_eq [T2Space X] {f g : Y → X} (hf : Continuous f) (hg : Continuous g) :
    IsClosed { y : Y | f y = g y }

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space X]
{f g : Y → X}
(hf : Continuous f)
(hg : Continuous g)


theorem fixingSubgroup_antitone : Antitone (fixingSubgroup M : Set α → Subgroup M)

(M : Type u_1)
(α : Type u_2)
[Group M]
[MulAction M α]


/-- For a family of normal functions, `Ordinal.derivBFamily` enumerates the common fixed points. -/
theorem derivBFamily_eq_enumOrd (H : ∀ i hi, IsNormal (f i hi)) :
    derivBFamily.{u, v} o f = enumOrd (⋂ (i) (hi), Function.fixedPoints (f i hi))

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

(H : ∀ (i : Ordinal.{u}) (hi : i < o), Ordinal.IsNormal (f i hi))

o.derivBFamily f = Ordinal.enumOrd (⋂ i, ⋂ (hi : i < o), Function.fixedPoints (f i hi))


@[simp]
theorem map'_coe {lc : Filter γ} (F : (α → β) → γ → δ) (hF : (l.EventuallyEq ⇒ lc.EventuallyEq) F F)
    (f : α → β) : map' F hF f = F f

(F : (α → β) → γ → δ)


theorem IsSt.sub {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) : IsSt (x - y) (r - s)

{x y : ℝ*}
{r s : ℝ}
(hxr : x.IsSt r)
(hys : y.IsSt s)


@[reassoc (attr := simp)]
theorem isoRestrict_hom_ofRestrict : (isoRestrict f).hom ≫ Y.ofRestrict _ = f

{X Y : AlgebraicGeometry.LocallyRingedSpace}

[H : AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion f]

(AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion.isoRestrict f).hom ≫ Y.ofRestrict ⋯ = f


theorem X_pow_order_dvd (h : (order φ).Dom) : X ^ (order φ).get h ∣ φ

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}
(h : φ.order.Dom)


@[to_additive]
theorem mulIndicator_comp_of_one {g : M → N} (hg : g 1 = 1) :
    mulIndicator s (g ∘ f) = g ∘ mulIndicator s f

{α : Type u_1}
{M : Type u_4}
{N : Type u_5}
[One M]
[One N]
{s : Set α}
{f : α → M}
{g : M → N}
(hg : g 1 = 1)

s.mulIndicator (g ∘ f) = g ∘ s.mulIndicator f


@[simp]
theorem refl_symm : (ContinuousLinearEquiv.refl R₁ M₁).symm = ContinuousLinearEquiv.refl R₁ M₁

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]


/-- If `f` is locally integrable and `g` is continuous with compact support,
then `g • f` is integrable. -/
theorem LocallyIntegrable.integrable_smul_left_of_hasCompactSupport
    [NormedSpace ℝ E] [OpensMeasurableSpace X] [T2Space X]
    (hf : LocallyIntegrable f μ) {g : X → ℝ} (hg : Continuous g) (h'g : HasCompactSupport g) :
    Integrable (fun x ↦ g x • f x) μ

(hf : MeasureTheory.LocallyIntegrable f μ)

MeasureTheory.Integrable (fun x => g x • f x) μ


theorem splits_ℚ_ℂ {p : ℚ[X]} : Fact (p.Splits (algebraMap ℚ ℂ))

Fact (Polynomial.Splits (algebraMap ℚ ℂ) p)


@[simp]
theorem unsym_sym (a : α) : unsym (sym a) = a


lemma divInt_div_divInt_cancel_right {x : ℤ} (hx : x ≠ 0) (n d : ℤ) :
    x /. n / (x /. d) = d /. n

Rat.divInt x n / Rat.divInt x d = Rat.divInt d n


protected nonrec theorem IsPWO.union (hs : IsPWO s) (ht : IsPWO t) : IsPWO (s ∪ t)

{α : Type u_2}
[Preorder α]
{s t : Set α}
(hs : s.IsPWO)
(ht : t.IsPWO)


theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α] :
    ‖(1 : Matrix n n α)‖₊ = NNReal.sqrt (Fintype.card n) * ‖(1 : α)‖₊

{n : Type u_4}
{α : Type u_5}
[Fintype n]
[DecidableEq n]
[SeminormedAddCommGroup α]
[One α]

‖1‖₊ = NNReal.sqrt ↑(Fintype.card n) * ‖1‖₊


@[reassoc]
theorem Scheme.isoSpec_inv_naturality {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
    Spec.map (f.app ⊤) ≫ Y.isoSpec.inv = X.isoSpec.inv ≫ f

{X Y : AlgebraicGeometry.Scheme}
[AlgebraicGeometry.IsAffine X]
[AlgebraicGeometry.IsAffine Y]
(f : X ⟶ Y)

AlgebraicGeometry.Spec.map (AlgebraicGeometry.Scheme.Hom.app f ⊤) ≫ Y.isoSpec.inv = X.isoSpec.inv ≫ f


theorem zeros {μ : YoungDiagram} (T : SemistandardYoungTableau μ) {i j : ℕ}
    (not_cell : (i, j) ∉ μ) : T i j = 0


@[to_additive (attr := simp)]
theorem diam_one [One α] : diam (1 : Set α) = 0

{α : Type u}
[PseudoMetricSpace α]
[Zero α]


theorem suffix_cons_iff : l₁ <:+ a :: l₂ ↔ l₁ = a :: l₂ ∨ l₁ <:+ l₂

∀ {α : Type u_1} {l₁ : List α} {a : α} {l₂ : List α}, l₁ <:+ a :: l₂ ↔ l₁ = a :: l₂ ∨ l₁ <:+ l₂


/-- If `L` contains both a primitive `p`-th root of unity and `q`-th root of unity, and
`Irreducible (cyclotomic (lcm p q) K)` (in particular for `K = ℚ`), then the `finrank K L` is at
least `(lcm p q).totient`. -/
theorem _root_.IsPrimitiveRoot.lcm_totient_le_finrank [FiniteDimensional K L] {p q : ℕ} {x y : L}
    (hx : IsPrimitiveRoot x p) (hy : IsPrimitiveRoot y q)
    (hirr : Irreducible (cyclotomic (Nat.lcm p q) K)) :
    (Nat.lcm p q).totient ≤ FiniteDimensional.finrank K L

(hirr : Irreducible (Polynomial.cyclotomic (p.lcm q) K))

φ (p.lcm q) ≤ FiniteDimensional.finrank K L


theorem measure_preimage {X : Ω → E} {s : Set E} (hns : μ s ≠ 0) (hnt : μ s ≠ ∞)
    (hu : IsUniform X s ℙ μ) {A : Set E} (hA : MeasurableSet A) :
    ℙ (X ⁻¹' A) = μ (s ∩ A) / μ s

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

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  μ s ≠ 0 →
    μ s ≠ ⊤ → MeasureTheory.pdf.IsUniform X s ℙ μ → ∀ {A : Set E}, MeasurableSet A → ℙ (X ⁻¹' A) = μ (s ∩ A) / μ s


@[simp, norm_cast]
theorem coe_erase (a : α) (s : Finset α) : ↑(erase s a) = (s \ {a} : Set α)

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


@[to_additive (attr := simp)]
theorem noncommCoprod_inl_inr {M N : Type*} [Monoid M] [Monoid N] :
    (inl M N).noncommCoprod (inr M N) commute_inl_inr = id (M × N)

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]

(AddMonoidHom.inl M N).noncommCoprod (AddMonoidHom.inr M N) ⋯ = AddMonoidHom.id (M × N)


/--
M is flat if and only if `M ⊗ -` is a left exact functor.
-/
lemma iff_lTensor_exact [Small.{v} R] :
    Flat R M ↔
    ∀ ⦃N N' N'' : Type v⦄ [AddCommGroup N] [AddCommGroup N'] [AddCommGroup N'']
      [Module R N] [Module R N'] [Module R N''] ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄,
        Function.Exact f g → Function.Exact (f.lTensor M) (g.lTensor M)

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]

Module.Flat R M ↔
  ∀ ⦃N N' N'' : Type v⦄ [inst : AddCommGroup N] [inst_1 : AddCommGroup N'] [inst_2 : AddCommGroup N'']
    [inst_3 : Module R N] [inst_4 : Module R N'] [inst_5 : Module R N''] ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄,
    Function.Exact ⇑f ⇑g → Function.Exact ⇑(LinearMap.lTensor M f) ⇑(LinearMap.lTensor M g)


@[to_additive]
lemma IsFundamentalDomain.quotientMeasure_eq [Countable G] [MeasurableSpace G] {s t : Set α}
    [SMulInvariantMeasure G α μ] [MeasurableSMul G α] (fund_dom_s : IsFundamentalDomain G s μ)
    (fund_dom_t : IsFundamentalDomain G t μ) :
    (μ.restrict s).map π = (μ.restrict t).map π

[MeasureTheory.SMulInvariantMeasure G α μ]

(fund_dom_s : MeasureTheory.IsFundamentalDomain G s μ)

(fund_dom_t : MeasureTheory.IsFundamentalDomain G t μ)

MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (μ.restrict s) =
  MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (μ.restrict t)


/-- This used to be an `@[ext]` lemma, but it fails very slowly when the `ext` tactic tries to apply
it in some cases, notably when one wants to show equality of two linear maps. The `@[ext]`
attribute is now added locally where it is needed. Using this as the `@[ext]` lemma instead of
`TensorProduct.ext'` allows `ext` to apply lemmas specific to `M →ₗ _` and `N →ₗ _`.

See note [partially-applied ext lemmas]. -/
theorem ext {g h : M ⊗ N →ₗ[R] P} (H : (mk R M N).compr₂ g = (mk R M N).compr₂ h) : g = h

(H : (TensorProduct.mk R M N).compr₂ g = (TensorProduct.mk R M N).compr₂ h)


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem smul_finset_nonempty : (a • s).Nonempty ↔ s.Nonempty

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


theorem lt_zero_of_zero_gt {α : Type*} [Zero α] [LT α] {a : α} (h : 0 > a) : a < 0

{α : Type u_1}
[Zero α]
[LT α]
{a : α}
(h : 0 > a)


@[to_additive]
lemma snd_mem_orbit_of_mem_orbit {x y : α × β} (h : x ∈ MulAction.orbit M y) :
    x.2 ∈ MulAction.orbit M y.2

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
{β : Type u_1}
[MulAction M β]
{x y : α × β}
(h : x ∈ MulAction.orbit M y)


@[to_additive]
lemma mulIndicator_biUnion_apply (s : Finset ι) (t : ι → Set κ) {f : κ → β}
    (h : (s : Set ι).PairwiseDisjoint t) (x : κ) :
    mulIndicator (⋃ i ∈ s, t i) f x = ∏ i ∈ s, mulIndicator (t i) f x

{ι : Type u_1}
{β : Type u_4}
[AddCommMonoid β]
{κ : Type u_7}
(s : Finset ι)
(t : ι → Set κ)
{f : κ → β}
(h : (↑s).PairwiseDisjoint t)
(x : κ)

(⋃ i ∈ s, t i).indicator f x = ∑ i ∈ s, (t i).indicator f x


@[to_additive existing (attr := simp) pow_addRight]
lemma pow_mulRight (n : ℕ) : Equiv.mulRight a ^ n = Equiv.mulRight (a ^ n)


theorem two_le_length_toList_iff_mem_support {p : Perm α} {x : α} :
    2 ≤ length (toList p x) ↔ x ∈ p.support

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{p : Equiv.Perm α}
{x : α}


/-- If `Irreducible (cyclotomic (p ^ (k + 1)) K)` (in particular for `K = ℚ`) and `p` is a prime,
then the norm of `ζ ^ (p ^ s) - 1` is `p ^ (p ^ s)` if `p ≠ 2`. -/
theorem norm_pow_sub_one_of_prime_ne_two {k : ℕ} (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1)))
    [hpri : Fact (p : ℕ).Prime] [IsCyclotomicExtension {p ^ (k + 1)} K L]
    (hirr : Irreducible (cyclotomic (↑(p ^ (k + 1)) : ℕ) K)) {s : ℕ} (hs : s ≤ k) (hodd : p ≠ 2) :
    norm K (ζ ^ (p : ℕ) ^ s - 1) = (p : K) ^ (p : ℕ) ^ s

(hirr : Irreducible (Polynomial.cyclotomic (↑(p ^ (k + 1))) K))

(Algebra.norm K) (ζ ^ ↑p ^ s - 1) = ↑↑p ^ ↑p ^ s


theorem AffineIndependent.indicator_eq_of_affineCombination_eq {p : ι → P}
    (ha : AffineIndependent k p) (s₁ s₂ : Finset ι) (w₁ w₂ : ι → k) (hw₁ : ∑ i ∈ s₁, w₁ i = 1)
    (hw₂ : ∑ i ∈ s₂, w₂ i = 1) (h : s₁.affineCombination k p w₁ = s₂.affineCombination k p w₂) :
    Set.indicator (↑s₁) w₁ = Set.indicator (↑s₂) w₂

(h : (Finset.affineCombination k s₁ p) w₁ = (Finset.affineCombination k s₂ p) w₂)


theorem orderOf_abs_ne_one (h : |x| ≠ 1) : orderOf x = 0

{G : Type u_1}
[LinearOrderedRing G]
{x : G}
(h : |x| ≠ 1)


lemma map_compatibility {X Y : C}
    (φ : W.LeftFraction X Y) {E : Type*} [Category E]
    (L₁ : C ⥤ D) (L₂ : C ⥤ E) [L₁.IsLocalization W] [L₂.IsLocalization W] :
    (Localization.uniq L₁ L₂ W).functor.map (φ.map L₁ (Localization.inverts L₁ W)) =
      (Localization.compUniqFunctor L₁ L₂ W).hom.app X ≫
        φ.map L₂ (Localization.inverts L₂ W) ≫
        (Localization.compUniqFunctor L₁ L₂ W).inv.app Y

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.LeftFraction X Y)
{E : Type u_3}
[CategoryTheory.Category.{u_5, u_3} E]
(L₁ : CategoryTheory.Functor C D)
(L₂ : CategoryTheory.Functor C E)
[L₁.IsLocalization W]
[L₂.IsLocalization W]

(CategoryTheory.Localization.uniq L₁ L₂ W).functor.map (φ.map L₁ ⋯) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Localization.compUniqFunctor L₁ L₂ W).hom.app X)
    (CategoryTheory.CategoryStruct.comp (φ.map L₂ ⋯) ((CategoryTheory.Localization.compUniqFunctor L₁ L₂ W).inv.app Y))


/-- If an action is transitive, then composing this action with a surjective homomorphism gives
again a transitive action. -/
@[to_additive]
lemma isPretransitive_compHom {E F G : Type*} [Monoid E] [Monoid F] [MulAction F G]
    [IsPretransitive F G] {f : E →* F} (hf : Surjective f) :
    letI : MulAction E G := MulAction.compHom _ f
    IsPretransitive E G

{E : Type u_11}
{F : Type u_12}
{G : Type u_13}
[AddMonoid E]
[AddMonoid F]
[AddAction F G]
[AddAction.IsPretransitive F G]
{f : E →+ F}
(hf : Function.Surjective ⇑f)


/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability (version
without `|p|` factor) -/
theorem integrableOn_Ioi_comp_rpow_iff' [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    IntegrableOn (fun x => x ^ (p - 1) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
{p : ℝ}
(hp : p ≠ 0)

MeasureTheory.IntegrableOn (fun x => x ^ (p - 1) • f (x ^ p)) (Set.Ioi 0) MeasureTheory.volume ↔
  MeasureTheory.IntegrableOn f (Set.Ioi 0) MeasureTheory.volume


@[simp]
lemma units_smul_comp {n₁ n₂ n₁₂ : ℤ} (k : Rˣ) (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : (k • z₁).comp z₂ h = k • (z₁.comp z₂ h)

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

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


@[simp] theorem cast_cast {n m k : Nat} (h₁ : n = m) (h₂ : m = k) (x : BitVec n) :
    cast h₂ (cast h₁ x) = cast (h₁ ▸ h₂) x

BitVec.cast h₂ (BitVec.cast h₁ x) = BitVec.cast ⋯ x


theorem isImage_source_target_of_disjoint (e' : PartialHomeomorph X Y)
    (hs : Disjoint e.source e'.source) (ht : Disjoint e.target e'.target) :
    e.IsImage e'.source e'.target

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e e' : PartialHomeomorph X Y)
(hs : Disjoint e.source e'.source)
(ht : Disjoint e.target e'.target)


lemma Functor.isCoverDense_of_generate_singleton_functor_π_mem (G : C ⥤ D)
    (K : GrothendieckTopology D)
    (h : ∀ B, ∃ (X : C) (f : G.obj X ⟶ B), Sieve.generate (Presieve.singleton f) ∈ K B) :
    G.IsCoverDense K

(K : CategoryTheory.GrothendieckTopology D)

(h : ∀ (B : D), ∃ X f, CategoryTheory.Sieve.generate (CategoryTheory.Presieve.singleton f) ∈ K.sieves B)


@[simp]
theorem sigmaFinsuppLEquivPiFinsupp_symm_apply {M : Type*} {ιs : η → Type*} [AddCommMonoid M]
    [Module R M] (f : (j : _) → (ιs j →₀ M)) (ji) :
    (Finsupp.sigmaFinsuppLEquivPiFinsupp R).symm f ji = f ji.1 ji.2

(R : Type u_5)
[Semiring R]
{η : Type u_7}
[Fintype η]
{M : Type u_9}
{ιs : η → Type u_10}
[AddCommMonoid M]
[Module R M]
(f : (j : η) → ιs j →₀ M)
(ji : (j : η) × ιs j)

((Finsupp.sigmaFinsuppLEquivPiFinsupp R).symm f) ji = (f ji.fst) ji.snd


@[simp]
theorem Fintype.card_coe (s : Finset α) [Fintype s] : Fintype.card s = s.card

{α : Type u_1}
(s : Finset α)
[Fintype { x // x ∈ s }]


@[simp] lemma map_tprod (x : Π i, s i) :
    map f (tprod R x) = tprod R fun i ↦ f i (x i)

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)
(x : (i : ι) → s i)

(PiTensorProduct.map f) ((PiTensorProduct.tprod R) x) = ⨂ₜ[R] (i : ι), (f i) (x i)


@[simp]
theorem left_inr (g : G) : (inr g : N ⋊[φ] G).left = 1

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(g : G)


@[simp]
lemma residue_eq_zero_iff (x : R) : residue R x = 0 ↔ x ∈ maximalIdeal R

{R : Type u_1}
[CommRing R]
[LocalRing R]
(x : R)

(LocalRing.residue R) x = 0 ↔ x ∈ LocalRing.maximalIdeal R


theorem coeff_mem {n : ℕ} (hn : n ≠ f.natDegree) : f.coeff n ∈ 𝓟

{R : Type u}
[CommSemiring R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.IsEisensteinAt 𝓟)
{n : ℕ}
(hn : n ≠ f.natDegree)


@[simp]
theorem toComplex_ι (r : ℝ) : toComplex (ι Q r) = r • Complex.I

CliffordAlgebraComplex.toComplex ((CliffordAlgebra.ι CliffordAlgebraComplex.Q) r) = r • Complex.I


@[simp]
theorem norm_p : ‖(p : ℚ_[p])‖ = (p : ℝ)⁻¹

‖↑p‖ = (↑p)⁻¹


/-- The natural degree of `cyclotomic' n R` is `totient n` if there is a primitive root of
unity in `R`. -/
theorem natDegree_cyclotomic' {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) :
    (cyclotomic' n R).natDegree = Nat.totient n

{R : Type u_1}
[CommRing R]
[IsDomain R]
{ζ : R}
{n : ℕ}
(h : IsPrimitiveRoot ζ n)

(Polynomial.cyclotomic' n R).natDegree = n.totient


/-- `LocallyConstant.congrRight` as an `AlgEquiv`. -/
@[simps!]
def congrRightₐ (R : Type*) [CommSemiring R] [Semiring Y] [Algebra R Y] [Semiring Z] [Algebra R Z]
    (e : Y ≃ₐ[R] Z) : LocallyConstant X Y ≃ₐ[R] LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_6}
(R : Type u_7)
[CommSemiring R]
[Semiring Y]
[Algebra R Y]
[Semiring Z]
[Algebra R Z]
(e : Y ≃ₐ[R] Z)
(g : LocallyConstant X Z)

∀ (a : X), ((LocallyConstant.congrRightₐ R e).symm g) a = e.symm (g a)


/-- A flat is a maximal set having a given basis  -/
@[mk_iff]
structure Flat (M : Matroid α) (F : Set α) : Prop where
  subset_of_basis_of_basis : ∀ ⦃I X⦄, M.Basis I F → M.Basis I X → X ⊆ F
  subset_ground : F ⊆ M.E

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

M.Flat F ↔ (∀ ⦃I X : Set α⦄, M.Basis I F → M.Basis I X → X ⊆ F) ∧ F ⊆ M.E


theorem zipWithAll_map_right (l₁ : List α) (l₂ : List β) (f : β → β') (g : Option α → Option β' → γ) :
    zipWithAll g l₁ (l₂.map f) = zipWithAll (fun a b => g a (f <$> b)) l₁ l₂

{α : Type u_1}
{β β' : Type u_2}
{γ : Type u_3}
(l₁ : List α)
(l₂ : List β)
(f : β → β')
(g : Option α → Option β' → γ)

List.zipWithAll g l₁ (List.map f l₂) = List.zipWithAll (fun a b => g a (f <$> b)) l₁ l₂


@[simp]
theorem coeff_X (i : σ) : coeff (Finsupp.single i 1) (X i : MvPolynomial σ R) = 1

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(i : σ)

MvPolynomial.coeff (Finsupp.single i 1) (MvPolynomial.X i) = 1


theorem Dep.superset (hD : M.Dep D) (hDX : D ⊆ X) (hXE : X ⊆ M.E := by aesop_mat) : M.Dep X

{α : Type u_1}
{M : Matroid α}
{D X : Set α}
(hD : M.Dep D)
(hDX : D ⊆ X)
(hXE : X ⊆ M.E := by aesop_mat)


theorem isNormal_map (hφ : Function.Injective φ.obj) (hφ' : im φ hφ = ⊤) (Sn : S.IsNormal) :
    (map φ hφ S).IsNormal

(hφ' : CategoryTheory.Subgroupoid.im φ hφ = ⊤)

(CategoryTheory.Subgroupoid.map φ hφ S).IsNormal