l3lab/ntp-mathlib huggingface dataset:
theorem nonneg_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (∀ x, 0 ≤ (Q₁.prod Q₂) x) ↔ (∀ x, 0 ≤ Q₁ x) ∧ ∀ x, 0 ≤ Q₂ x := by
  simp_rw [Prod.forall, prod_apply]
  constructor
  · intro h
    constructor
    · intro x; simpa only [add_zero, map_zero] using h x 0
    · intro x; simpa only [zero_add, map_zero] using h 0 x
  · rintro ⟨h₁, h₂⟩ x₁ x₂
    

Proof state:
case mpr.intro
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
h₁ : ∀ (x : M₁), 0 ≤ Q₁ x
h₂ : ∀ (x : M₂), 0 ≤ Q₂ x
x₁ : M₁
x₂ : M₂
⊢ 0 ≤ Q₁ x₁ + Q₂ x₂

Next tactic:
exact add_nonneg (h₁ x₁) (h₂ x₂)
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ PosDef (prod Q₁ Q₂) ↔ PosDef Q₁ ∧ PosDef Q₂

Next tactic:
simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ ∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic (prod Q₁ Q₂) ↔
    ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ Anisotropic Q₁) ∧ (∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic Q₂

Next tactic:
constructor
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · 

Proof state:
case mp
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ ∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic (prod Q₁ Q₂) →
    ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ Anisotropic Q₁) ∧ (∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic Q₂

Next tactic:
rintro ⟨⟨hle₁, hle₂⟩, ha⟩
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    

Proof state:
case mp.intro.intro
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
ha : Anisotropic (prod Q₁ Q₂)
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ Anisotropic Q₁) ∧ (∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic Q₂

Next tactic:
obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    

Proof state:
case mp.intro.intro.intro
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
ha : Anisotropic (prod Q₁ Q₂)
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
ha₁ : Anisotropic Q₁
ha₂ : Anisotropic Q₂
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ Anisotropic Q₁) ∧ (∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic Q₂

Next tactic:
refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
  · 

Proof state:
case mpr
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ Anisotropic Q₁) ∧ (∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic Q₂ →
    ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ ∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic (prod Q₁ Q₂)

Next tactic:
rintro ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
  · rintro ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
    

Proof state:
case mpr.intro.intro.intro
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
ha₁ : Anisotropic Q₁
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
ha₂ : Anisotropic Q₂
⊢ ((∀ (x : M₁), 0 ≤ Q₁ x) ∧ ∀ (x : M₂), 0 ≤ Q₂ x) ∧ Anisotropic (prod Q₁ Q₂)

Next tactic:
refine' ⟨⟨hle₁, hle₂⟩, _⟩
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
  · rintro ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
    refine' ⟨⟨hle₁, hle₂⟩, _⟩
    

Proof state:
case mpr.intro.intro.intro
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
ha₁ : Anisotropic Q₁
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
ha₂ : Anisotropic Q₂
⊢ Anisotropic (prod Q₁ Q₂)

Next tactic:
rintro ⟨x₁, x₂⟩ (hx : Q₁ x₁ + Q₂ x₂ = 0)
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
  · rintro ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
    refine' ⟨⟨hle₁, hle₂⟩, _⟩
    rintro ⟨x₁, x₂⟩ (hx : Q₁ x₁ + Q₂ x₂ = 0)
    

Proof state:
case mpr.intro.intro.intro.mk
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
ha₁ : Anisotropic Q₁
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
ha₂ : Anisotropic Q₂
x₁ : M₁
x₂ : M₂
hx : Q₁ x₁ + Q₂ x₂ = 0
⊢ (x₁, x₂) = 0

Next tactic:
rw [add_eq_zero_iff' (hle₁ x₁) (hle₂ x₂), ha₁.eq_zero_iff, ha₂.eq_zero_iff] at hx
theorem posDef_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R M₂]
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} :
    (Q₁.prod Q₂).PosDef ↔ Q₁.PosDef ∧ Q₂.PosDef := by
  simp_rw [posDef_iff_nonneg, nonneg_prod_iff]
  constructor
  · rintro ⟨⟨hle₁, hle₂⟩, ha⟩
    obtain ⟨ha₁, ha₂⟩ := anisotropic_of_prod ha
    refine' ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
  · rintro ⟨⟨hle₁, ha₁⟩, ⟨hle₂, ha₂⟩⟩
    refine' ⟨⟨hle₁, hle₂⟩, _⟩
    rintro ⟨x₁, x₂⟩ (hx : Q₁ x₁ + Q₂ x₂ = 0)
    rw [add_eq_zero_iff' (hle₁ x₁) (hle₂ x₂), ha₁.eq_zero_iff, ha₂.eq_zero_iff] at hx
    

Proof state:
case mpr.intro.intro.intro.mk
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝¹¹ : CommSemiring R✝
inst✝¹⁰ : AddCommMonoid M₁
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : AddCommMonoid N₁
inst✝⁷ : AddCommMonoid N₂
inst✝⁶ : Module R✝ M₁
inst✝⁵ : Module R✝ M₂
inst✝⁴ : Module R✝ N₁
inst✝³ : Module R✝ N₂
R : Type u_9
inst✝² : OrderedCommRing R
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
hle₁ : ∀ (x : M₁), 0 ≤ Q₁ x
ha₁ : Anisotropic Q₁
hle₂ : ∀ (x : M₂), 0 ≤ Q₂ x
ha₂ : Anisotropic Q₂
x₁ : M₁
x₂ : M₂
hx : x₁ = 0 ∧ x₂ = 0
⊢ (x₁, x₂) = 0

Next tactic:
rwa [Prod.mk_eq_zero]
@[simp] theorem polar_prod (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (x y : M₁ × M₂) :
    polar (Q₁.prod Q₂) x y = polar Q₁ x.1 y.1 + polar Q₂ x.2 y.2 := by
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M₁
inst✝² : AddCommGroup M₂
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
x y : M₁ × M₂
⊢ polar (⇑(prod Q₁ Q₂)) x y = polar (⇑Q₁) x.1 y.1 + polar (⇑Q₂) x.2 y.2

Next tactic:
dsimp [polar]
@[simp] theorem polar_prod (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (x y : M₁ × M₂) :
    polar (Q₁.prod Q₂) x y = polar Q₁ x.1 y.1 + polar Q₂ x.2 y.2 := by
  dsimp [polar]
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M₁
inst✝² : AddCommGroup M₂
inst✝¹ : Module R M₁
inst✝ : Module R M₂
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
x y : M₁ × M₂
⊢ Q₁ (x.1 + y.1) + Q₂ (x.2 + y.2) - (Q₁ x.1 + Q₂ x.2) - (Q₁ y.1 + Q₂ y.2) =
    Q₁ (x.1 + y.1) - Q₁ x.1 - Q₁ y.1 + (Q₂ (x.2 + y.2) - Q₂ x.2 - Q₂ y.2)

Next tactic:
abel
@[simp] theorem associated_prod [Invertible (2 : R)]
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
    associated (Q₁.prod Q₂) =
      Q₁.associated.comp (.fst _ _ _) (.fst _ _ _) +
      Q₂.associated.comp (.snd _ _ _) (.snd _ _ _) := by
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M₁
inst✝³ : AddCommGroup M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
inst✝ : Invertible 2
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ associated (prod Q₁ Q₂) =
    BilinForm.comp (associated Q₁) (LinearMap.fst R M₁ M₂) (LinearMap.fst R M₁ M₂) +
      BilinForm.comp (associated Q₂) (LinearMap.snd R M₁ M₂) (LinearMap.snd R M₁ M₂)

Next tactic:
dsimp [associated, associatedHom]
@[simp] theorem associated_prod [Invertible (2 : R)]
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
    associated (Q₁.prod Q₂) =
      Q₁.associated.comp (.fst _ _ _) (.fst _ _ _) +
      Q₂.associated.comp (.snd _ _ _) (.snd _ _ _) := by
  dsimp [associated, associatedHom]
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M₁
inst✝³ : AddCommGroup M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
inst✝ : Invertible 2
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ { val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } • polarBilin (prod Q₁ Q₂) =
    BilinForm.comp ({ val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } • polarBilin Q₁) (LinearMap.fst R M₁ M₂)
        (LinearMap.fst R M₁ M₂) +
      BilinForm.comp ({ val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } • polarBilin Q₂) (LinearMap.snd R M₁ M₂)
        (LinearMap.snd R M₁ M₂)

Next tactic:
rw [polarBilin_prod, smul_add]
@[simp] theorem associated_prod [Invertible (2 : R)]
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
    associated (Q₁.prod Q₂) =
      Q₁.associated.comp (.fst _ _ _) (.fst _ _ _) +
      Q₂.associated.comp (.snd _ _ _) (.snd _ _ _) := by
  dsimp [associated, associatedHom]
  rw [polarBilin_prod, smul_add]
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M₁
inst✝³ : AddCommGroup M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
inst✝ : Invertible 2
Q₁ : QuadraticForm R M₁
Q₂ : QuadraticForm R M₂
⊢ { val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } •
        BilinForm.comp (polarBilin Q₁) (LinearMap.fst R M₁ M₂) (LinearMap.fst R M₁ M₂) +
      { val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } •
        BilinForm.comp (polarBilin Q₂) (LinearMap.snd R M₁ M₂) (LinearMap.snd R M₁ M₂) =
    BilinForm.comp ({ val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } • polarBilin Q₁) (LinearMap.fst R M₁ M₂)
        (LinearMap.fst R M₁ M₂) +
      BilinForm.comp ({ val := ⅟2, property := (_ : ⅟2 ∈ Set.center R) } • polarBilin Q₂) (LinearMap.snd R M₁ M₂)
        (LinearMap.snd R M₁ M₂)

Next tactic:
rfl
theorem pi_apply_single [Fintype ι] [DecidableEq ι]
    (Q : ∀ i, QuadraticForm R (Mᵢ i)) (i : ι) (m : Mᵢ i) :
    pi Q (Pi.single i m) = Q i m := by
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁶ : CommSemiring R
inst✝⁵ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁴ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝³ : (i : ι) → Module R (Mᵢ i)
inst✝² : (i : ι) → Module R (Nᵢ i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
Q : (i : ι) → QuadraticForm R (Mᵢ i)
i : ι
m : Mᵢ i
⊢ (pi Q) (Pi.single i m) = (Q i) m

Next tactic:
rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same]
theorem pi_apply_single [Fintype ι] [DecidableEq ι]
    (Q : ∀ i, QuadraticForm R (Mᵢ i)) (i : ι) (m : Mᵢ i) :
    pi Q (Pi.single i m) = Q i m := by
  rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same]
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁶ : CommSemiring R
inst✝⁵ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁴ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝³ : (i : ι) → Module R (Mᵢ i)
inst✝² : (i : ι) → Module R (Nᵢ i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
Q : (i : ι) → QuadraticForm R (Mᵢ i)
i : ι
m : Mᵢ i
j : ι
hj : j ≠ i
⊢ (Q j) (Pi.single i m j) = 0

Next tactic:
rw [Pi.single_eq_of_ne hj, map_zero]
/-- An isometry between quadratic forms generated by `QuadraticForm.pi` can be constructed
from a pair of isometries between the left and right parts. -/
@[simps toLinearEquiv]
def IsometryEquiv.pi [Fintype ι]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} {Q' : ∀ i, QuadraticForm R (Nᵢ i)}
    (e : ∀ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q') where
  map_app' x := by
    

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁵ : CommSemiring R
inst✝⁴ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝³ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝² : (i : ι) → Module R (Mᵢ i)
inst✝¹ : (i : ι) → Module R (Nᵢ i)
inst✝ : Fintype ι
Q : (i : ι) → QuadraticForm R (Mᵢ i)
Q' : (i : ι) → QuadraticForm R (Nᵢ i)
e : (i : ι) → IsometryEquiv (Q i) (Q' i)
x : (i : ι) → Mᵢ i
⊢ (QuadraticForm.pi Q') (AddHom.toFun (↑(LinearEquiv.piCongrRight fun i => (e i).toLinearEquiv)).toAddHom x) =
    (QuadraticForm.pi Q) x

Next tactic:
simp only [pi_apply, LinearEquiv.piCongrRight, LinearEquiv.toFun_eq_coe,
      IsometryEquiv.coe_toLinearEquiv, IsometryEquiv.map_app]
/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁷ : CommSemiring R✝
inst✝⁶ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁵ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝⁴ : (i : ι) → Module R✝ (Mᵢ i)
inst✝³ : (i : ι) → Module R✝ (Nᵢ i)
inst✝² : Fintype ι
R : Type u_9
inst✝¹ : OrderedCommRing R
inst✝ : (i : ι) → Module R (Mᵢ i)
Q : (i : ι) → QuadraticForm R (Mᵢ i)
h : Anisotropic (pi Q)
⊢ ∀ (i : ι), Anisotropic (Q i)

Next tactic:
simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h
/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by
  simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁷ : CommSemiring R✝
inst✝⁶ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁵ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝⁴ : (i : ι) → Module R✝ (Mᵢ i)
inst✝³ : (i : ι) → Module R✝ (Nᵢ i)
inst✝² : Fintype ι
R : Type u_9
inst✝¹ : OrderedCommRing R
inst✝ : (i : ι) → Module R (Mᵢ i)
Q : (i : ι) → QuadraticForm R (Mᵢ i)
h : ∀ (x : (i : ι) → Mᵢ i), ∑ i : ι, (Q i) (x i) = 0 → ∀ (a : ι), x a = 0
⊢ ∀ (i : ι), Anisotropic (Q i)

Next tactic:
intro i x hx
/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by
  simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h
  intro i x hx
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁷ : CommSemiring R✝
inst✝⁶ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁵ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝⁴ : (i : ι) → Module R✝ (Mᵢ i)
inst✝³ : (i : ι) → Module R✝ (Nᵢ i)
inst✝² : Fintype ι
R : Type u_9
inst✝¹ : OrderedCommRing R
inst✝ : (i : ι) → Module R (Mᵢ i)
Q : (i : ι) → QuadraticForm R (Mᵢ i)
h : ∀ (x : (i : ι) → Mᵢ i), ∑ i : ι, (Q i) (x i) = 0 → ∀ (a : ι), x a = 0
i : ι
x : Mᵢ i
hx : (Q i) x = 0
⊢ x = 0

Next tactic:
classical
  have := h (Pi.single i x) ?_ i
  · rw [Pi.single_eq_same] at this
    exact this
  apply Finset.sum_eq_zero
  intro j _
  by_cases hji : j = i
  · subst hji; rw [Pi.single_eq_same, hx]
  · rw [Pi.single_eq_of_ne hji, map_zero]
/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by
  simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h
  intro i x hx
  classical
  

Proof state:
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁷ : CommSemiring R✝
inst✝⁶ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁵ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝⁴ : (i : ι) → Module R✝ (Mᵢ i)
inst✝³ : (i : ι) → Module R✝ (Nᵢ i)
inst✝² : Fintype ι
R : Type u_9
inst✝¹ : OrderedCommRing R
inst✝ : (i : ι) → Module R (Mᵢ i)
Q : (i : ι) → QuadraticForm R (Mᵢ i)
h : ∀ (x : (i : ι) → Mᵢ i), ∑ i : ι, (Q i) (x i) = 0 → ∀ (a : ι), x a = 0
i : ι
x : Mᵢ i
hx : (Q i) x = 0
⊢ x = 0

Next tactic:
have := h (Pi.single i x) ?_ i
/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι] {R} [OrderedCommRing R] [∀ i, Module R (Mᵢ i)]
    {Q : ∀ i, QuadraticForm R (Mᵢ i)} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic := by
  simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h
  intro i x hx
  classical
  have := h (Pi.single i x) ?_ i
  · 

Proof state:
case refine_2
ι : Type u_1
R✝ : Type u_2
M₁ : Type u_3
M₂ : Type u_4
N₁ : Type u_5
N₂ : Type u_6
Mᵢ : ι → Type u_7
Nᵢ : ι → Type u_8
inst✝⁷ : CommSemiring R✝
inst✝⁶ : (i : ι) → AddCommMonoid (Mᵢ i)
inst✝⁵ : (i : ι) → AddCommMonoid (Nᵢ i)
inst✝⁴ : (i : ι) → Module R✝ (Mᵢ i)
inst✝³ : (i : ι) → Module R✝ (Nᵢ i)
inst✝² : Fintype ι
R : Type u_9
inst✝¹ : OrderedCommRing R
inst✝ : (i : ι) → Module R (Mᵢ i)
Q : (i : ι) → QuadraticForm R (Mᵢ i)
h : ∀ (x : (i : ι) → Mᵢ i), ∑ i : ι, (Q i) (x i) = 0 → ∀ (a : ι), x a = 0
i : ι
x : Mᵢ i
hx : (Q i) x = 0
this : Pi.single i x i = 0
⊢ x = 0

Next tactic:
rw [Pi.single_eq_same] at this