harrywsanders/mathlib_extracted huggingface dataset:
-- Mathlib/Algebra/Star/CHSH.lean
theorem CHSH_inequality_of_comm [OrderedCommRing R] [StarRing R] [StarOrderedRing R] [Algebra ℝ R]
    [OrderedSMul ℝ R] (A₀ A₁ B₀ B₁ : R) (T : IsCHSHTuple A₀ A₁ B₀ B₁) :
    A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁ ≤ 2

Proof state:
R : Type u
inst✝⁴ : OrderedCommRing R
inst✝³ : StarRing R
inst✝² : StarOrderedRing R
inst✝¹ : Algebra ℝ R
inst✝ : OrderedSMul ℝ R
A₀ A₁ B₀ B₁ : R
T : IsCHSHTuple A₀ A₁ B₀ B₁
P : R := 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁
idem : P * P = 4 * P
idem' : P = (1 / 4) • (P * P)
⊢ star (2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁) = 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁

Tactic:
simp only [star_add, star_sub, star_mul, star_ofNat, star_one, T.A₀_sa, T.A₁_sa, T.B₀_sa,
  T.B₁_sa, mul_comm B₀, mul_comm B₁]

Result:
no goals

Proof state:
R : Type u
inst✝⁴ : OrderedCommRing R
inst✝³ : StarRing R
inst✝² : StarOrderedRing R
inst✝¹ : Algebra ℝ R
inst✝ : OrderedSMul ℝ R
A₀ A₁ B₀ B₁ : R
T : IsCHSHTuple A₀ A₁ B₀ B₁
P : R := 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁
⊢ 0 ≤ P

Tactic:
have idem : P * P = 4 * P := CHSH_id T.A₀_inv T.A₁_inv T.B₀_inv T.B₁_inv

Result:
R : Type u
inst✝⁴ : OrderedCommRing R
inst✝³ : StarRing R
inst✝² : StarOrderedRing R
inst✝¹ : Algebra ℝ R
inst✝ : OrderedSMul ℝ R
A₀ A₁ B₀ B₁ : R
T : IsCHSHTuple A₀ A₁ B₀ B₁
P : R := 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁
idem : P * P = 4 * P
⊢ 0 ≤ P

Proof state:
case a
R : Type u
inst✝⁴ : OrderedCommRing R
inst✝³ : StarRing R
inst✝² : StarOrderedRing R
inst✝¹ : Algebra ℝ R
inst✝ : OrderedSMul ℝ R
A₀ A₁ B₀ B₁ : R
T : IsCHSHTuple A₀ A₁ B₀ B₁
P : R := 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁
i₁ : 0 ≤ P
⊢ 0 ≤ 2 - (A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁)

Tactic:
simpa only [sub_add_eq_sub_sub, ← sub_add] using i₁

Result:
no goals
-- Mathlib/Topology/Algebra/MulAction.lean
@[to_additive]
lemma IsCompact.smul_set {k : Set M} {u : Set X} (hk : IsCompact k) (hu : IsCompact u) :
    IsCompact (k • u)

Proof state:
M : Type u_1
X : Type u_2
inst✝³ : TopologicalSpace M
inst✝² : TopologicalSpace X
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
k : Set M
u : Set X
hk : IsCompact k
hu : IsCompact u
⊢ IsCompact (k • u)

Tactic:
rw [← Set.image_smul_prod]

Result:
M : Type u_1
X : Type u_2
inst✝³ : TopologicalSpace M
inst✝² : TopologicalSpace X
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
k : Set M
u : Set X
hk : IsCompact k
hu : IsCompact u
⊢ IsCompact ((fun x => x.1 • x.2) '' k ×ˢ u)

Proof state:
M : Type u_1
X : Type u_2
inst✝³ : TopologicalSpace M
inst✝² : TopologicalSpace X
inst✝¹ : SMul M X
inst✝ : ContinuousSMul M X
k : Set M
u : Set X
hk : IsCompact k
hu : IsCompact u
⊢ IsCompact ((fun x => x.1 • x.2) '' k ×ˢ u)

Tactic:
exact IsCompact.image (hk.prod hu) continuous_smul

Result:
no goals
-- Mathlib/.lake/packages/lean4/src/lean/Init/Data/List/TakeDrop.lean
theorem take_takeWhile {l : List α} (p : α → Bool) n :
    (l.takeWhile p).take n = (l.take n).takeWhile p

Proof state:
α : Type u_1
l : List α
p : α → Bool
n : Nat
⊢ take n (takeWhile p l) = takeWhile p (take n l)

Tactic:
induction l generalizing n with
| nil => simp
| cons x xs ih =>
  by_cases h : p x <;> cases n <;> simp [takeWhile_cons, h, ih, take_succ_cons]

Result:
no goals

Proof state:
case cons
α : Type u_1
p : α → Bool
x : α
xs : List α
ih : ∀ (n : Nat), take n (takeWhile p xs) = takeWhile p (take n xs)
n : Nat
⊢ take n (takeWhile p (x :: xs)) = takeWhile p (take n (x :: xs))

Tactic:
by_cases h : p x <;> cases n <;> simp [takeWhile_cons, h, ih, take_succ_cons]

Result:
no goals

Proof state:
case nil
α : Type u_1
p : α → Bool
n : Nat
⊢ take n (takeWhile p []) = takeWhile p (take n [])

Tactic:
simp

Result:
no goals
-- Mathlib/Analysis/Convex/Intrinsic.lean
theorem intrinsicClosure_singleton (x : P) : intrinsicClosure 𝕜 ({x} : Set P) = {x}

Proof state:
𝕜 : Type u_1
V : Type u_2
P : Type u_5
inst✝⁴ : Ring 𝕜
inst✝³ : AddCommGroup V
inst✝² : Module 𝕜 V
inst✝¹ : TopologicalSpace P
inst✝ : AddTorsor V P
x : P
⊢ intrinsicClosure 𝕜 {x} = {x}

Tactic:
simp only [intrinsicClosure, preimage_coe_affineSpan_singleton, closure_univ, image_univ,
  Subtype.range_coe_subtype, mem_affineSpan_singleton, setOf_eq_eq_singleton]

Result:
no goals
-- Mathlib/.lake/packages/lean4/src/lean/Init/Data/Array/Lemmas.lean
theorem flatMap_append (xs ys : Array α) (f : α → Array β) :
    (xs ++ ys).flatMap f = xs.flatMap f ++ ys.flatMap f

Proof state:
α : Type u_1
β : Type u_2
xs ys : Array α
f : α → Array β
⊢ flatMap f (xs ++ ys) = flatMap f xs ++ flatMap f ys

Tactic:
rcases xs with ⟨xs⟩

Result:
case mk
α : Type u_1
β : Type u_2
ys : Array α
f : α → Array β
xs : List α
⊢ flatMap f ({ toList := xs } ++ ys) = flatMap f { toList := xs } ++ flatMap f ys

Proof state:
case mk
α : Type u_1
β : Type u_2
ys : Array α
f : α → Array β
xs : List α
⊢ flatMap f ({ toList := xs } ++ ys) = flatMap f { toList := xs } ++ flatMap f ys

Tactic:
rcases ys with ⟨ys⟩

Result:
case mk.mk
α : Type u_1
β : Type u_2
f : α → Array β
xs ys : List α
⊢ flatMap f ({ toList := xs } ++ { toList := ys }) = flatMap f { toList := xs } ++ flatMap f { toList := ys }

Proof state:
case mk.mk
α : Type u_1
β : Type u_2
f : α → Array β
xs ys : List α
⊢ flatMap f ({ toList := xs } ++ { toList := ys }) = flatMap f { toList := xs } ++ flatMap f { toList := ys }

Tactic:
simp

Result:
no goals
-- Mathlib/CategoryTheory/ConcreteCategory/EpiMono.lean
lemma surjective_eq_epimorphisms_iff :
    MorphismProperty.surjective C = epimorphisms C ↔ (forget C).PreservesEpimorphisms

Proof state:
case mp.preserves
C : Type u
inst✝² : Category.{v, u} C
FC : C → C → Type u_1
CC : C → Type w
inst✝¹ : (X Y : C) → FunLike (FC X Y) (CC X) (CC Y)
inst✝ : ConcreteCategory C FC
h : MorphismProperty.surjective C = epimorphisms C
X✝ Y✝ : C
f : X✝ ⟶ Y✝
hf : epimorphisms C f
⊢ Epi ((forget C).map f)

Tactic:
rw [epi_iff_surjective]

Result:
case mp.preserves
C : Type u
inst✝² : Category.{v, u} C
FC : C → C → Type u_1
CC : C → Type w
inst✝¹ : (X Y : C) → FunLike (FC X Y) (CC X) (CC Y)
inst✝ : ConcreteCategory C FC
h : MorphismProperty.surjective C = epimorphisms C
X✝ Y✝ : C
f : X✝ ⟶ Y✝
hf : epimorphisms C f
⊢ Function.Surjective ((forget C).map f)
-- Mathlib/RingTheory/WittVector/Truncated.lean
theorem iInf_ker_truncate : ⨅ i : ℕ, RingHom.ker (WittVector.truncate (p := p) (R := R) i) = ⊥

Proof state:
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
hx : x ∈ ⨅ i, RingHom.ker (WittVector.truncate i)
⊢ x = 0

Tactic:
ext

Result:
case h
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
hx : x ∈ ⨅ i, RingHom.ker (WittVector.truncate i)
n✝ : ℕ
⊢ x.coeff n✝ = WittVector.coeff 0 n✝

Proof state:
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
⊢ ⨅ i, RingHom.ker (WittVector.truncate i) = ⊥

Tactic:
rw [Submodule.eq_bot_iff]

Result:
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
⊢ ∀ x ∈ ⨅ i, RingHom.ker (WittVector.truncate i), x = 0

Proof state:
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
⊢ ∀ x ∈ ⨅ i, RingHom.ker (WittVector.truncate i), x = 0

Tactic:
intro x hx

Result:
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
hx : x ∈ ⨅ i, RingHom.ker (WittVector.truncate i)
⊢ x = 0

Proof state:
case h
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
n✝ : ℕ
hx : ∀ (i i_1 : ℕ), i_1 < i → x.coeff i_1 = 0
⊢ x.coeff n✝ = 0

Tactic:
exact hx _ _ (Nat.lt_succ_self _)

Result:
no goals

Proof state:
case h
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
hx : x ∈ ⨅ i, RingHom.ker (WittVector.truncate i)
n✝ : ℕ
⊢ x.coeff n✝ = WittVector.coeff 0 n✝

Tactic:
simp only [WittVector.mem_ker_truncate, Ideal.mem_iInf, WittVector.zero_coeff] at hx ⊢

Result:
case h
p : ℕ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : Fact (Nat.Prime p)
x : 𝕎 R
n✝ : ℕ
hx : ∀ (i i_1 : ℕ), i_1 < i → x.coeff i_1 = 0
⊢ x.coeff n✝ = 0
-- Mathlib/FieldTheory/Minpoly/MinpolyDiv.lean
lemma coeff_minpolyDiv_mem_adjoin (x : S) (i) :
    coeff (minpolyDiv R x) i ∈ Algebra.adjoin R {x}

Proof state:
case succ
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H✝ : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
j : ℕ
IH : (minpolyDiv R x).coeff (i + j) ∉ Algebra.adjoin R {x}
H : (minpolyDiv R x).coeff (i + (j + 1)) ∈ Algebra.adjoin R {x}
⊢ (minpolyDiv R x).coeff (i + j) ∈ Algebra.adjoin R {x}

Tactic:
rw [coeff_minpolyDiv]

Result:
case succ
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H✝ : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
j : ℕ
IH : (minpolyDiv R x).coeff (i + j) ∉ Algebra.adjoin R {x}
H : (minpolyDiv R x).coeff (i + (j + 1)) ∈ Algebra.adjoin R {x}
⊢ (algebraMap R S) ((minpoly R x).coeff (i + j + 1)) + (minpolyDiv R x).coeff (i + j + 1) * x ∈ Algebra.adjoin R {x}

Proof state:
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
⊢ False

Tactic:
have : ∀ j, coeff (minpolyDiv R x) (i + j) ∉ Algebra.adjoin R {x} := by
  intro j; induction j with
  | zero => exact H
  | succ j IH =>
    intro H; apply IH
    rw [coeff_minpolyDiv]
    refine add_mem ?_ (mul_mem H (Algebra.self_mem_adjoin_singleton R x))
    exact Subalgebra.algebraMap_mem _ _

Result:
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
this : ∀ (j : ℕ), (minpolyDiv R x).coeff (i + j) ∉ Algebra.adjoin R {x}
⊢ False

Proof state:
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
⊢ ∀ (j : ℕ), (minpolyDiv R x).coeff (i + j) ∉ Algebra.adjoin R {x}

Tactic:
intro j

Result:
R : Type u_2
S : Type u_1
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Algebra R S
x : S
i : ℕ
H : (minpolyDiv R x).coeff i ∉ Algebra.adjoin R {x}
j : ℕ
⊢ (minpolyDiv R x).coeff (i + j) ∉ Algebra.adjoin R {x}
-- Mathlib/Topology/Homotopy/Path.lean
theorem hpath_hext {p₁ : Path x₀ x₁} {p₂ : Path x₂ x₃} (hp : ∀ t, p₁ t = p₂ t) :
    @HEq (Path.Homotopic.Quotient _ _) ⟦p₁⟧ (Path.Homotopic.Quotient _ _) ⟦p₂⟧

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ x₃ : X
p₁ : Path x₀ x₁
p₂ : Path x₀ x₃
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ x₁ = x₃

Tactic:
convert hp 1 <;> simp

Result:
no goals

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ HEq ⟦p₁⟧ ⟦p₂⟧

Tactic:
rw [heq_iff_eq]

Result:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ ⟦p₁⟧ = ⟦p₂⟧

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ ⟦p₁⟧ = ⟦p₂⟧

Tactic:
congr

Result:
case e_a
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ p₁ = p₂

Proof state:
case e_a.a.h
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
t : ↑I
⊢ p₁ t = p₂ t

Tactic:
exact hp t

Result:
no goals

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ x₂ x₃ : X
p₁ : Path x₀ x₁
p₂ : Path x₂ x₃
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ x₀ = x₂

Tactic:
convert hp 0 <;> simp

Result:
no goals

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ x₃ : X
p₁ : Path x₀ x₁
p₂ : Path x₀ x₃
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ HEq ⟦p₁⟧ ⟦p₂⟧

Tactic:
obtain rfl : x₁ = x₃ := by convert hp 1 <;> simp

Result:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ HEq ⟦p₁⟧ ⟦p₂⟧

Proof state:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ x₂ x₃ : X
p₁ : Path x₀ x₁
p₂ : Path x₂ x₃
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ HEq ⟦p₁⟧ ⟦p₂⟧

Tactic:
obtain rfl : x₀ = x₂ := by convert hp 0 <;> simp

Result:
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ x₃ : X
p₁ : Path x₀ x₁
p₂ : Path x₀ x₃
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ HEq ⟦p₁⟧ ⟦p₂⟧

Proof state:
case e_a
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
⊢ p₁ = p₂

Tactic:
ext t

Result:
case e_a.a.h
X : Type u
inst✝ : TopologicalSpace X
x₀ x₁ : X
p₁ p₂ : Path x₀ x₁
hp : ∀ (t : ↑I), p₁ t = p₂ t
t : ↑I
⊢ p₁ t = p₂ t
-- Mathlib/Combinatorics/SimpleGraph/Walk.lean
theorem edges_append {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    (p.append p').edges = p.edges ++ p'.edges

Proof state:
V : Type u
G : SimpleGraph V
u v w : V
p : G.Walk u v
p' : G.Walk v w
⊢ (p.append p').edges = p.edges ++ p'.edges

Tactic:
simp [edges]

Result:
no goals
-- Mathlib/Analysis/InnerProductSpace/Basic.lean
theorem norm_add_sq (x y : E) : ‖x + y‖ ^ 2 = ‖x‖ ^ 2 + 2 * re ⟪x, y⟫ + ‖y‖ ^ 2

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ ‖x + y‖ ^ 2 = ‖x‖ ^ 2 + 2 * re ⟪x, y⟫_𝕜 + ‖y‖ ^ 2

Tactic:
repeat' rw [sq (M := ℝ), ← @inner_self_eq_norm_mul_norm 𝕜]

Result:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪x + y, x + y⟫_𝕜 = re ⟪x, x⟫_𝕜 + 2 * re ⟪x, y⟫_𝕜 + re ⟪y, y⟫_𝕜

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪y, x⟫_𝕜 = re ⟪x, y⟫_𝕜

Tactic:
rw [← inner_conj_symm, conj_re]

Result:
no goals

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪x + y, x + y⟫_𝕜 = re ⟪x, x⟫_𝕜 + 2 * re ⟪x, y⟫_𝕜 + re ⟪y, y⟫_𝕜

Tactic:
rw [inner_add_add_self, two_mul]

Result:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re (⟪x, x⟫_𝕜 + ⟪x, y⟫_𝕜 + ⟪y, x⟫_𝕜 + ⟪y, y⟫_𝕜) = re ⟪x, x⟫_𝕜 + (re ⟪x, y⟫_𝕜 + re ⟪x, y⟫_𝕜) + re ⟪y, y⟫_𝕜

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪x + y, x + y⟫_𝕜 = re ⟪x, x⟫_𝕜 + 2 * re ⟪x, y⟫_𝕜 + ‖y‖ ^ 2

Tactic:
rw [sq (M := ℝ), ← @inner_self_eq_norm_mul_norm 𝕜]

Result:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪x + y, x + y⟫_𝕜 = re ⟪x, x⟫_𝕜 + 2 * re ⟪x, y⟫_𝕜 + re ⟪y, y⟫_𝕜

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re (⟪x, x⟫_𝕜 + ⟪x, y⟫_𝕜 + ⟪y, x⟫_𝕜 + ⟪y, y⟫_𝕜) = re ⟪x, x⟫_𝕜 + (re ⟪x, y⟫_𝕜 + re ⟪x, y⟫_𝕜) + re ⟪y, y⟫_𝕜

Tactic:
simp only [add_assoc, add_left_inj, add_right_inj, AddMonoidHom.map_add]

Result:
𝕜 : Type u_1
E : Type u_2
inst✝² : RCLike 𝕜
inst✝¹ : SeminormedAddCommGroup E
inst✝ : InnerProductSpace 𝕜 E
x y : E
⊢ re ⟪y, x⟫_𝕜 = re ⟪x, y⟫_𝕜
-- Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean
theorem Ideal.homogeneousHull_eq_iSup :
    I.homogeneousHull 𝒜 =
      ⨆ i, ⟨Ideal.span (GradedRing.proj 𝒜 i '' I), Ideal.homogeneous_span 𝒜 _ (by
        rintro _ ⟨x, -, rfl⟩
        apply SetLike.isHomogeneousElem_coe)⟩

Proof state:
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
i : ι
⊢ ∀ x ∈ ⇑(GradedRing.proj 𝒜 i) '' ↑I, IsHomogeneousElem 𝒜 x

Tactic:
rintro _ ⟨x, -, rfl⟩

Result:
case intro.intro
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
i : ι
x : A
⊢ IsHomogeneousElem 𝒜 ((GradedRing.proj 𝒜 i) x)

Proof state:
case intro.intro
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
i : ι
x : A
⊢ IsHomogeneousElem 𝒜 ((GradedRing.proj 𝒜 i) x)

Tactic:
apply SetLike.isHomogeneousElem_coe

Result:
no goals

Proof state:
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
⊢ homogeneousHull 𝒜 I = ⨆ i, { toSubmodule := span (⇑(GradedRing.proj 𝒜 i) '' ↑I), is_homogeneous' := ⋯ }

Tactic:
ext1

Result:
case h
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
⊢ (homogeneousHull 𝒜 I).toIdeal =
    (⨆ i, { toSubmodule := span (⇑(GradedRing.proj 𝒜 i) '' ↑I), is_homogeneous' := ⋯ }).toIdeal

Proof state:
case h
ι : Type u_1
σ : Type u_2
A : Type u_3
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : AddMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
I : Ideal A
⊢ (homogeneousHull 𝒜 I).toIdeal =
    (⨆ i, { toSubmodule := span (⇑(GradedRing.proj 𝒜 i) '' ↑I), is_homogeneous' := ⋯ }).toIdeal

Tactic:
rw [Ideal.toIdeal_homogeneousHull_eq_iSup, toIdeal_iSup]

Result:
no goals
-- Mathlib/LinearAlgebra/Lagrange.lean
theorem eq_of_degree_le_of_eval_index_eq (hvs : Set.InjOn v s)
    (h_deg_le : f.degree ≤ #s)
    (h_deg_eq : f.degree = g.degree)
    (hlc : f.leadingCoeff = g.leadingCoeff)
    (h_eval : ∀ i ∈ s, f.eval (v i) = g.eval (v i)) : f = g

Proof state:
case inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
g : R[X]
ι : Type u_2
v : ι → R
s : Finset ι
hvs : Set.InjOn v ↑s
h_deg_le : degree 0 ≤ ↑(#s)
h_deg_eq : degree 0 = g.degree
hlc : leadingCoeff 0 = g.leadingCoeff
h_eval : ∀ i ∈ s, eval (v i) 0 = eval (v i) g
⊢ 0 = g

Tactic:
rwa [degree_zero, eq_comm, degree_eq_bot, eq_comm] at h_deg_eq

Result:
no goals

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f g : R[X]
ι : Type u_2
v : ι → R
s : Finset ι
hvs : Set.InjOn v ↑s
h_deg_le : f.degree ≤ ↑(#s)
h_deg_eq : f.degree = g.degree
hlc : f.leadingCoeff = g.leadingCoeff
h_eval : ∀ i ∈ s, eval (v i) f = eval (v i) g
⊢ f = g

Tactic:
rcases eq_or_ne f 0 with rfl | hf

Result:
case inl
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
g : R[X]
ι : Type u_2
v : ι → R
s : Finset ι
hvs : Set.InjOn v ↑s
h_deg_le : degree 0 ≤ ↑(#s)
h_deg_eq : degree 0 = g.degree
hlc : leadingCoeff 0 = g.leadingCoeff
h_eval : ∀ i ∈ s, eval (v i) 0 = eval (v i) g
⊢ 0 = g

case inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f g : R[X]
ι : Type u_2
v : ι → R
s : Finset ι
hvs : Set.InjOn v ↑s
h_deg_le : f.degree ≤ ↑(#s)
h_deg_eq : f.degree = g.degree
hlc : f.leadingCoeff = g.leadingCoeff
h_eval : ∀ i ∈ s, eval (v i) f = eval (v i) g
hf : f ≠ 0
⊢ f = g

Proof state:
case inr
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
f g : R[X]
ι : Type u_2
v : ι → R
s : Finset ι
hvs : Set.InjOn v ↑s
h_deg_le : f.degree ≤ ↑(#s)
h_deg_eq : f.degree = g.degree
hlc : f.leadingCoeff = g.leadingCoeff
h_eval : ∀ i ∈ s, eval (v i) f = eval (v i) g
hf : f ≠ 0
⊢ f = g

Tactic:
exact eq_of_degree_sub_lt_of_eval_index_eq s hvs
  (lt_of_lt_of_le (degree_sub_lt h_deg_eq hf hlc) h_deg_le)
  h_eval

Result:
no goals
-- Mathlib/AlgebraicTopology/DoldKan/Projections.lean
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n

Proof state:
case succ
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n q : ℕ
hq : G.map ((P q).f n) = (P q).f n
⊢ G.map ((P (q + 1)).f n) = (P (q + 1)).f n

Tactic:
simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
  comp_id, Functor.map_add, Functor.map_comp, hq, map_Hσ]

Result:
no goals

Proof state:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n : ℕ
⊢ G.map ((P 0).f n) = (P 0).f n

Tactic:
simp only [P_zero]

Result:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n : ℕ
⊢ G.map ((𝟙 K[X]).f n) = (𝟙 K[((whiskering C D).obj G).obj X]).f n

Proof state:
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
q n : ℕ
⊢ G.map ((P q).f n) = (P q).f n

Tactic:
induction' q with q hq

Result:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n : ℕ
⊢ G.map ((P 0).f n) = (P 0).f n

case succ
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n q : ℕ
hq : G.map ((P q).f n) = (P q).f n
⊢ G.map ((P (q + 1)).f n) = (P (q + 1)).f n

Proof state:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : G.Additive
X : SimplicialObject C
n : ℕ
⊢ G.map ((𝟙 K[X]).f n) = (𝟙 K[((whiskering C D).obj G).obj X]).f n

Tactic:
apply G.map_id

Result:
no goals
-- Mathlib/RingTheory/DiscreteValuationRing/Basic.lean
@[simp]
lemma addVal_eq_zero_of_unit (u : Rˣ) :
    addVal R u = 0

Proof state:
case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : IsDiscreteValuationRing R
u : Rˣ
ϖ : R
hϖ : Irreducible ϖ
⊢ (addVal R) ↑u = 0

Tactic:
rw [addVal_def (u : R) u hϖ 0] <;>
simp

Result:
no goals

Proof state:
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : IsDiscreteValuationRing R
u : Rˣ
⊢ (addVal R) ↑u = 0

Tactic:
obtain ⟨ϖ, hϖ⟩ := exists_irreducible R

Result:
case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : IsDiscreteValuationRing R
u : Rˣ
ϖ : R
hϖ : Irreducible ϖ
⊢ (addVal R) ↑u = 0
-- Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean
theorem surjective_of_injective [FiniteDimensional K V] {f : V →ₗ[K] V} (hinj : Injective f) :
    Surjective f

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : V →ₗ[K] V
hinj : Injective ⇑f
h : Module.rank K ↥(range f) = Module.rank K V
⊢ Surjective ⇑f

Tactic:
rw [← finrank_eq_rank, ← finrank_eq_rank, Nat.cast_inj] at h

Result:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : V →ₗ[K] V
hinj : Injective ⇑f
h : finrank K ↥(range f) = finrank K V
⊢ Surjective ⇑f

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : V →ₗ[K] V
hinj : Injective ⇑f
⊢ Surjective ⇑f

Tactic:
have h := rank_range_of_injective _ hinj

Result:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : V →ₗ[K] V
hinj : Injective ⇑f
h : Module.rank K ↥(range f) = Module.rank K V
⊢ Surjective ⇑f

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : V →ₗ[K] V
hinj : Injective ⇑f
h : finrank K ↥(range f) = finrank K V
⊢ Surjective ⇑f

Tactic:
exact range_eq_top.1 (eq_top_of_finrank_eq h)

Result:
no goals