[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.GaloisConnection.Defs).

[User]
Complete the following proof.

```lean
theorem monotone_intro (hu : Monotone u) (hl : Monotone l) (h_u_l : ∀ a, a ≤ u (l a))
    (h_l_u : ∀ a, l (u a) ≤ a) : GaloisConnection l u
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.GaloisConnection.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem monotone_intro (hu : Monotone u) (hl : Monotone l) (h_u_l : ∀ a, a ≤ u (l a))
    (h_l_u : ∀ a, l (u a) ≤ a) : GaloisConnection l u
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.CliffordAlgebra.Contraction).

[User]
Complete the following proof.

```lean
theorem changeForm_ι_mul (m : M) (x : CliffordAlgebra Q) :
    changeForm h (ι Q m * x) = ι Q' m * changeForm h x - B m⌋changeForm h x
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.CliffordAlgebra.Contraction).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem changeForm_ι_mul (m : M) (x : CliffordAlgebra Q) :
    changeForm h (ι Q m * x) = ι Q' m * changeForm h x - B m⌋changeForm h x
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]

mistral-common:Tekken v15 (Mistral chat template, [INST]/[SYSTEM_PROMPT])


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Bounds.Basic).

[User]
Complete the following proof.

```lean
theorem isGreatest_pair [LinearOrder γ] {a b : γ} : IsGreatest {a, b} (max a b)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.Bounds.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem isGreatest_pair [LinearOrder γ] {a b : γ} : IsGreatest {a, b} (max a b)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pointwise.Set.Basic).

[User]
Complete the following proof.

```lean
theorem coe_singletonMonoidHom : (singletonMonoidHom : α → Set α) = singleton
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pointwise.Set.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem coe_singletonMonoidHom : (singletonMonoidHom : α → Set α) = singleton
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.UniformConvergence).

[User]
Complete the following proof.

```lean
lemma UniformFun.ofFun_smul {M : Type*} [SMul M β] (c : M) (f : α → β) :
    ofFun (c • f) = c • ofFun f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.UniformConvergence).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma UniformFun.ofFun_smul {M : Type*} [SMul M β] (c : M) (f : α → β) :
    ofFun (c • f) = c • ofFun f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Combinatorics.Additive.AP.Three.Behrend).

[User]
Complete the following proof.

```lean
theorem bound (hN : 4096 ≤ N) : (N : ℝ) ^ (nValue N : ℝ)⁻¹ / exp 1 < dValue N
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Combinatorics.Additive.AP.Three.Behrend).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem bound (hN : 4096 ≤ N) : (N : ℝ) ^ (nValue N : ℝ)⁻¹ / exp 1 < dValue N
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.NielsenSchreier).

[User]
Complete the following proof.

```lean
lemma endIsFree : IsFreeGroup (End (root' T))
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.NielsenSchreier).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma endIsFree : IsFreeGroup (End (root' T))
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Rel).

[User]
Complete the following proof.

```lean
lemma right_subset_comp [R.IsRefl] {S : SetRel α β} : S ⊆ R ○ S
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Rel).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma right_subset_comp [R.IsRefl] {S : SetRel α β} : S ⊆ R ○ S
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.InnerProductSpace.SingularValues).

[User]
Complete the following proof.

```lean
theorem isLowerSet_support_singularValues : IsLowerSet (T.singularValues.support : Set ℕ)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.InnerProductSpace.SingularValues).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem isLowerSet_support_singularValues : IsLowerSet (T.singularValues.support : Set ℕ)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Ideal.Span).

[User]
Complete the following proof.

```lean
theorem span_insert_zero {s : Set α} : span (insert (0 : α) s) = span s
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Ideal.Span).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem span_insert_zero {s : Set α} : span (insert (0 : α) s) = span s
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Flat.EquationalCriterion).

[User]
Complete the following proof.

```lean
theorem sum_smul_eq_zero_of_isTrivialRelation (h : IsTrivialRelation f x) :
    ∑ i, f i • x i = 0
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.Flat.EquationalCriterion).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem sum_smul_eq_zero_of_isTrivialRelation (h : IsTrivialRelation f x) :
    ∑ i, f i • x i = 0
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.BilinearForm.Basic).

[User]
Complete the following proof.

```lean
lemma smul_left_of_tower (r : S) (x y : M) : B (r • x) y = r • B x y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.BilinearForm.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma smul_left_of_tower (r : S) (x y : M) : B (r • x) y = r • B x y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.BigOperators.Group.Finset.Basic).

[User]
Complete the following proof.

```lean
theorem prod_comp_equiv {f : κ → M} (e : ι ≃ κ) : s.prod (f ∘ e) = (s.map e).prod f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.BigOperators.Group.Finset.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem prod_comp_equiv {f : κ → M} (e : ι ≃ κ) : s.prod (f ∘ e) = (s.map e).prod f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Calculus.Deriv.MeanValue).

[User]
Complete the following proof.

```lean
theorem image_sub_lt_mul_sub_of_deriv_lt {f : ℝ → ℝ} (hf : Differentiable ℝ f) {C}
    (lt_hf' : ∀ x, deriv f x < C) ⦃x y⦄ (hxy : x < y) : f y - f x < C * (y - x)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.Calculus.Deriv.MeanValue).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem image_sub_lt_mul_sub_of_deriv_lt {f : ℝ → ℝ} (hf : Differentiable ℝ f) {C}
    (lt_hf' : ∀ x, deriv f x < C) ⦃x y⦄ (hxy : x < y) : f y - f x < C * (y - x)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic).

[User]
Complete the following proof.

```lean
abbrev plusPart : Set (mixedSpace K)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
abbrev plusPart : Set (mixedSpace K)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Polynomial.Coeff).

[User]
Complete the following proof.

```lean
theorem coeff_X_add_one_pow (R : Type*) [Semiring R] (n k : ℕ) :
    ((X + 1) ^ n).coeff k = (n.choose k : R)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Polynomial.Coeff).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem coeff_X_add_one_pow (R : Type*) [Semiring R] (n k : ℕ) :
    ((X + 1) ^ n).coeff k = (n.choose k : R)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs).

[User]
Complete the following proof.

```lean
theorem PosMulReflectLT.toMulPosReflectLT [PosMulReflectLT α] : MulPosReflectLT α
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.GroupWithZero.Unbundled.Defs).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem PosMulReflectLT.toMulPosReflectLT [PosMulReflectLT α] : MulPosReflectLT α
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.SeparationQuotient.Basic).

[User]
Complete the following proof.

```lean
instance instMulAction {M X : Type*} [Monoid M] [MulAction M X] [TopologicalSpace X]
    [ContinuousConstSMul M X] : MulAction M (SeparationQuotient X)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.SeparationQuotient.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
instance instMulAction {M X : Type*} [Monoid M] [MulAction M X] [TopologicalSpace X]
    [ContinuousConstSMul M X] : MulAction M (SeparationQuotient X)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.Reduce).

[User]
Complete the following proof.

```lean
theorem reduce.min (H : Red (reduce L₁) L₂) : reduce L₁ = L₂
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.GroupTheory.FreeGroup.Reduce).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem reduce.min (H : Red (reduce L₁) L₂) : reduce L₁ = L₂
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.FractionalIdeal.Operations).

[User]
Complete the following proof.

```lean
theorem le_self_mul_one_div {I : FractionalIdeal R₁⁰ K} (hI : I ≤ (1 : FractionalIdeal R₁⁰ K)) :
    I ≤ I * (1 / I)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.FractionalIdeal.Operations).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem le_self_mul_one_div {I : FractionalIdeal R₁⁰ K} (hI : I ≤ (1 : FractionalIdeal R₁⁰ K)) :
    I ≤ I * (1 / I)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Prod).

[User]
Complete the following proof.

```lean
theorem graph_eq_ker_coprod : g.graph = ker ((-g).coprod LinearMap.id)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Prod).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem graph_eq_ker_coprod : g.graph = ker ((-g).coprod LinearMap.id)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.ToIntervalMod).

[User]
Complete the following proof.

```lean
theorem toIocMod_apply_left (a : α) : toIocMod hp a a = a + p
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.ToIntervalMod).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem toIocMod_apply_left (a : α) : toIocMod hp a a = a + p
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.CartanExists).

[User]
Complete the following proof.

```lean
lemma lieCharpoly_coeff_natDegree [Nontrivial R] (i j : ℕ) (hij : i + j = finrank R M) :
    ((lieCharpoly R M x y).coeff i).natDegree ≤ j
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.CartanExists).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma lieCharpoly_coeff_natDegree [Nontrivial R] (i j : ℕ) (hij : i + j = finrank R M) :
    ((lieCharpoly R M x y).coeff i).natDegree ≤ j
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Lattice).

[User]
Complete the following proof.

```lean
theorem iUnion_inter (s : Set β) (t : ι → Set β) : (⋃ i, t i) ∩ s = ⋃ i, t i ∩ s
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Set.Lattice).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem iUnion_inter (s : Set β) (t : ι → Set β) : (⋃ i, t i) ∩ s = ⋃ i, t i ∩ s
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Semicontinuity.Basic).

[User]
Complete the following proof.

```lean
theorem lowerSemicontinuousWithinAt_iff_le_liminf {f : α → γ} :
    LowerSemicontinuousWithinAt f s x ↔ f x ≤ liminf f (𝓝[s] x)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Semicontinuity.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem lowerSemicontinuousWithinAt_iff_le_liminf {f : α → γ} :
    LowerSemicontinuousWithinAt f s x ↔ f x ≤ liminf f (𝓝[s] x)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.TensorPower.Basic).

[User]
Complete the following proof.

```lean
instance gMul : GradedMonoid.GMul fun i => ⨂[R]^i M where
  mul {i j} a b
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.TensorPower.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
instance gMul : GradedMonoid.GMul fun i => ⨂[R]^i M where
  mul {i j} a b
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.ArithmeticFunction.Zeta).

[User]
Complete the following proof.

```lean
theorem ppow_succ {f : ArithmeticFunction R} {k : ℕ} {kpos : 0 < k} :
    f.ppow (k + 1) = (f.ppow k).pmul f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.ArithmeticFunction.Zeta).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem ppow_succ {f : ArithmeticFunction R} {k : ℕ} {kpos : 0 < k} :
    f.ppow (k + 1) = (f.ppow k).pmul f
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Instances.ENNReal.Lemmas).

[User]
Complete the following proof.

```lean
theorem le_of_forall_lt_one_mul_le {x y : ℝ≥0∞} (h : ∀ a < 1, a * x ≤ y) : x ≤ y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Instances.ENNReal.Lemmas).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem le_of_forall_lt_one_mul_le {x y : ℝ≥0∞} (h : ∀ a < 1, a * x ≤ y) : x ≤ y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.UniformRing).

[User]
Complete the following proof.

```lean
theorem mapRingHom_coe (hf : Continuous f) (a : α) : mapRingHom f hf a = f a
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Topology.Algebra.UniformRing).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem mapRingHom_coe (hf : Continuous f) (a : α) : mapRingHom f hf a = f a
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Rat.Lemmas).

[User]
Complete the following proof.

```lean
theorem mkRat_add_mkRat_of_den (n₁ n₂ : Int) {d : Nat} (h : d ≠ 0) :
    mkRat n₁ d + mkRat n₂ d = mkRat (n₁ + n₂) d
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Rat.Lemmas).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem mkRat_add_mkRat_of_den (n₁ n₂ : Int) {d : Nat} (h : d ≠ 0) :
    mkRat n₁ d + mkRat n₂ d = mkRat (n₁ + n₂) d
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Module.SpanRank).

[User]
Complete the following proof.

```lean
lemma Ideal.spanRank_map_eq_of_ringEquiv (f : R ≃+* S) (I : Ideal R) :
    (I.map f).spanRank = I.spanRank
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Module.SpanRank).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma Ideal.spanRank_map_eq_of_ringEquiv (f : R ≃+* S) (I : Ideal R) :
    (I.map f).spanRank = I.spanRank
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Polynomial.PartialFractions).

[User]
Complete the following proof.

```lean
theorem eq_quo_mul_prod_pow_add_sum_rem_mul_prod_pow [Nontrivial R] {ι : Type*} [DecidableEq ι]
    {s : Finset ι} (f : R[X]) {g : ι → R[X]} (hg : ∀ i ∈ s, (g i).Monic)
    (hgg : Set.Pairwise s fun i j => IsCoprime (g i) (g j)) (n : ι → ℕ) :
    ∃ (q : R[X]) (r : (i : ι) → Fin (n i) → R[X]),
      (∀ i ∈ s, ∀ j, (r i j).degree < (g i).degree) ∧
      f = q * (∏ i ∈ s, g i ^ n i) +
        ∑ i ∈ s, ∑ j, r i j * g i ^ j.1 * ∏ k ∈ s.erase i, g k ^ n k
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Polynomial.PartialFractions).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem eq_quo_mul_prod_pow_add_sum_rem_mul_prod_pow [Nontrivial R] {ι : Type*} [DecidableEq ι]
    {s : Finset ι} (f : R[X]) {g : ι → R[X]} (hg : ∀ i ∈ s, (g i).Monic)
    (hgg : Set.Pairwise s fun i j => IsCoprime (g i) (g j)) (n : ι → ℕ) :
    ∃ (q : R[X]) (r : (i : ι) → Fin (n i) → R[X]),
      (∀ i ∈ s, ∀ j, (r i j).degree < (g i).degree) ∧
      f = q * (∏ i ∈ s, g i ^ n i) +
        ∑ i ∈ s, ∑ j, r i j * g i ^ j.1 * ∏ k ∈ s.erase i, g k ^ n k
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Nat.Cast.Basic).

[User]
Complete the following proof.

```lean
lemma ofNat_def (n : ℕ) [∀ i, OfNat (π i) n] : (OfNat.ofNat n : ∀ a, π a) = fun _ ↦ ofNat(n)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Nat.Cast.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
lemma ofNat_def (n : ℕ) [∀ i, OfNat (π i) n] : (OfNat.ofNat n : ∀ a, π a) = fun _ ↦ ofNat(n)
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.AffineSpace.AffineEquiv).

[User]
Complete the following proof.

```lean
theorem mul_def (e e' : P₁ ≃ᵃ[k] P₁) : e * e' = e'.trans e
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.AffineSpace.AffineEquiv).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem mul_def (e e' : P₁ ≃ᵃ[k] P₁) : e * e' = e'.trans e
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.UpperLower.Closure).

[User]
Complete the following proof.

```lean
def giUpperClosureCoe :
    GaloisInsertion (toDual ∘ upperClosure : Set α → (UpperSet α)ᵒᵈ) ((↑) ∘ ofDual) where
  choice s hs
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.UpperLower.Closure).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
def giUpperClosureCoe :
    GaloisInsertion (toDual ∘ upperClosure : Set α → (UpperSet α)ᵒᵈ) ((↑) ∘ ofDual) where
  choice s hs
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pointwise.Finset.Basic).

[User]
Complete the following proof.

```lean
theorem preimage_mul_left_one' : preimage 1 (a⁻¹ * ·) (mul_right_injective _).injOn = {a}
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Group.Pointwise.Finset.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem preimage_mul_left_one' : preimage 1 (a⁻¹ * ·) (mul_right_injective _).injOn = {a}
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Ray).

[User]
Complete the following proof.

```lean
theorem exists_nonneg_right (h : SameRay R x y) (hy : y ≠ 0) : ∃ r : R, 0 ≤ r ∧ x = r • y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.LinearAlgebra.Ray).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem exists_nonneg_right (h : SameRay R x y) (hy : y ≠ 0) : ∃ r : R, 0 ≤ r ∧ x = r • y
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.BoundedOrder.Monotone).

[User]
Complete the following proof.

```lean
theorem forall_ge_iff {P : α → Prop} {x₀ : α} (hP : Monotone P) :
    (∀ x ≥ x₀, P x) ↔ P x₀
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Order.BoundedOrder.Monotone).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Complete the following proof.

```lean
theorem forall_ge_iff {P : α → Prop} {x₀ : α} (hP : Monotone P) :
    (∀ x ≥ x₀, P x) ↔ P x₀
```

Provide a complete Lean proof for the statement above. Do not include the statement in your answer.[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Multiset.Powerset).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
    powersetCard n (s.map f) = (powersetCard n s).map (map f)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux (L30-L32)
def powersetAux (l : List α) : List (Multiset α)
```

-- snippet 2
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux_eq_map_coe (L33-L35)
theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map (↑)
```

-- snippet 3
```lean
-- Mathlib.Data.Multiset.Powerset.mem_powersetAux (L37-L41)
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l
```

-- snippet 4
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux' (L42-L44)
def powersetAux' (l : List α) : List (Multiset α)
```

-- snippet 5
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux_perm_powersetAux' (L45-L47)
theorem powersetAux_perm_powersetAux' {l : List α} : powersetAux l ~ powersetAux' l
```

-- snippet 6
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux'_nil (L49-L51)
theorem powersetAux'_nil : powersetAux' (@nil α) = [0]
```

-- snippet 7
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux'_cons (L53-L56)
theorem powersetAux'_cons (a : α) (l : List α) :
    powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l)
```

-- snippet 8
```lean
-- Mathlib.Data.Multiset.Powerset.powerset_aux'_perm (L57-L70)
theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂
```

-- snippet 9
```lean
-- Mathlib.Data.Multiset.AddSub.subset_add_left (L93-L94)
lemma subset_add_left {s t : Multiset α} : s ⊆ s + t
```

-- snippet 10
```lean
-- Mathlib.Data.Multiset.AddSub.le_add_left (L90-L92)
lemma le_add_left (s t : Multiset α) : s ≤ t + s
```

-- snippet 11
```lean
-- Mathlib.Data.Multiset.AddSub.le_add_right (L87-L89)
lemma le_add_right (s t : Multiset α) : s ≤ s + t
```

-- snippet 12
```lean
-- Mathlib.Data.Multiset.AddSub.singleton_add (L62-L79)
theorem singleton_add (a : α) (s : Multiset α) : {a} + s = a ::ₘ s
```

-- snippet 13
```lean
-- Mathlib.Data.Multiset.AddSub.subset_add_right (L95-L96)
lemma subset_add_right {s t : Multiset α} : s ⊆ t + s
```

-- snippet 14
```lean
-- Mathlib.Data.Multiset.AddSub.coe_add (L58-L60)
theorem coe_add (s t : List α) : (s + t : Multiset α) = (s ++ t : List α)
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Data.Multiset.Powerset).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
    powersetCard n (s.map f) = (powersetCard n s).map (map f)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux (L30-L32)
def powersetAux (l : List α) : List (Multiset α)
```

-- snippet 2
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux_eq_map_coe (L33-L35)
theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map (↑)
```

-- snippet 3
```lean
-- Mathlib.Data.Multiset.Powerset.mem_powersetAux (L37-L41)
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l
```

-- snippet 4
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux' (L42-L44)
def powersetAux' (l : List α) : List (Multiset α)
```

-- snippet 5
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux_perm_powersetAux' (L45-L47)
theorem powersetAux_perm_powersetAux' {l : List α} : powersetAux l ~ powersetAux' l
```

-- snippet 6
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux'_nil (L49-L51)
theorem powersetAux'_nil : powersetAux' (@nil α) = [0]
```

-- snippet 7
```lean
-- Mathlib.Data.Multiset.Powerset.powersetAux'_cons (L53-L56)
theorem powersetAux'_cons (a : α) (l : List α) :
    powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l)
```

-- snippet 8
```lean
-- Mathlib.Data.Multiset.Powerset.powerset_aux'_perm (L57-L70)
theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂
```

-- snippet 9
```lean
-- Mathlib.Data.Multiset.AddSub.subset_add_left (L93-L94)
lemma subset_add_left {s t : Multiset α} : s ⊆ s + t
```

-- snippet 10
```lean
-- Mathlib.Data.Multiset.AddSub.le_add_left (L90-L92)
lemma le_add_left (s t : Multiset α) : s ≤ t + s
```

-- snippet 11
```lean
-- Mathlib.Data.Multiset.AddSub.le_add_right (L87-L89)
lemma le_add_right (s t : Multiset α) : s ≤ s + t
```

-- snippet 12
```lean
-- Mathlib.Data.Multiset.AddSub.singleton_add (L62-L79)
theorem singleton_add (a : α) (s : Multiset α) : {a} + s = a ::ₘ s
```

-- snippet 13
```lean
-- Mathlib.Data.Multiset.AddSub.subset_add_right (L95-L96)
lemma subset_add_right {s t : Multiset α} : s ⊆ t + s
```

-- snippet 14
```lean
-- Mathlib.Data.Multiset.AddSub.coe_add (L58-L60)
theorem coe_add (s t : List α) : (s + t : Multiset α) = (s ++ t : List α)
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Prod).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem inr_eq_prod : inr R L₁ L₂ = prod 0 LieHom.id
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Prod.instLieRing (L42-L48)
instance instLieRing : LieRing (L₁ × L₂) where
  bracket x y
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Prod.bracket_apply (L50-L51)
theorem bracket_apply (x y : L₁ × L₂) : ⁅x, y⁆ = ⟨⁅x.1, y.1⁆, ⁅x.2, y.2⁆⟩
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Prod.instLieAlgebra (L52-L58)
instance instLieAlgebra : LieAlgebra R (L₁ × L₂) where
  lie_smul _ _ _
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Prod.fst (L63-L67)
def fst : L₁ × L₂ →ₗ⁅R⁆ L₁ where
  toLinearMap
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Prod.snd (L68-L72)
def snd : L₁ × L₂ →ₗ⁅R⁆ L₂ where
  toLinearMap
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Prod.inl (L73-L77)
def inl : L₁ →ₗ⁅R⁆ L₁ × L₂ where
  toLinearMap
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Prod.inr (L78-L81)
def inr : L₂ →ₗ⁅R⁆ L₁ × L₂ where
  toLinearMap
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Prod.fst_surjective (L92-L93)
theorem fst_surjective : Function.Surjective (fst R L₁ L₂)
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 14
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Prod).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem inr_eq_prod : inr R L₁ L₂ = prod 0 LieHom.id
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Prod.instLieRing (L42-L48)
instance instLieRing : LieRing (L₁ × L₂) where
  bracket x y
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Prod.bracket_apply (L50-L51)
theorem bracket_apply (x y : L₁ × L₂) : ⁅x, y⁆ = ⟨⁅x.1, y.1⁆, ⁅x.2, y.2⁆⟩
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Prod.instLieAlgebra (L52-L58)
instance instLieAlgebra : LieAlgebra R (L₁ × L₂) where
  lie_smul _ _ _
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Prod.fst (L63-L67)
def fst : L₁ × L₂ →ₗ⁅R⁆ L₁ where
  toLinearMap
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Prod.snd (L68-L72)
def snd : L₁ × L₂ →ₗ⁅R⁆ L₂ where
  toLinearMap
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Prod.inl (L73-L77)
def inl : L₁ →ₗ⁅R⁆ L₁ × L₂ where
  toLinearMap
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Prod.inr (L78-L81)
def inr : L₂ →ₗ⁅R⁆ L₁ × L₂ where
  toLinearMap
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Prod.fst_surjective (L92-L93)
theorem fst_surjective : Function.Surjective (fst R L₁ L₂)
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 14
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.LocallyConvex.Separation).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem geometric_hahn_banach_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht : Convex ℝ t)
    (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u ≤ f b
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.separate_convex_open_set (L54-L87)
theorem separate_convex_open_set [TopologicalSpace E] [AddCommGroup E] [IsTopologicalAddGroup E]
    [Module ℝ E] [ContinuousSMul ℝ E] {s : Set E} (hs₀ : (0 : E) ∈ s) (hs₁ : Convex ℝ s)
    (hs₂ : IsOpen s) {x₀ : E} (hx₀ : x₀ ∉ s) :
    ∃ f : StrongDual ℝ E, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1
```

-- snippet 2
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_open_point (L124-L129)
theorem geometric_hahn_banach_open_point (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (disj : x ∉ s) :
    ∃ f : StrongDual ℝ E, ∀ a ∈ s, f a < f x
```

-- snippet 3
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_point_open (L130-L134)
theorem geometric_hahn_banach_point_open (ht₁ : Convex ℝ t) (ht₂ : IsOpen t) (disj : x ∉ t) :
    ∃ f : StrongDual ℝ E, ∀ b ∈ t, f x < f b
```

-- snippet 4
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_open_open (L135-L153)
theorem geometric_hahn_banach_open_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht₁ : Convex ℝ t)
    (ht₃ : IsOpen t) (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u < f b
```

-- snippet 5
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior (L154-L172)
theorem geometric_hahn_banach_of_nonempty_interior
  (hs : Convex ℝ s) (ht : Convex ℝ t) (hst : Disjoint (interior s) t)
    (hsint : (interior s).Nonempty) (htne : t.Nonempty) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), f ≠ 0 ∧ (∀ a ∈ s, f a ≤ u) ∧ ∀ b ∈ t, u ≤ f b
```

-- snippet 6
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior' (L173-L184)
theorem geometric_hahn_banach_of_nonempty_interior'
  (hs : Convex ℝ s) (ht : Convex ℝ t) (hst : Disjoint (interior s) t)
    (hsint : (interior s).Nonempty) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a ≤ u) ∧ ∀ b ∈ t, u ≤ f b
```

-- snippet 7
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior_point (L185-L196)
theorem geometric_hahn_banach_of_nonempty_interior_point
    {A : Set E} (hA : Convex ℝ A) (hxA : x ∉ interior A) (hAint : (interior A).Nonempty) :
    ∃ f : StrongDual ℝ E, f ≠ 0 ∧ ∀ a ∈ A, f a ≤ f x
```

-- snippet 8
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_compact_closed (L197-L216)
theorem geometric_hahn_banach_compact_closed (hs₁ : Convex ℝ s) (hs₂ : IsCompact s)
    (ht₁ : Convex ℝ t) (ht₂ : IsClosed t) (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u v : ℝ), (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b
```

-- snippet 9
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.balanced_absConvexHull (L90-L92)
theorem balanced_absConvexHull : Balanced 𝕜 (absConvexHull 𝕜 s)
```

-- snippet 10
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.AbsConvex (L53-L56)
def AbsConvex (s : Set E) : Prop
```

-- snippet 11
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.absConvex_absConvexHull (L87-L89)
theorem absConvex_absConvexHull : AbsConvex 𝕜 (absConvexHull 𝕜 s)
```

-- snippet 12
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.subset_absConvexHull (L84-L86)
theorem subset_absConvexHull : s ⊆ absConvexHull 𝕜 s
```

-- snippet 13
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.absConvexHull (L79-L83)
def absConvexHull : ClosureOperator (Set E)
```

-- snippet 14
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.convex_absConvexHull (L93-L96)
theorem convex_absConvexHull : Convex 𝕜 (absConvexHull 𝕜 s)
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Analysis.LocallyConvex.Separation).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem geometric_hahn_banach_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht : Convex ℝ t)
    (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u ≤ f b
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.separate_convex_open_set (L54-L87)
theorem separate_convex_open_set [TopologicalSpace E] [AddCommGroup E] [IsTopologicalAddGroup E]
    [Module ℝ E] [ContinuousSMul ℝ E] {s : Set E} (hs₀ : (0 : E) ∈ s) (hs₁ : Convex ℝ s)
    (hs₂ : IsOpen s) {x₀ : E} (hx₀ : x₀ ∉ s) :
    ∃ f : StrongDual ℝ E, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1
```

-- snippet 2
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_open_point (L124-L129)
theorem geometric_hahn_banach_open_point (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (disj : x ∉ s) :
    ∃ f : StrongDual ℝ E, ∀ a ∈ s, f a < f x
```

-- snippet 3
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_point_open (L130-L134)
theorem geometric_hahn_banach_point_open (ht₁ : Convex ℝ t) (ht₂ : IsOpen t) (disj : x ∉ t) :
    ∃ f : StrongDual ℝ E, ∀ b ∈ t, f x < f b
```

-- snippet 4
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_open_open (L135-L153)
theorem geometric_hahn_banach_open_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht₁ : Convex ℝ t)
    (ht₃ : IsOpen t) (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u < f b
```

-- snippet 5
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior (L154-L172)
theorem geometric_hahn_banach_of_nonempty_interior
  (hs : Convex ℝ s) (ht : Convex ℝ t) (hst : Disjoint (interior s) t)
    (hsint : (interior s).Nonempty) (htne : t.Nonempty) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), f ≠ 0 ∧ (∀ a ∈ s, f a ≤ u) ∧ ∀ b ∈ t, u ≤ f b
```

-- snippet 6
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior' (L173-L184)
theorem geometric_hahn_banach_of_nonempty_interior'
  (hs : Convex ℝ s) (ht : Convex ℝ t) (hst : Disjoint (interior s) t)
    (hsint : (interior s).Nonempty) :
    ∃ (f : StrongDual ℝ E) (u : ℝ), (∀ a ∈ s, f a ≤ u) ∧ ∀ b ∈ t, u ≤ f b
```

-- snippet 7
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_of_nonempty_interior_point (L185-L196)
theorem geometric_hahn_banach_of_nonempty_interior_point
    {A : Set E} (hA : Convex ℝ A) (hxA : x ∉ interior A) (hAint : (interior A).Nonempty) :
    ∃ f : StrongDual ℝ E, f ≠ 0 ∧ ∀ a ∈ A, f a ≤ f x
```

-- snippet 8
```lean
-- Mathlib.Analysis.LocallyConvex.Separation.geometric_hahn_banach_compact_closed (L197-L216)
theorem geometric_hahn_banach_compact_closed (hs₁ : Convex ℝ s) (hs₂ : IsCompact s)
    (ht₁ : Convex ℝ t) (ht₂ : IsClosed t) (disj : Disjoint s t) :
    ∃ (f : StrongDual ℝ E) (u v : ℝ), (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b
```

-- snippet 9
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.balanced_absConvexHull (L90-L92)
theorem balanced_absConvexHull : Balanced 𝕜 (absConvexHull 𝕜 s)
```

-- snippet 10
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.AbsConvex (L53-L56)
def AbsConvex (s : Set E) : Prop
```

-- snippet 11
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.absConvex_absConvexHull (L87-L89)
theorem absConvex_absConvexHull : AbsConvex 𝕜 (absConvexHull 𝕜 s)
```

-- snippet 12
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.subset_absConvexHull (L84-L86)
theorem subset_absConvexHull : s ⊆ absConvexHull 𝕜 s
```

-- snippet 13
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.absConvexHull (L79-L83)
def absConvexHull : ClosureOperator (Set E)
```

-- snippet 14
```lean
-- Mathlib.Analysis.LocallyConvex.AbsConvex.convex_absConvexHull (L93-L96)
theorem convex_absConvexHull : Convex 𝕜 (absConvexHull 𝕜 s)
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Graded).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
lemma ofGrading_apply_apply (φ : ι →+ R) {i : ι} {a : L} (ha : a ∈ ℒ i) :
    ofGrading ℒ φ a = φ i • a
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Graded.bracket_apply_apply (L64-L68)
lemma bracket_apply_apply (x y : ⨁ i, ℒ i) :
    ⁅x, y⁆ =
      decomposeLinearEquiv ℒ ⁅(decomposeLinearEquiv ℒ).symm x, (decomposeLinearEquiv ℒ).symm y⁆
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Graded.decompose_bracket (L72-L75)
lemma decompose_bracket (x y : L) : decompose ℒ ⁅x, y⁆ = ⁅decompose ℒ x, decompose ℒ y⁆
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Graded.decompose_symm_bracket (L77-L81)
lemma decompose_symm_bracket (x y : ⨁ i, ℒ i) :
    (decompose ℒ).symm ⁅x, y⁆  = ⁅(decompose ℒ).symm x, (decompose ℒ).symm y⁆
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Graded.decomposeLieEquiv (L89-L101)
def decomposeLieEquiv : L ≃ₗ⁅R⁆ ⨁ i, ℒ i
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Graded.ofGradingSum (L102-L134)
def ofGradingSum (φ : ι →+ R) : LieDerivation R (⨁ i, ℒ i) (⨁ i, ℒ i)
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Graded.ofGradingSum_of (L136-L141)
lemma ofGradingSum_of (φ : ι →+ R) (i : ι) (a : ℒ i) :
    ofGradingSum ℒ φ (of (ℒ ·) i a) = (φ i) • (of (ℒ ·) i a)
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Graded.ofGrading (L142-L148)
def ofGrading (φ : ι →+ R) :
    LieDerivation R L L where
  toFun x
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Graded).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
lemma ofGrading_apply_apply (φ : ι →+ R) {i : ι} {a : L} (ha : a ∈ ℒ i) :
    ofGrading ℒ φ a = φ i • a
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Graded.bracket_apply_apply (L64-L68)
lemma bracket_apply_apply (x y : ⨁ i, ℒ i) :
    ⁅x, y⁆ =
      decomposeLinearEquiv ℒ ⁅(decomposeLinearEquiv ℒ).symm x, (decomposeLinearEquiv ℒ).symm y⁆
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Graded.decompose_bracket (L72-L75)
lemma decompose_bracket (x y : L) : decompose ℒ ⁅x, y⁆ = ⁅decompose ℒ x, decompose ℒ y⁆
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Graded.decompose_symm_bracket (L77-L81)
lemma decompose_symm_bracket (x y : ⨁ i, ℒ i) :
    (decompose ℒ).symm ⁅x, y⁆  = ⁅(decompose ℒ).symm x, (decompose ℒ).symm y⁆
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Graded.decomposeLieEquiv (L89-L101)
def decomposeLieEquiv : L ≃ₗ⁅R⁆ ⨁ i, ℒ i
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Graded.ofGradingSum (L102-L134)
def ofGradingSum (φ : ι →+ R) : LieDerivation R (⨁ i, ℒ i) (⨁ i, ℒ i)
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Graded.ofGradingSum_of (L136-L141)
lemma ofGradingSum_of (φ : ι →+ R) (i : ι) (a : ℒ i) :
    ofGradingSum ℒ φ (of (ℒ ·) i a) = (φ i) • (of (ℒ ·) i a)
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Graded.ofGrading (L142-L148)
def ofGrading (φ : ι →+ R) :
    LieDerivation R L L where
  toFun x
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.LocalProperties.Basic).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
lemma RingHom.LocalizationAwayPreserves.and (hP : LocalizationAwayPreserves P)
    (hQ : LocalizationAwayPreserves Q) :
    LocalizationAwayPreserves (fun f ↦ P f ∧ Q f)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.LocalizationPreserves (L65-L70)
def LocalizationPreserves : Prop
```

-- snippet 2
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.OfLocalizationMaximal (L71-L82)
def OfLocalizationMaximal : Prop
```

-- snippet 3
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L525-L528)
theorem Ideal.localized'_eq_map (I : Ideal R) :
    Submodule.localized' S p (Algebra.linearMap R S) I = I.map (algebraMap R S)
```

-- snippet 4
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L529-L532)
theorem Ideal.localized₀_eq_restrictScalars_map (I : Ideal R) :
    Submodule.localized₀ p (Algebra.linearMap R S) I = (I.map (algebraMap R S)).restrictScalars R
```

-- snippet 5
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Algebra (L533-L538)
theorem Algebra.idealMap_eq_ofEq_comp_toLocalized₀ (I : Ideal R) :
    Algebra.idealMap S I =
      (LinearEquiv.ofEq _ _ <| Ideal.localized₀_eq_restrictScalars_map S p I).toLinearMap ∘ₗ
      Submodule.toLocalized₀ p (Algebra.linearMap R S) I
```

-- snippet 6
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L539-L547)
theorem Ideal.mem_of_localization_maximal {r : R} {J : Ideal R}
    (h : ∀ (P : Ideal R) (_ : P.IsMaximal),
      algebraMap R _ r ∈ Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    r ∈ J
```

-- snippet 7
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L548-L554)
theorem Ideal.le_of_localization_maximal {I J : Ideal R}
    (h : ∀ (P : Ideal R) (_ : P.IsMaximal),
      Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤
        Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    I ≤ J
```

-- snippet 8
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L555-L566)
lemma Ideal.iInf_ker_le (I : Ideal R) :
    ⨅ (p : Ideal R) (_ : p.IsPrime) (_ : I ≤ p),
      RingHom.ker (algebraMap R (Localization.AtPrime p)) ≤ I
```

-- snippet 9
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.LinearIndependent (L91-L103)
theorem LinearIndependent.of_isLocalized_maximal {ι} (v : ι → M)
    (H : ∀ (P : Ideal R) [P.IsMaximal], LinearIndependent (Rₚ P) (f P ∘ v)) :
    LinearIndependent R v
```

-- snippet 10
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.injective_of_localized_maximal (L104-L108)
theorem injective_of_localized_maximal
    (h : ∀ (J : Ideal R) [J.IsMaximal], Function.Injective (map J.primeCompl f)) :
    Function.Injective f
```

-- snippet 11
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.bijective_of_isLocalized_maximal (L72-L77)
theorem bijective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Bijective (map P.primeCompl (f P) (g P) F)) :
    Function.Bijective F
```

-- snippet 12
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.injective_of_isLocalized_maximal (L60-L64)
theorem injective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Injective (map P.primeCompl (f P) (g P) F)) :
    Function.Injective F
```

-- snippet 13
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.surjective_of_isLocalized_maximal (L65-L71)
theorem surjective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Surjective (map P.primeCompl (f P) (g P) F)) :
    Function.Surjective F
```

-- snippet 14
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.exact_of_isLocalized_maximal (L78-L90)
theorem exact_of_isLocalized_maximal (H : ∀ (J : Ideal R) [J.IsMaximal],
    Function.Exact (map J.primeCompl (f J) (g J) F) (map J.primeCompl (g J) (h J) G)) :
    Function.Exact F G
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.RingTheory.LocalProperties.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
lemma RingHom.LocalizationAwayPreserves.and (hP : LocalizationAwayPreserves P)
    (hQ : LocalizationAwayPreserves Q) :
    LocalizationAwayPreserves (fun f ↦ P f ∧ Q f)
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.LocalizationPreserves (L65-L70)
def LocalizationPreserves : Prop
```

-- snippet 2
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.OfLocalizationMaximal (L71-L82)
def OfLocalizationMaximal : Prop
```

-- snippet 3
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L525-L528)
theorem Ideal.localized'_eq_map (I : Ideal R) :
    Submodule.localized' S p (Algebra.linearMap R S) I = I.map (algebraMap R S)
```

-- snippet 4
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L529-L532)
theorem Ideal.localized₀_eq_restrictScalars_map (I : Ideal R) :
    Submodule.localized₀ p (Algebra.linearMap R S) I = (I.map (algebraMap R S)).restrictScalars R
```

-- snippet 5
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Algebra (L533-L538)
theorem Algebra.idealMap_eq_ofEq_comp_toLocalized₀ (I : Ideal R) :
    Algebra.idealMap S I =
      (LinearEquiv.ofEq _ _ <| Ideal.localized₀_eq_restrictScalars_map S p I).toLinearMap ∘ₗ
      Submodule.toLocalized₀ p (Algebra.linearMap R S) I
```

-- snippet 6
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L539-L547)
theorem Ideal.mem_of_localization_maximal {r : R} {J : Ideal R}
    (h : ∀ (P : Ideal R) (_ : P.IsMaximal),
      algebraMap R _ r ∈ Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    r ∈ J
```

-- snippet 7
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L548-L554)
theorem Ideal.le_of_localization_maximal {I J : Ideal R}
    (h : ∀ (P : Ideal R) (_ : P.IsMaximal),
      Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤
        Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    I ≤ J
```

-- snippet 8
```lean
-- Mathlib.RingTheory.LocalProperties.Basic.Ideal (L555-L566)
lemma Ideal.iInf_ker_le (I : Ideal R) :
    ⨅ (p : Ideal R) (_ : p.IsPrime) (_ : I ≤ p),
      RingHom.ker (algebraMap R (Localization.AtPrime p)) ≤ I
```

-- snippet 9
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.LinearIndependent (L91-L103)
theorem LinearIndependent.of_isLocalized_maximal {ι} (v : ι → M)
    (H : ∀ (P : Ideal R) [P.IsMaximal], LinearIndependent (Rₚ P) (f P ∘ v)) :
    LinearIndependent R v
```

-- snippet 10
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.injective_of_localized_maximal (L104-L108)
theorem injective_of_localized_maximal
    (h : ∀ (J : Ideal R) [J.IsMaximal], Function.Injective (map J.primeCompl f)) :
    Function.Injective f
```

-- snippet 11
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.bijective_of_isLocalized_maximal (L72-L77)
theorem bijective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Bijective (map P.primeCompl (f P) (g P) F)) :
    Function.Bijective F
```

-- snippet 12
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.injective_of_isLocalized_maximal (L60-L64)
theorem injective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Injective (map P.primeCompl (f P) (g P) F)) :
    Function.Injective F
```

-- snippet 13
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.surjective_of_isLocalized_maximal (L65-L71)
theorem surjective_of_isLocalized_maximal
    (H : ∀ (P : Ideal R) [P.IsMaximal], Function.Surjective (map P.primeCompl (f P) (g P) F)) :
    Function.Surjective F
```

-- snippet 14
```lean
-- Mathlib.RingTheory.LocalProperties.Exactness.exact_of_isLocalized_maximal (L78-L90)
theorem exact_of_isLocalized_maximal (H : ∀ (J : Ideal R) [J.IsMaximal],
    Function.Exact (map J.primeCompl (f J) (g J) F) (map J.primeCompl (g J) (h J) G)) :
    Function.Exact F G
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Classical).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem indefiniteDiagonal_transform {i : R} (hi : i * i = -1) :
    (Pso p q R i)ᵀ * indefiniteDiagonal p q R * Pso p q R i = 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Classical.matrix_trace_commutator_zero (L83-L92)
theorem matrix_trace_commutator_zero [Fintype n] (X Y : Matrix n n R) : Matrix.trace ⁅X, Y⁆ = 0
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Classical.sl (L93-L96)
def sl [Fintype n] : LieSubalgebra R (Matrix n n R)
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Classical.sl_bracket (L97-L106)
theorem sl_bracket [Fintype n] (A B : sl n R) : ⁅A, B⁆.val = A.val * B.val - B.val * A.val
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Classical.single (L107-L109)
def single (h : i ≠ j) : R →ₗ[R] sl n R
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Classical.val_single (L111-L115)
theorem val_single (h : i ≠ j) (r : R) : (single i j h r).val = Matrix.single i j r
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Classical.singleSubSingle (L116-L119)
def singleSubSingle : R →ₗ[R] sl n R
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Classical.val_singleSubSingle (L121-L124)
theorem val_singleSubSingle (r : R) :
    (singleSubSingle i j r).val = Matrix.single i i r - Matrix.single j j r
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Classical.singleSubSingle_add_singleSubSingle (L126-L129)
theorem singleSubSingle_add_singleSubSingle (r : R) :
    singleSubSingle i j r + singleSubSingle j k r = singleSubSingle i k r
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 14
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Lie.Classical).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem indefiniteDiagonal_transform {i : R} (hi : i * i = -1) :
    (Pso p q R i)ᵀ * indefiniteDiagonal p q R * Pso p q R i = 1
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Lie.Classical.matrix_trace_commutator_zero (L83-L92)
theorem matrix_trace_commutator_zero [Fintype n] (X Y : Matrix n n R) : Matrix.trace ⁅X, Y⁆ = 0
```

-- snippet 2
```lean
-- Mathlib.Algebra.Lie.Classical.sl (L93-L96)
def sl [Fintype n] : LieSubalgebra R (Matrix n n R)
```

-- snippet 3
```lean
-- Mathlib.Algebra.Lie.Classical.sl_bracket (L97-L106)
theorem sl_bracket [Fintype n] (A B : sl n R) : ⁅A, B⁆.val = A.val * B.val - B.val * A.val
```

-- snippet 4
```lean
-- Mathlib.Algebra.Lie.Classical.single (L107-L109)
def single (h : i ≠ j) : R →ₗ[R] sl n R
```

-- snippet 5
```lean
-- Mathlib.Algebra.Lie.Classical.val_single (L111-L115)
theorem val_single (h : i ≠ j) (r : R) : (single i j h r).val = Matrix.single i j r
```

-- snippet 6
```lean
-- Mathlib.Algebra.Lie.Classical.singleSubSingle (L116-L119)
def singleSubSingle : R →ₗ[R] sl n R
```

-- snippet 7
```lean
-- Mathlib.Algebra.Lie.Classical.val_singleSubSingle (L121-L124)
theorem val_singleSubSingle (r : R) :
    (singleSubSingle i j r).val = Matrix.single i i r - Matrix.single j j r
```

-- snippet 8
```lean
-- Mathlib.Algebra.Lie.Classical.singleSubSingle_add_singleSubSingle (L126-L129)
theorem singleSubSingle_add_singleSubSingle (r : R) :
    singleSubSingle i j r + singleSubSingle j k r = singleSubSingle i k r
```

-- snippet 9
```lean
-- Mathlib.Algebra.Lie.Abelian.IsLieAbelian (L57-L59)
abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop
```

-- snippet 10
```lean
-- Mathlib.Algebra.Lie.Abelian.lie_abelian_iff_equiv_lie_abelian (L81-L85)
theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂
```

-- snippet 11
```lean
-- Mathlib.Algebra.Lie.Abelian.Function (L64-L72)
theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂}
    (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁
```

-- snippet 12
```lean
-- Mathlib.Algebra.Lie.Abelian.LieModule (L48-L51)
instance LieModule.instIsTrivialOfSubsingleton {L M : Type*}
    [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M
```

-- snippet 13
```lean
-- Mathlib.Algebra.Lie.Abelian.trivial_lie_zero (L44-L47)
theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M]
    (x : L) (m : M) : ⁅x, m⁆ = 0
```

-- snippet 14
```lean
-- Mathlib.Algebra.Lie.Abelian.LieIdeal (L60-L63)
instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L]
    [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where
  trivial x y
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem latticeBasis_repr_apply (x : K) (i : ChooseBasisIndex ℤ (𝓞 K)) :
    (latticeBasis K).repr (mixedEmbedding K x) i = (integralBasis K).repr x i
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.apply_at (L59-L65)
theorem apply_at (φ : K →+* ℂ) (x : K) : (NumberField.canonicalEmbedding K x) φ = φ x
```

-- snippet 2
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.conj_apply (L66-L76)
theorem conj_apply {x : ((K →+* ℂ) → ℂ)} (φ : K →+* ℂ)
    (hx : x ∈ Submodule.span ℝ (Set.range (canonicalEmbedding K))) :
    conj (x φ) = x (ComplexEmbedding.conjugate φ)
```

-- snippet 3
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.nnnorm_eq (L77-L80)
theorem nnnorm_eq [NumberField K] (x : K) :
    ‖canonicalEmbedding K x‖₊ = Finset.univ.sup (fun φ : K →+* ℂ => ‖φ x‖₊)
```

-- snippet 4
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.norm_le_iff (L81-L94)
theorem norm_le_iff [NumberField K] (x : K) (r : ℝ) :
    ‖canonicalEmbedding K x‖ ≤ r ↔ ∀ φ : K →+* ℂ, ‖φ x‖ ≤ r
```

-- snippet 5
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.integerLattice (L95-L97)
def integerLattice : Subring ((K →+* ℂ) → ℂ)
```

-- snippet 6
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.integerLattice (L98-L137)
theorem integerLattice.inter_ball_finite [NumberField K] (r : ℝ) :
    ((integerLattice K : Set ((K →+* ℂ) → ℂ)) ∩ Metric.closedBall 0 r).Finite
```

-- snippet 7
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.latticeBasis_apply (L139-L143)
theorem latticeBasis_apply [NumberField K] (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    latticeBasis K i = (canonicalEmbedding K) (integralBasis K i)
```

-- snippet 8
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.mem_span_latticeBasis (L144-L154)
theorem mem_span_latticeBasis [NumberField K] {x : (K →+* ℂ) → ℂ} :
    x ∈ Submodule.span ℤ (Set.range (latticeBasis K)) ↔
      x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range
```

-- snippet 9
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_snd_apply (L70-L72)
theorem algebraMap_snd_apply (x : K) (v : HeightOneSpectrum R) :
    (algebraMap K (AdeleRing R K) x).2 v = x
```

-- snippet 10
```lean
-- Mathlib.NumberTheory.NumberField.Basic.Int (L51-L59)
theorem Int.not_isField : ¬IsField ℤ
```

-- snippet 11
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_injective (L73-L76)
theorem algebraMap_injective [NumberField K] : Function.Injective (algebraMap K (AdeleRing R K))
```

-- snippet 12
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_fst_apply (L66-L68)
theorem algebraMap_fst_apply (x : K) (v : InfinitePlace K) :
    (algebraMap K (AdeleRing R K) x).1 v = x
```

-- snippet 13
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.principalSubgroup (L77-L81)
abbrev principalSubgroup : AddSubgroup (AdeleRing R K)
```

-- snippet 14
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.AdeleRing (L47-L54)
def AdeleRing (R K : Type*) [CommRing R] [IsDedekindDomain R] [Field K]
    [Algebra R K] [IsFractionRing R K]
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem latticeBasis_repr_apply (x : K) (i : ChooseBasisIndex ℤ (𝓞 K)) :
    (latticeBasis K).repr (mixedEmbedding K x) i = (integralBasis K).repr x i
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.apply_at (L59-L65)
theorem apply_at (φ : K →+* ℂ) (x : K) : (NumberField.canonicalEmbedding K x) φ = φ x
```

-- snippet 2
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.conj_apply (L66-L76)
theorem conj_apply {x : ((K →+* ℂ) → ℂ)} (φ : K →+* ℂ)
    (hx : x ∈ Submodule.span ℝ (Set.range (canonicalEmbedding K))) :
    conj (x φ) = x (ComplexEmbedding.conjugate φ)
```

-- snippet 3
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.nnnorm_eq (L77-L80)
theorem nnnorm_eq [NumberField K] (x : K) :
    ‖canonicalEmbedding K x‖₊ = Finset.univ.sup (fun φ : K →+* ℂ => ‖φ x‖₊)
```

-- snippet 4
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.norm_le_iff (L81-L94)
theorem norm_le_iff [NumberField K] (x : K) (r : ℝ) :
    ‖canonicalEmbedding K x‖ ≤ r ↔ ∀ φ : K →+* ℂ, ‖φ x‖ ≤ r
```

-- snippet 5
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.integerLattice (L95-L97)
def integerLattice : Subring ((K →+* ℂ) → ℂ)
```

-- snippet 6
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.integerLattice (L98-L137)
theorem integerLattice.inter_ball_finite [NumberField K] (r : ℝ) :
    ((integerLattice K : Set ((K →+* ℂ) → ℂ)) ∩ Metric.closedBall 0 r).Finite
```

-- snippet 7
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.latticeBasis_apply (L139-L143)
theorem latticeBasis_apply [NumberField K] (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    latticeBasis K i = (canonicalEmbedding K) (integralBasis K i)
```

-- snippet 8
```lean
-- Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic.mem_span_latticeBasis (L144-L154)
theorem mem_span_latticeBasis [NumberField K] {x : (K →+* ℂ) → ℂ} :
    x ∈ Submodule.span ℤ (Set.range (latticeBasis K)) ↔
      x ∈ ((canonicalEmbedding K).comp (algebraMap (𝓞 K) K)).range
```

-- snippet 9
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_snd_apply (L70-L72)
theorem algebraMap_snd_apply (x : K) (v : HeightOneSpectrum R) :
    (algebraMap K (AdeleRing R K) x).2 v = x
```

-- snippet 10
```lean
-- Mathlib.NumberTheory.NumberField.Basic.Int (L51-L59)
theorem Int.not_isField : ¬IsField ℤ
```

-- snippet 11
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_injective (L73-L76)
theorem algebraMap_injective [NumberField K] : Function.Injective (algebraMap K (AdeleRing R K))
```

-- snippet 12
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.algebraMap_fst_apply (L66-L68)
theorem algebraMap_fst_apply (x : K) (v : InfinitePlace K) :
    (algebraMap K (AdeleRing R K) x).1 v = x
```

-- snippet 13
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.principalSubgroup (L77-L81)
abbrev principalSubgroup : AddSubgroup (AdeleRing R K)
```

-- snippet 14
```lean
-- Mathlib.NumberTheory.NumberField.AdeleRing.AdeleRing (L47-L54)
def AdeleRing (R K : Type*) [CommRing R] [IsDedekindDomain R] [Field K]
    [Algebra R K] [IsFractionRing R K]
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.MvPolynomial.Supported).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
theorem supported_strictMono [Nontrivial R] :
    StrictMono (supported R : Set σ → Subalgebra R (MvPolynomial σ R))
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_range_rename (L45-L54)
theorem supported_eq_range_rename (s : Set σ) : supported R s = (rename ((↑) : s → σ)).range
```

-- snippet 2
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supportedEquivMvPolynomial_symm_C (L56-L60)
theorem supportedEquivMvPolynomial_symm_C (s : Set σ) (x : R) :
    (supportedEquivMvPolynomial s).symm (C x) = algebraMap R (supported R s) x
```

-- snippet 3
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supportedEquivMvPolynomial_symm_X (L62-L68)
theorem supportedEquivMvPolynomial_symm_X (s : Set σ) (i : s) :
    (↑((supportedEquivMvPolynomial s).symm (X i : MvPolynomial s R)) : MvPolynomial σ R) =
      X ↑i
```

-- snippet 4
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.mem_supported (L69-L78)
theorem mem_supported : p ∈ supported R s ↔ ↑p.vars ⊆ s
```

-- snippet 5
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_vars_subset (L79-L81)
theorem supported_eq_vars_subset : (supported R s : Set (MvPolynomial σ R)) = { p | ↑p.vars ⊆ s }
```

-- snippet 6
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.mem_supported_vars (L83-L87)
theorem mem_supported_vars (p : MvPolynomial σ R) : p ∈ supported R (↑p.vars : Set σ)
```

-- snippet 7
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_adjoin_X (L88-L89)
theorem supported_eq_adjoin_X : supported R s = Algebra.adjoin R (X '' s)
```

-- snippet 8
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_univ (L91-L93)
theorem supported_univ : supported R (Set.univ : Set σ) = ⊤
```

-- snippet 9
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.mul_def (L100-L103)
theorem mul_def : p * q = p.sum fun m a => q.sum fun n b => monomial (m + n) (a * b)
```

-- snippet 10
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.C (L104-L108)
def C : R →+* MvPolynomial σ R
```

-- snippet 11
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.MvPolynomial (L81-L91)
abbrev MvPolynomial (σ : Type*) (R : Type*) [CommSemiring R]
```

-- snippet 12
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.one_def (L95-L96)
theorem one_def : (1 : MvPolynomial σ R) = monomial 0 1
```

-- snippet 13
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.monomial (L92-L94)
def monomial (s : σ →₀ ℕ) : R →ₗ[R] MvPolynomial σ R
```

-- snippet 14
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.single_eq_monomial (L97-L99)
theorem single_eq_monomial (s : σ →₀ ℕ) (a : R) : Finsupp.single s a = monomial s a
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.MvPolynomial.Supported).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
theorem supported_strictMono [Nontrivial R] :
    StrictMono (supported R : Set σ → Subalgebra R (MvPolynomial σ R))
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_range_rename (L45-L54)
theorem supported_eq_range_rename (s : Set σ) : supported R s = (rename ((↑) : s → σ)).range
```

-- snippet 2
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supportedEquivMvPolynomial_symm_C (L56-L60)
theorem supportedEquivMvPolynomial_symm_C (s : Set σ) (x : R) :
    (supportedEquivMvPolynomial s).symm (C x) = algebraMap R (supported R s) x
```

-- snippet 3
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supportedEquivMvPolynomial_symm_X (L62-L68)
theorem supportedEquivMvPolynomial_symm_X (s : Set σ) (i : s) :
    (↑((supportedEquivMvPolynomial s).symm (X i : MvPolynomial s R)) : MvPolynomial σ R) =
      X ↑i
```

-- snippet 4
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.mem_supported (L69-L78)
theorem mem_supported : p ∈ supported R s ↔ ↑p.vars ⊆ s
```

-- snippet 5
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_vars_subset (L79-L81)
theorem supported_eq_vars_subset : (supported R s : Set (MvPolynomial σ R)) = { p | ↑p.vars ⊆ s }
```

-- snippet 6
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.mem_supported_vars (L83-L87)
theorem mem_supported_vars (p : MvPolynomial σ R) : p ∈ supported R (↑p.vars : Set σ)
```

-- snippet 7
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_eq_adjoin_X (L88-L89)
theorem supported_eq_adjoin_X : supported R s = Algebra.adjoin R (X '' s)
```

-- snippet 8
```lean
-- Mathlib.Algebra.MvPolynomial.Supported.supported_univ (L91-L93)
theorem supported_univ : supported R (Set.univ : Set σ) = ⊤
```

-- snippet 9
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.mul_def (L100-L103)
theorem mul_def : p * q = p.sum fun m a => q.sum fun n b => monomial (m + n) (a * b)
```

-- snippet 10
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.C (L104-L108)
def C : R →+* MvPolynomial σ R
```

-- snippet 11
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.MvPolynomial (L81-L91)
abbrev MvPolynomial (σ : Type*) (R : Type*) [CommSemiring R]
```

-- snippet 12
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.one_def (L95-L96)
theorem one_def : (1 : MvPolynomial σ R) = monomial 0 1
```

-- snippet 13
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.monomial (L92-L94)
def monomial (s : σ →₀ ℕ) : R →ₗ[R] MvPolynomial σ R
```

-- snippet 14
```lean
-- Mathlib.Algebra.MvPolynomial.Basic.single_eq_monomial (L97-L99)
theorem single_eq_monomial (s : σ →₀ ℕ) (a : R) : Finsupp.single s a = monomial s a
```
[/INST]


[System] You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.GroupWithZero.Canonical).

[User]
Prove the following theorem. The retrieved context below may help.

```lean
lemma le_log_of_exp_le (hax : exp a ≤ x) : a ≤ log x
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.zero_lt_iff (L59-L59)
lemma zero_lt_iff : 0 < a ↔ a ≠ 0
```

-- snippet 2
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.ne_zero_of_lt (L60-L62)
lemma ne_zero_of_lt (h : b < a) : a ≠ 0
```

-- snippet 3
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.bot_eq_zero'' (L63-L65)
lemma bot_eq_zero'' : (⊥ : α) = 0
```

-- snippet 4
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.Function (L90-L105)
abbrev Function.Injective.linearOrderedCommMonoidWithZero {β : Type*} [Zero β] [Bot β] [One β]
    [Mul β] [Pow β ℕ] [LE β] [LT β] [Max β] [Min β] [Ord β]
    [DecidableEq β] [DecidableLE β] [DecidableLT β]
    (f : β → α) (hf : Function.Injective f) (zero : f 0 = 0)
    (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (le : ∀ {x y}, f x ≤ f y ↔ x ≤ y) (lt : ∀ {x y}, f x < f y ↔ x < y)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (bot : f ⊥ = ⊥)
    (compare : ∀ x y, compare (f x) (f y) = compare x y) :
    LinearOrderedCommMonoidWithZero β where
  __
```

-- snippet 5
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual (L110-L114)
instance instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual :
    LinearOrderedAddCommMonoidWithTop (Additive αᵒᵈ) where
  top_add' a
```

-- snippet 6
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.instLinearOrderedAddCommMonoidWithTopOrderDualAdditive (L115-L121)
instance instLinearOrderedAddCommMonoidWithTopOrderDualAdditive :
    LinearOrderedAddCommMonoidWithTop (Additive α)ᵒᵈ where
  top_add' a
```

-- snippet 7
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.pow_pos_iff (L122-L128)
lemma pow_pos_iff (hn : n ≠ 0) : 0 < a ^ n ↔ 0 < a
```

-- snippet 8
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.Units (L130-L132)
theorem Units.zero_lt (u : αˣ) : (0 : α) < u
```

-- snippet 9
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.subadditiveHomClass (L68-L70)
instance subadditiveHomClass : SubadditiveHomClass (AbsoluteValue R S) R S
```

-- snippet 10
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.coe_mk (L72-L74)
theorem coe_mk (f : R →ₙ* S) {h₁ h₂ h₃} : (AbsoluteValue.mk f h₁ h₂ h₃ : R → S) = f
```

-- snippet 11
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.funLike (L55-L58)
instance funLike : FunLike (AbsoluteValue R S) R S where
  coe f
```

-- snippet 12
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.zeroHomClass (L59-L61)
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  map_zero f
```

-- snippet 13
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.nonnegHomClass (L65-L67)
instance nonnegHomClass : NonnegHomClass (AbsoluteValue R S) R S
```

-- snippet 14
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.mulHomClass (L62-L64)
instance mulHomClass : MulHomClass (AbsoluteValue R S) R S
```

<s>[SYSTEM_PROMPT]You are Leanstral, a Lean 4 proof assistant. Complete the task below using the provided Lean source context. The target mathlib commit is 5e932f97dd25535344f80f9dd8da3aab83df0fe6 (module Mathlib.Algebra.Order.GroupWithZero.Canonical).[/SYSTEM_PROMPT][MODEL_SETTINGS]{"reasoning_effort": "none"}[/MODEL_SETTINGS][INST]Prove the following theorem. The retrieved context below may help.

```lean
lemma le_log_of_exp_le (hax : exp a ≤ x) : a ≤ log x
```

## Retrieved context
-- snippet 1
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.zero_lt_iff (L59-L59)
lemma zero_lt_iff : 0 < a ↔ a ≠ 0
```

-- snippet 2
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.ne_zero_of_lt (L60-L62)
lemma ne_zero_of_lt (h : b < a) : a ≠ 0
```

-- snippet 3
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.bot_eq_zero'' (L63-L65)
lemma bot_eq_zero'' : (⊥ : α) = 0
```

-- snippet 4
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.Function (L90-L105)
abbrev Function.Injective.linearOrderedCommMonoidWithZero {β : Type*} [Zero β] [Bot β] [One β]
    [Mul β] [Pow β ℕ] [LE β] [LT β] [Max β] [Min β] [Ord β]
    [DecidableEq β] [DecidableLE β] [DecidableLT β]
    (f : β → α) (hf : Function.Injective f) (zero : f 0 = 0)
    (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
    (le : ∀ {x y}, f x ≤ f y ↔ x ≤ y) (lt : ∀ {x y}, f x < f y ↔ x < y)
    (hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y))
    (bot : f ⊥ = ⊥)
    (compare : ∀ x y, compare (f x) (f y) = compare x y) :
    LinearOrderedCommMonoidWithZero β where
  __
```

-- snippet 5
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual (L110-L114)
instance instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual :
    LinearOrderedAddCommMonoidWithTop (Additive αᵒᵈ) where
  top_add' a
```

-- snippet 6
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.instLinearOrderedAddCommMonoidWithTopOrderDualAdditive (L115-L121)
instance instLinearOrderedAddCommMonoidWithTopOrderDualAdditive :
    LinearOrderedAddCommMonoidWithTop (Additive α)ᵒᵈ where
  top_add' a
```

-- snippet 7
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.pow_pos_iff (L122-L128)
lemma pow_pos_iff (hn : n ≠ 0) : 0 < a ^ n ↔ 0 < a
```

-- snippet 8
```lean
-- Mathlib.Algebra.Order.GroupWithZero.Canonical.Units (L130-L132)
theorem Units.zero_lt (u : αˣ) : (0 : α) < u
```

-- snippet 9
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.subadditiveHomClass (L68-L70)
instance subadditiveHomClass : SubadditiveHomClass (AbsoluteValue R S) R S
```

-- snippet 10
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.coe_mk (L72-L74)
theorem coe_mk (f : R →ₙ* S) {h₁ h₂ h₃} : (AbsoluteValue.mk f h₁ h₂ h₃ : R → S) = f
```

-- snippet 11
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.funLike (L55-L58)
instance funLike : FunLike (AbsoluteValue R S) R S where
  coe f
```

-- snippet 12
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.zeroHomClass (L59-L61)
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  map_zero f
```

-- snippet 13
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.nonnegHomClass (L65-L67)
instance nonnegHomClass : NonnegHomClass (AbsoluteValue R S) R S
```

-- snippet 14
```lean
-- Mathlib.Algebra.Order.AbsoluteValue.Basic.mulHomClass (L62-L64)
instance mulHomClass : MulHomClass (AbsoluteValue R S) R S
```
[/INST]