[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a + a = 0
[PROOFSTEP]
have : a + a = a + a + (a + a) :=
  calc
    a + a = (a + a) * (a + a) := by rw [mul_self]
    _ = a * a + a * a + (a * a + a * a) := by rw [add_mul, mul_add]
    _ = a + a + (a + a) := by rw [mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a + a = (a + a) * (a + a)
[PROOFSTEP]
rw [mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ (a + a) * (a + a) = a * a + a * a + (a * a + a * a)
[PROOFSTEP]
rw [add_mul, mul_add]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a * a + a * a + (a * a + a * a) = a + a + (a + a)
[PROOFSTEP]
rw [mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
this : a + a = a + a + (a + a)
⊢ a + a = 0
[PROOFSTEP]
rwa [self_eq_add_left] at this
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ -a = -a + 0
[PROOFSTEP]
rw [add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ -a + 0 = -a + -a + a
[PROOFSTEP]
rw [← neg_add_self, add_assoc]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ -a + -a + a = a
[PROOFSTEP]
rw [add_self, zero_add]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a = -b ↔ a = b
[PROOFSTEP]
rw [neg_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a * b + b * a = 0
[PROOFSTEP]
have : a + b = a + b + (a * b + b * a) :=
  calc
    a + b = (a + b) * (a + b) := by rw [mul_self]
    _ = a * a + a * b + (b * a + b * b) := by rw [add_mul, mul_add, mul_add]
    _ = a + a * b + (b * a + b) := by simp only [mul_self]
    _ = a + b + (a * b + b * a) := by abel
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a + b = (a + b) * (a + b)
[PROOFSTEP]
rw [mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ (a + b) * (a + b) = a * a + a * b + (b * a + b * b)
[PROOFSTEP]
rw [add_mul, mul_add, mul_add]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a * a + a * b + (b * a + b * b) = a + a * b + (b * a + b)
[PROOFSTEP]
simp only [mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a + a * b + (b * a + b) = a + b + (a * b + b * a)
[PROOFSTEP]
abel
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a + a * b + (b * a + b) = a + b + (a * b + b * a)
[PROOFSTEP]
abel
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
this : a + b = a + b + (a * b + b * a)
⊢ a * b + b * a = 0
[PROOFSTEP]
rwa [self_eq_add_right] at this
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a - b = a + b
[PROOFSTEP]
rw [sub_eq_add_neg, add_right_inj, neg_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a b : α
⊢ a * (1 + a) = 0
[PROOFSTEP]
rw [mul_add, mul_one, mul_self, add_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : BooleanRing α
a✝ b✝ : α
src✝ : BooleanRing α := inferInstance
a b : α
⊢ a * b = b * a
[PROOFSTEP]
rw [← add_eq_zero', mul_add_mul]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a ⊔ b = b ⊔ a
[PROOFSTEP]
dsimp only [(· ⊔ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a + b + a * b = b + a + b * a
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a ⊓ b = b ⊓ a
[PROOFSTEP]
dsimp only [(· ⊓ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a * b = b * a
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
[PROOFSTEP]
dsimp only [(· ⊔ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ a + b + a * b + c + (a + b + a * b) * c = a + (b + c + b * c) + a * (b + c + b * c)
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ a ⊓ b ⊓ c = a ⊓ (b ⊓ c)
[PROOFSTEP]
dsimp only [(· ⊓ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ a * b * c = a * (b * c)
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a ⊔ a ⊓ b = a
[PROOFSTEP]
dsimp only [(· ⊔ ·), (· ⊓ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a + a * b + a * (a * b) = a
[PROOFSTEP]
rw [← mul_assoc, mul_self, add_assoc, add_self, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a ⊓ (a ⊔ b) = a
[PROOFSTEP]
dsimp only [(· ⊔ ·), (· ⊓ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a * (a + b + a * b) = a
[PROOFSTEP]
rw [mul_add, mul_add, mul_self, ← mul_assoc, mul_self, add_assoc, add_self, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ (a + b + a * b) * (a + c + a * c) =
    a * a + b * c + a * (b * c) + (a * b + a * a * b) + (a * c + a * a * c) + (a * b * c + a * a * b * c)
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ a * a + b * c + a * (b * c) + (a * b + a * a * b) + (a * c + a * a * c) + (a * b * c + a * a * b * c) =
    a + b * c + a * (b * c)
[PROOFSTEP]
simp only [mul_self, add_self, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ⊔ (a ⊔ b ⊓ c) = a ⊔ b ⊓ c
[PROOFSTEP]
dsimp only [(· ⊔ ·), (· ⊓ ·)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b c : α
⊢ (a + b + a * b) * (a + c + a * c) + (a + b * c + a * (b * c)) +
      (a + b + a * b) * (a + c + a * c) * (a + b * c + a * (b * c)) =
    a + b * c + a * (b * c)
[PROOFSTEP]
rw [le_sup_inf_aux, add_self, mul_self, zero_add]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ a * (1 + a) + 0 + a * (1 + a) * 0 = 0
[PROOFSTEP]
norm_num [mul_add, mul_self, add_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ ⊤ ≤ a ⊔ aᶜ
[PROOFSTEP]
change 1 + (a + (1 + a) + a * (1 + a)) + 1 * (a + (1 + a) + a * (1 + a)) = a + (1 + a) + a * (1 + a)
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ 1 + (a + (1 + a) + a * (1 + a)) + 1 * (a + (1 + a) + a * (1 + a)) = a + (1 + a) + a * (1 + a)
[PROOFSTEP]
norm_num [mul_add, mul_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ 1 + (a + (1 + a)) = 0
[PROOFSTEP]
rw [← add_assoc, add_self]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ a + 1 + a * 1 = 1
[PROOFSTEP]
rw [mul_one, (add_comm a 1), add_assoc, add_self, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
src✝ : Lattice α :=
  Lattice.mk' (_ : ∀ (a b : α), a ⊔ b = b ⊔ a) (_ : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c))
    (_ : ∀ (a b : α), a ⊓ b = b ⊓ a) (_ : ∀ (a b c : α), a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (_ : ∀ (a b : α), a ⊔ a ⊓ b = a)
    (_ : ∀ (a b : α), a ⊓ (a ⊔ b) = a)
a : α
⊢ 0 + a + 0 * a = a
[PROOFSTEP]
rw [zero_mul, zero_add, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ (a + b + a * b) * (1 + a * b) = a + b + (a * b + a * b * (a * b)) + (a * (b * b) + a * a * b)
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : α
⊢ a + b + (a * b + a * b * (a * b)) + (a * (b * b) + a * a * b) = a + b
[PROOFSTEP]
simp only [mul_self, add_self, add_zero]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : AsBoolAlg α
⊢ ↑ofBoolAlg (a ∆ b) = ↑ofBoolAlg a + ↑ofBoolAlg b
[PROOFSTEP]
rw [symmDiff_eq_sup_sdiff_inf]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
a b : AsBoolAlg α
⊢ ↑ofBoolAlg ((a ⊔ b) \ (a ⊓ b)) = ↑ofBoolAlg a + ↑ofBoolAlg b
[PROOFSTEP]
exact of_boolalg_symmDiff_aux _ _
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
f : α →+* β
a b : AsBoolAlg α
⊢ (↑toBoolAlg ∘ ↑f ∘ ↑ofBoolAlg) (a ⊔ b) = (↑toBoolAlg ∘ ↑f ∘ ↑ofBoolAlg) a ⊔ (↑toBoolAlg ∘ ↑f ∘ ↑ofBoolAlg) b
[PROOFSTEP]
dsimp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝² : BooleanRing α
inst✝¹ : BooleanRing β
inst✝ : BooleanRing γ
f : α →+* β
a b : AsBoolAlg α
⊢ ↑toBoolAlg (↑f (↑ofBoolAlg a + ↑ofBoolAlg b + ↑ofBoolAlg a * ↑ofBoolAlg b)) =
    ↑toBoolAlg (↑f (↑ofBoolAlg a)) ⊔ ↑toBoolAlg (↑f (↑ofBoolAlg b))
[PROOFSTEP]
simp_rw [map_add f, map_mul f, toBoolAlg_add_add_mul]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
a : Bool
⊢ a * 0 = 0
[PROOFSTEP]
cases a
[GOAL]
case false
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ false * 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case true
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ true * 0 = 0
[PROOFSTEP]
rfl


[GOAL]
σ : Type u
R : Type v
inst✝¹ : CommRing R
p m : ℕ
inst✝ : CharP R p
n : ℕ
⊢ ↑n = 0 ↔ p ∣ n
[PROOFSTEP]
rw [← C_eq_coe_nat, ← C_0, C_inj, CharP.cast_eq_zero_iff R p]
[GOAL]
σ : Type u
R✝ : Type v
inst✝² : CommRing R✝
p✝ m : ℕ
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
p : MvPolynomial σ R
f : R →+* S
⊢ Finsupp.mapRange ↑f (_ : ↑f 0 = 0) p = ↑(map f) p
[PROOFSTEP]
change Finsupp.mapRange (f : R →+ S) (f : R →+ S).map_zero p = map f p
[GOAL]
σ : Type u
R✝ : Type v
inst✝² : CommRing R✝
p✝ m : ℕ
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
p : MvPolynomial σ R
f : R →+* S
⊢ Finsupp.mapRange ↑↑f (_ : ↑↑f 0 = 0) p = ↑(map f) p
[PROOFSTEP]
rw [p.as_sum, Finsupp.mapRange_finset_sum, (map f).map_sum]
[GOAL]
σ : Type u
R✝ : Type v
inst✝² : CommRing R✝
p✝ m : ℕ
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
p : MvPolynomial σ R
f : R →+* S
⊢ ∑ x in support p, Finsupp.mapRange ↑↑f (_ : ↑↑f 0 = 0) (↑(monomial x) (coeff x p)) =
    ∑ x in support p, ↑(map f) (↑(monomial x) (coeff x p))
[PROOFSTEP]
refine' Finset.sum_congr rfl fun n _ => _
[GOAL]
σ : Type u
R✝ : Type v
inst✝² : CommRing R✝
p✝ m : ℕ
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
p : MvPolynomial σ R
f : R →+* S
n : σ →₀ ℕ
x✝ : n ∈ support p
⊢ Finsupp.mapRange ↑↑f (_ : ↑↑f 0 = 0) (↑(monomial n) (coeff n p)) = ↑(map f) (↑(monomial n) (coeff n p))
[PROOFSTEP]
rw [map_monomial, ← single_eq_monomial, Finsupp.mapRange_single, single_eq_monomial]
[GOAL]
σ : Type u
R✝ : Type v
inst✝² : CommRing R✝
p✝ m : ℕ
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
p : MvPolynomial σ R
f : R →+* S
n : σ →₀ ℕ
x✝ : n ∈ support p
⊢ ↑(monomial n) (↑↑f (coeff n p)) = ↑(monomial n) (↑f (coeff n p))
[PROOFSTEP]
simp_all only [AddMonoidHom.coe_coe]
[GOAL]
σ : Type u
R : Type v
inst✝ : CommRing R
p✝ m : ℕ
p : MvPolynomial σ R
⊢ p ∈ restrictTotalDegree σ R m ↔ totalDegree p ≤ m
[PROOFSTEP]
rw [totalDegree, Finset.sup_le_iff]
[GOAL]
σ : Type u
R : Type v
inst✝ : CommRing R
p✝ m : ℕ
p : MvPolynomial σ R
⊢ p ∈ restrictTotalDegree σ R m ↔ ∀ (b : σ →₀ ℕ), b ∈ support p → (Finsupp.sum b fun x e => e) ≤ m
[PROOFSTEP]
rfl
[GOAL]
σ : Type u
R : Type v
inst✝ : CommRing R
p✝ m : ℕ
p : MvPolynomial σ R
n : ℕ
⊢ p ∈ restrictDegree σ R n ↔ ∀ (s : σ →₀ ℕ), s ∈ support p → ∀ (i : σ), ↑s i ≤ n
[PROOFSTEP]
rw [restrictDegree, Finsupp.mem_supported]
[GOAL]
σ : Type u
R : Type v
inst✝ : CommRing R
p✝ m : ℕ
p : MvPolynomial σ R
n : ℕ
⊢ ↑p.support ⊆ {n_1 | ∀ (i : σ), ↑n_1 i ≤ n} ↔ ∀ (s : σ →₀ ℕ), s ∈ support p → ∀ (i : σ), ↑s i ≤ n
[PROOFSTEP]
rfl
[GOAL]
σ : Type u
R : Type v
inst✝¹ : CommRing R
p✝ m : ℕ
inst✝ : DecidableEq σ
p : MvPolynomial σ R
n : ℕ
⊢ p ∈ restrictDegree σ R n ↔ ∀ (i : σ), Multiset.count i (degrees p) ≤ n
[PROOFSTEP]
simp only [mem_restrictDegree, degrees_def, Multiset.count_finset_sup, Finsupp.count_toMultiset, Finset.sup_le_iff]
[GOAL]
σ : Type u
R : Type v
inst✝¹ : CommRing R
p✝ m : ℕ
inst✝ : DecidableEq σ
p : MvPolynomial σ R
n : ℕ
⊢ (∀ (s : σ →₀ ℕ), s ∈ support p → ∀ (i : σ), ↑s i ≤ n) ↔ ∀ (i : σ) (b : σ →₀ ℕ), b ∈ support p → ↑b i ≤ n
[PROOFSTEP]
exact ⟨fun h n s hs => h s hs n, fun h s hs n => h n s hs⟩


[GOAL]
r : ℝ
hr : r < 0
⊢ sign r = -1
[PROOFSTEP]
rw [sign, if_pos hr]
[GOAL]
r : ℝ
hr : 0 < r
⊢ sign r = 1
[PROOFSTEP]
rw [sign, if_pos hr, if_neg hr.not_lt]
[GOAL]
⊢ sign 0 = 0
[PROOFSTEP]
rw [sign, if_neg (lt_irrefl _), if_neg (lt_irrefl _)]
[GOAL]
⊢ 0 < 1
[PROOFSTEP]
norm_num
[GOAL]
r : ℝ
⊢ sign r = -1 ∨ sign r = 0 ∨ sign r = 1
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ)
[GOAL]
case inl
r : ℝ
hn : r < 0
⊢ sign r = -1 ∨ sign r = 0 ∨ sign r = 1
[PROOFSTEP]
exact Or.inl <| sign_of_neg hn
[GOAL]
case inr.inl
⊢ sign 0 = -1 ∨ sign 0 = 0 ∨ sign 0 = 1
[PROOFSTEP]
exact Or.inr <| Or.inl <| sign_zero
[GOAL]
case inr.inr
r : ℝ
hp : 0 < r
⊢ sign r = -1 ∨ sign r = 0 ∨ sign r = 1
[PROOFSTEP]
exact Or.inr <| Or.inr <| sign_of_pos hp
[GOAL]
r : ℝ
⊢ sign r = 0 ↔ r = 0
[PROOFSTEP]
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
[GOAL]
r : ℝ
h : sign r = 0
⊢ r = 0
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ)
[GOAL]
case inl
r : ℝ
h : sign r = 0
hn : r < 0
⊢ r = 0
[PROOFSTEP]
rw [sign_of_neg hn, neg_eq_zero] at h
[GOAL]
case inl
r : ℝ
h : 1 = 0
hn : r < 0
⊢ r = 0
[PROOFSTEP]
exact (one_ne_zero h).elim
[GOAL]
case inr.inl
h : sign 0 = 0
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case inr.inr
r : ℝ
h : sign r = 0
hp : 0 < r
⊢ r = 0
[PROOFSTEP]
rw [sign_of_pos hp] at h
[GOAL]
case inr.inr
r : ℝ
h : 1 = 0
hp : 0 < r
⊢ r = 0
[PROOFSTEP]
exact (one_ne_zero h).elim
[GOAL]
z : ℤ
⊢ sign ↑z = ↑(Int.sign z)
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy z (0 : ℤ)
[GOAL]
case inl
z : ℤ
hn : z < 0
⊢ sign ↑z = ↑(Int.sign z)
[PROOFSTEP]
rw [sign_of_neg (Int.cast_lt_zero.mpr hn), Int.sign_eq_neg_one_of_neg hn, Int.cast_neg, Int.cast_one]
[GOAL]
case inr.inl
⊢ sign ↑0 = ↑(Int.sign 0)
[PROOFSTEP]
rw [Int.cast_zero, sign_zero, Int.sign_zero, Int.cast_zero]
[GOAL]
case inr.inr
z : ℤ
hp : 0 < z
⊢ sign ↑z = ↑(Int.sign z)
[PROOFSTEP]
rw [sign_of_pos (Int.cast_pos.mpr hp), Int.sign_eq_one_of_pos hp, Int.cast_one]
[GOAL]
r : ℝ
⊢ sign (-r) = -sign r
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ)
[GOAL]
case inl
r : ℝ
hn : r < 0
⊢ sign (-r) = -sign r
[PROOFSTEP]
rw [sign_of_neg hn, sign_of_pos (neg_pos.mpr hn), neg_neg]
[GOAL]
case inr.inl
⊢ sign (-0) = -sign 0
[PROOFSTEP]
rw [sign_zero, neg_zero, sign_zero]
[GOAL]
case inr.inr
r : ℝ
hp : 0 < r
⊢ sign (-r) = -sign r
[PROOFSTEP]
rw [sign_of_pos hp, sign_of_neg (neg_lt_zero.mpr hp)]
[GOAL]
r : ℝ
⊢ 0 ≤ sign r * r
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ)
[GOAL]
case inl
r : ℝ
hn : r < 0
⊢ 0 ≤ sign r * r
[PROOFSTEP]
rw [sign_of_neg hn]
[GOAL]
case inl
r : ℝ
hn : r < 0
⊢ 0 ≤ -1 * r
[PROOFSTEP]
exact mul_nonneg_of_nonpos_of_nonpos (by norm_num) hn.le
[GOAL]
r : ℝ
hn : r < 0
⊢ -1 ≤ 0
[PROOFSTEP]
norm_num
[GOAL]
case inr.inl
⊢ 0 ≤ sign 0 * 0
[PROOFSTEP]
rw [mul_zero]
[GOAL]
case inr.inr
r : ℝ
hp : 0 < r
⊢ 0 ≤ sign r * r
[PROOFSTEP]
rw [sign_of_pos hp, one_mul]
[GOAL]
case inr.inr
r : ℝ
hp : 0 < r
⊢ 0 ≤ r
[PROOFSTEP]
exact hp.le
[GOAL]
r : ℝ
hr : r ≠ 0
⊢ 0 < sign r * r
[PROOFSTEP]
refine' lt_of_le_of_ne (sign_mul_nonneg r) fun h => hr _
[GOAL]
r : ℝ
hr : r ≠ 0
h : 0 = sign r * r
⊢ r = 0
[PROOFSTEP]
have hs0 := (zero_eq_mul.mp h).resolve_right hr
[GOAL]
r : ℝ
hr : r ≠ 0
h : 0 = sign r * r
hs0 : sign r = 0
⊢ r = 0
[PROOFSTEP]
exact sign_eq_zero_iff.mp hs0
[GOAL]
r : ℝ
⊢ (sign r)⁻¹ = sign r
[PROOFSTEP]
obtain hn | hz | hp := sign_apply_eq r
[GOAL]
case inl
r : ℝ
hn : sign r = -1
⊢ (sign r)⁻¹ = sign r
[PROOFSTEP]
rw [hn]
[GOAL]
case inl
r : ℝ
hn : sign r = -1
⊢ (-1)⁻¹ = -1
[PROOFSTEP]
norm_num
[GOAL]
case inr.inl
r : ℝ
hz : sign r = 0
⊢ (sign r)⁻¹ = sign r
[PROOFSTEP]
rw [hz]
[GOAL]
case inr.inl
r : ℝ
hz : sign r = 0
⊢ 0⁻¹ = 0
[PROOFSTEP]
exact inv_zero
[GOAL]
case inr.inr
r : ℝ
hp : sign r = 1
⊢ (sign r)⁻¹ = sign r
[PROOFSTEP]
rw [hp]
[GOAL]
case inr.inr
r : ℝ
hp : sign r = 1
⊢ 1⁻¹ = 1
[PROOFSTEP]
exact inv_one
[GOAL]
r : ℝ
⊢ sign r⁻¹ = sign r
[PROOFSTEP]
obtain hn | rfl | hp := lt_trichotomy r (0 : ℝ)
[GOAL]
case inl
r : ℝ
hn : r < 0
⊢ sign r⁻¹ = sign r
[PROOFSTEP]
rw [sign_of_neg hn, sign_of_neg (inv_lt_zero.mpr hn)]
[GOAL]
case inr.inl
⊢ sign 0⁻¹ = sign 0
[PROOFSTEP]
rw [sign_zero, inv_zero, sign_zero]
[GOAL]
case inr.inr
r : ℝ
hp : 0 < r
⊢ sign r⁻¹ = sign r
[PROOFSTEP]
rw [sign_of_pos hp, sign_of_pos (inv_pos.mpr hp)]


[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ card s * card t ≤ multiplicativeEnergy s t
[PROOFSTEP]
rw [← card_product]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ card (s ×ˢ t) ≤ multiplicativeEnergy s t
[PROOFSTEP]
refine'
  card_le_card_of_inj_on (@fun x => ((x.1, x.1), x.2, x.2))
    (by
      -- porting note: changed this from a `simp` proof without `only` because of a timeoutsimp only [← and_imp,
        mem_product, and_imp, Prod.forall, mem_filter, and_self, and_true, imp_self, implies_true])
    fun a _ b _ => _
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ ∀ (a : α × α),
    a ∈ s ×ˢ t →
      (fun x => ((x.fst, x.fst), x.snd, x.snd)) a ∈
        filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) ((s ×ˢ s) ×ˢ t ×ˢ t)
[PROOFSTEP]
simp only [← and_imp, mem_product, and_imp, Prod.forall, mem_filter, and_self, and_true, imp_self, implies_true]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
a : α × α
x✝¹ : a ∈ s ×ˢ t
b : α × α
x✝ : b ∈ s ×ˢ t
⊢ (fun x => ((x.fst, x.fst), x.snd, x.snd)) a = (fun x => ((x.fst, x.fst), x.snd, x.snd)) b → a = b
[PROOFSTEP]
simp only [Prod.mk.inj_iff, and_self_iff, and_imp]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
a : α × α
x✝¹ : a ∈ s ×ˢ t
b : α × α
x✝ : b ∈ s ×ˢ t
⊢ a.fst = b.fst → a.snd = b.snd → a = b
[PROOFSTEP]
exact Prod.ext
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ multiplicativeEnergy ∅ t = 0
[PROOFSTEP]
simp [multiplicativeEnergy]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ multiplicativeEnergy s ∅ = 0
[PROOFSTEP]
simp [multiplicativeEnergy]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
h : 0 < multiplicativeEnergy s t
H : ¬(Finset.Nonempty s ∧ Finset.Nonempty t)
⊢ False
[PROOFSTEP]
simp_rw [not_and_or, not_nonempty_iff_eq_empty] at H
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
h : 0 < multiplicativeEnergy s t
H : s = ∅ ∨ t = ∅
⊢ False
[PROOFSTEP]
obtain rfl | rfl := H
[GOAL]
case inl
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s₁ s₂ t t₁ t₂ : Finset α
h : 0 < multiplicativeEnergy ∅ t
⊢ False
[PROOFSTEP]
simp [Nat.not_lt_zero] at h
[GOAL]
case inr
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t₁ t₂ : Finset α
h : 0 < multiplicativeEnergy s ∅
⊢ False
[PROOFSTEP]
simp [Nat.not_lt_zero] at h
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Mul α
s s₁ s₂ t t₁ t₂ : Finset α
⊢ multiplicativeEnergy s t = 0 ↔ s = ∅ ∨ t = ∅
[PROOFSTEP]
simp [← (Nat.zero_le _).not_gt_iff_eq, not_and_or, imp_iff_or_not, or_comm]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommMonoid α
s t : Finset α
⊢ multiplicativeEnergy s t = multiplicativeEnergy t s
[PROOFSTEP]
rw [multiplicativeEnergy, ← Finset.card_map (Equiv.prodComm _ _).toEmbedding, map_filter]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CommMonoid α
s t : Finset α
⊢ card
      (filter ((fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) ∘ ↑(Equiv.prodComm (α × α) (α × α)).symm)
        (map (Equiv.toEmbedding (Equiv.prodComm (α × α) (α × α))) ((s ×ˢ s) ×ˢ t ×ˢ t))) =
    multiplicativeEnergy t s
[PROOFSTEP]
simp [-Finset.card_map, eq_comm, multiplicativeEnergy, mul_comm, map_eq_image, Function.comp]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
⊢ multiplicativeEnergy univ t = Fintype.card α * card t ^ 2
[PROOFSTEP]
simp only [multiplicativeEnergy, univ_product_univ, Fintype.card, sq, ← card_product]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
⊢ card (filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) (univ ×ˢ t ×ˢ t)) = card (univ ×ˢ t ×ˢ t)
[PROOFSTEP]
let f : α × α × α → (α × α) × α × α := fun x => ((x.1 * x.2.2, x.1 * x.2.1), x.2)
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
⊢ card (filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) (univ ×ˢ t ×ˢ t)) = card (univ ×ˢ t ×ˢ t)
[PROOFSTEP]
have : (↑((univ : Finset α) ×ˢ t ×ˢ t) : Set (α × α × α)).InjOn f :=
  by
  rintro ⟨a₁, b₁, c₁⟩ _ ⟨a₂, b₂, c₂⟩ h₂ h
  simp_rw [Prod.ext_iff] at h
  obtain ⟨h, rfl, rfl⟩ := h
  rw [mul_right_cancel h.1]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
⊢ Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
[PROOFSTEP]
rintro ⟨a₁, b₁, c₁⟩ _ ⟨a₂, b₂, c₂⟩ h₂ h
[GOAL]
case mk.mk.mk.mk
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
a₁ b₁ c₁ : α
a✝ : (a₁, b₁, c₁) ∈ ↑(univ ×ˢ t ×ˢ t)
a₂ b₂ c₂ : α
h₂ : (a₂, b₂, c₂) ∈ ↑(univ ×ˢ t ×ˢ t)
h : f (a₁, b₁, c₁) = f (a₂, b₂, c₂)
⊢ (a₁, b₁, c₁) = (a₂, b₂, c₂)
[PROOFSTEP]
simp_rw [Prod.ext_iff] at h
[GOAL]
case mk.mk.mk.mk
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
a₁ b₁ c₁ : α
a✝ : (a₁, b₁, c₁) ∈ ↑(univ ×ˢ t ×ˢ t)
a₂ b₂ c₂ : α
h₂ : (a₂, b₂, c₂) ∈ ↑(univ ×ˢ t ×ˢ t)
h : (a₁ * c₁ = a₂ * c₂ ∧ a₁ * b₁ = a₂ * b₂) ∧ b₁ = b₂ ∧ c₁ = c₂
⊢ (a₁, b₁, c₁) = (a₂, b₂, c₂)
[PROOFSTEP]
obtain ⟨h, rfl, rfl⟩ := h
[GOAL]
case mk.mk.mk.mk.intro.intro
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
a₁ b₁ c₁ : α
a✝ : (a₁, b₁, c₁) ∈ ↑(univ ×ˢ t ×ˢ t)
a₂ : α
h₂ : (a₂, b₁, c₁) ∈ ↑(univ ×ˢ t ×ˢ t)
h : a₁ * c₁ = a₂ * c₁ ∧ a₁ * b₁ = a₂ * b₁
⊢ (a₁, b₁, c₁) = (a₂, b₁, c₁)
[PROOFSTEP]
rw [mul_right_cancel h.1]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
⊢ card (filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) (univ ×ˢ t ×ˢ t)) = card (univ ×ˢ t ×ˢ t)
[PROOFSTEP]
rw [← card_image_of_injOn this]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
⊢ card (filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) (univ ×ˢ t ×ˢ t)) =
    card (image f (univ ×ˢ t ×ˢ t))
[PROOFSTEP]
congr with a
[GOAL]
case e_s.a
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
a : (α × α) × α × α
⊢ a ∈ filter (fun x => x.fst.fst * x.snd.fst = x.fst.snd * x.snd.snd) (univ ×ˢ t ×ˢ t) ↔ a ∈ image f (univ ×ˢ t ×ˢ t)
[PROOFSTEP]
simp only [mem_filter, mem_product, mem_univ, true_and_iff, mem_image, exists_prop, Prod.exists]
[GOAL]
case e_s.a
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
a : (α × α) × α × α
⊢ (a.snd.fst ∈ t ∧ a.snd.snd ∈ t) ∧ a.fst.fst * a.snd.fst = a.fst.snd * a.snd.snd ↔
    ∃ a_1 a_2 b, (a_2 ∈ t ∧ b ∈ t) ∧ ((a_1 * b, a_1 * a_2), a_2, b) = a
[PROOFSTEP]
refine' ⟨fun h => ⟨a.1.1 * a.2.2⁻¹, _, _, h.1, by simp [mul_right_comm, h.2]⟩, _⟩
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
a : (α × α) × α × α
h : (a.snd.fst ∈ t ∧ a.snd.snd ∈ t) ∧ a.fst.fst * a.snd.fst = a.fst.snd * a.snd.snd
⊢ ((a.fst.fst * a.snd.snd⁻¹ * a.snd.snd, a.fst.fst * a.snd.snd⁻¹ * a.snd.fst), a.snd.fst, a.snd.snd) = a
[PROOFSTEP]
simp [mul_right_comm, h.2]
[GOAL]
case e_s.a
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
a : (α × α) × α × α
⊢ (∃ a_1 a_2 b, (a_2 ∈ t ∧ b ∈ t) ∧ ((a_1 * b, a_1 * a_2), a_2, b) = a) →
    (a.snd.fst ∈ t ∧ a.snd.snd ∈ t) ∧ a.fst.fst * a.snd.fst = a.fst.snd * a.snd.snd
[PROOFSTEP]
rintro ⟨b, c, d, hcd, rfl⟩
[GOAL]
case e_s.a.intro.intro.intro.intro
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
f : α × α × α → (α × α) × α × α := fun x => ((x.fst * x.snd.snd, x.fst * x.snd.fst), x.snd)
this : Set.InjOn f ↑(univ ×ˢ t ×ˢ t)
b c d : α
hcd : c ∈ t ∧ d ∈ t
⊢ (((b * d, b * c), c, d).snd.fst ∈ t ∧ ((b * d, b * c), c, d).snd.snd ∈ t) ∧
    ((b * d, b * c), c, d).fst.fst * ((b * d, b * c), c, d).snd.fst =
      ((b * d, b * c), c, d).fst.snd * ((b * d, b * c), c, d).snd.snd
[PROOFSTEP]
simpa [mul_right_comm]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : CommGroup α
inst✝ : Fintype α
s t : Finset α
⊢ multiplicativeEnergy s univ = Fintype.card α * card s ^ 2
[PROOFSTEP]
rw [multiplicativeEnergy_comm, multiplicativeEnergy_univ_left]


[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
r : ℝ
hr : 0 ≤ r
A : Matrix m n α
⊢ ‖A‖ ≤ r ↔ ∀ (i : m) (j : n), ‖A i j‖ ≤ r
[PROOFSTEP]
simp_rw [norm_def, pi_norm_le_iff_of_nonneg hr]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
r : ℝ≥0
A : Matrix m n α
⊢ ‖A‖₊ ≤ r ↔ ∀ (i : m) (j : n), ‖A i j‖₊ ≤ r
[PROOFSTEP]
simp_rw [nnnorm_def, pi_nnnorm_le_iff]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
r : ℝ
hr : 0 < r
A : Matrix m n α
⊢ ‖A‖ < r ↔ ∀ (i : m) (j : n), ‖A i j‖ < r
[PROOFSTEP]
simp_rw [norm_def, pi_norm_lt_iff hr]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
r : ℝ≥0
hr : 0 < r
A : Matrix m n α
⊢ ‖A‖₊ < r ↔ ∀ (i : m) (j : n), ‖A i j‖₊ < r
[PROOFSTEP]
simp_rw [nnnorm_def, pi_nnnorm_lt_iff hr]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
f : α → β
hf : ∀ (a : α), ‖f a‖₊ = ‖a‖₊
⊢ ‖map A f‖₊ = ‖A‖₊
[PROOFSTEP]
simp only [nnnorm_def, Pi.nnnorm_def, Matrix.map_apply, hf]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : m → α
⊢ ‖col v‖₊ = ‖v‖₊
[PROOFSTEP]
simp [nnnorm_def, Pi.nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : n → α
⊢ ‖row v‖₊ = ‖v‖₊
[PROOFSTEP]
simp [nnnorm_def, Pi.nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
⊢ ‖diagonal v‖₊ = ‖v‖₊
[PROOFSTEP]
simp_rw [nnnorm_def, Pi.nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
⊢ (Finset.sup Finset.univ fun b => Finset.sup Finset.univ fun b_1 => ‖diagonal v b b_1‖₊) =
    Finset.sup Finset.univ fun b => ‖v b‖₊
[PROOFSTEP]
congr 1 with i : 1
[GOAL]
case e_f.h
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i : n
⊢ (Finset.sup Finset.univ fun b => ‖diagonal v i b‖₊) = ‖v i‖₊
[PROOFSTEP]
refine' le_antisymm (Finset.sup_le fun j hj => _) _
[GOAL]
case e_f.h.refine'_1
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i j : n
hj : j ∈ Finset.univ
⊢ ‖diagonal v i j‖₊ ≤ ‖v i‖₊
[PROOFSTEP]
obtain rfl | hij := eq_or_ne i j
[GOAL]
case e_f.h.refine'_1.inl
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i : n
hj : i ∈ Finset.univ
⊢ ‖diagonal v i i‖₊ ≤ ‖v i‖₊
[PROOFSTEP]
rw [diagonal_apply_eq]
[GOAL]
case e_f.h.refine'_1.inr
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i j : n
hj : j ∈ Finset.univ
hij : i ≠ j
⊢ ‖diagonal v i j‖₊ ≤ ‖v i‖₊
[PROOFSTEP]
rw [diagonal_apply_ne _ hij, nnnorm_zero]
[GOAL]
case e_f.h.refine'_1.inr
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i j : n
hj : j ∈ Finset.univ
hij : i ≠ j
⊢ 0 ≤ ‖v i‖₊
[PROOFSTEP]
exact zero_le _
[GOAL]
case e_f.h.refine'_2
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i : n
⊢ ‖v i‖₊ ≤ Finset.sup Finset.univ fun b => ‖diagonal v i b‖₊
[PROOFSTEP]
refine' Eq.trans_le _ (Finset.le_sup (Finset.mem_univ i))
[GOAL]
case e_f.h.refine'_2
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
i : n
⊢ ‖v i‖₊ = ‖diagonal v i i‖₊
[PROOFSTEP]
rw [diagonal_apply_eq]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
⊢ SeminormedAddCommGroup (m → PiLp 1 fun j => α)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NormedAddCommGroup α
⊢ NormedAddCommGroup (m → PiLp 1 fun j => α)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : NormedField R
inst✝¹ : SeminormedAddCommGroup α
inst✝ : NormedSpace R α
⊢ NormedSpace R (m → PiLp 1 fun j => α)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
A : Matrix m n α
⊢ ‖A‖ = ↑(Finset.sup Finset.univ fun i => ∑ j : n, ‖A i j‖₊)
[PROOFSTEP]
change ‖fun i => (PiLp.equiv 1 _).symm (A i)‖ = _
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
A : Matrix m n α
⊢ ‖fun i => ↑(PiLp.equiv 1 fun i => α).symm (A i)‖ = ↑(Finset.sup Finset.univ fun i => ∑ j : n, ‖A i j‖₊)
[PROOFSTEP]
simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
v : m → α
⊢ ‖col v‖₊ = ‖v‖₊
[PROOFSTEP]
rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
v : m → α
⊢ (Finset.sup Finset.univ fun i => ∑ j : Unit, ‖col v i j‖₊) = Finset.sup Finset.univ fun b => ‖v b‖₊
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
v : n → α
⊢ ‖row v‖₊ = ∑ i : n, ‖v i‖₊
[PROOFSTEP]
simp [linfty_op_nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : SeminormedAddCommGroup α
v : n → α
⊢ ↑(∑ i : n, ‖v i‖₊) = ∑ i : n, ‖v i‖
[PROOFSTEP]
simp [NNReal.coe_sum]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : DecidableEq m
v : m → α
⊢ ‖diagonal v‖₊ = ‖v‖₊
[PROOFSTEP]
rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : DecidableEq m
v : m → α
⊢ (Finset.sup Finset.univ fun i => ∑ j : m, ‖diagonal v i j‖₊) = Finset.sup Finset.univ fun b => ‖v b‖₊
[PROOFSTEP]
congr 1 with i : 1
[GOAL]
case e_f.h
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : DecidableEq m
v : m → α
i : m
⊢ ∑ j : m, ‖diagonal v i j‖₊ = ‖v i‖₊
[PROOFSTEP]
refine' (Finset.sum_eq_single_of_mem _ (Finset.mem_univ i) fun j _hj hij => _).trans _
[GOAL]
case e_f.h.refine'_1
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : DecidableEq m
v : m → α
i j : m
_hj : j ∈ Finset.univ
hij : j ≠ i
⊢ ‖diagonal v i j‖₊ = 0
[PROOFSTEP]
rw [diagonal_apply_ne' _ hij, nnnorm_zero]
[GOAL]
case e_f.h.refine'_2
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : DecidableEq m
v : m → α
i : m
⊢ ‖diagonal v i i‖₊ = ‖v i‖₊
[PROOFSTEP]
rw [diagonal_apply_eq]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊
[PROOFSTEP]
simp_rw [linfty_op_nnnorm_def, Matrix.mul_apply]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ (Finset.sup Finset.univ fun i => ∑ x : n, ‖∑ j : m, A i j * B j x‖₊) ≤
    (Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊) * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
calc
  (Finset.univ.sup fun i => ∑ k, ‖∑ j, A i j * B j k‖₊) ≤ Finset.univ.sup fun i => ∑ k, ∑ j, ‖A i j‖₊ * ‖B j k‖₊ :=
    Finset.sup_mono_fun fun i _hi => Finset.sum_le_sum fun k _hk => nnnorm_sum_le_of_le _ fun j _hj => nnnorm_mul_le _ _
  _ = Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * ∑ k, ‖B j k‖₊ := by simp_rw [@Finset.sum_comm _ m n, Finset.mul_sum]
  _ ≤ Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ :=
    by
    refine Finset.sup_mono_fun fun i _hi => ?_
    gcongr with j hj
    exact Finset.le_sup (f := fun i ↦ ∑ k : n, ‖B i k‖₊) hj
  _ ≤ (Finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ :=
    by
    simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
    rfl
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ (Finset.sup Finset.univ fun i => ∑ k : n, ∑ j : m, ‖A i j‖₊ * ‖B j k‖₊) =
    Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊ * ∑ k : n, ‖B j k‖₊
[PROOFSTEP]
simp_rw [@Finset.sum_comm _ m n, Finset.mul_sum]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ (Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊ * ∑ k : n, ‖B j k‖₊) ≤
    Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊ * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
refine Finset.sup_mono_fun fun i _hi => ?_
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
i : l
_hi : i ∈ Finset.univ
⊢ ∑ j : m, ‖A i j‖₊ * ∑ k : n, ‖B j k‖₊ ≤ ∑ j : m, ‖A i j‖₊ * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
gcongr with j hj
[GOAL]
case h.bc
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
i : l
_hi : i ∈ Finset.univ
j : m
hj : j ∈ Finset.univ
⊢ ∑ k : n, ‖B j k‖₊ ≤ Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
exact Finset.le_sup (f := fun i ↦ ∑ k : n, ‖B i k‖₊) hj
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ (Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊ * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊) ≤
    (Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊) * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
B : Matrix m n α
⊢ ((Finset.sup Finset.univ fun a => ∑ x : m, ‖A a x‖₊) * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊) ≤
    (Finset.sup Finset.univ fun i => ∑ j : m, ‖A i j‖₊) * Finset.sup Finset.univ fun i => ∑ j : n, ‖B i j‖₊
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
v : m → α
⊢ ‖mulVec A v‖₊ ≤ ‖A‖₊ * ‖v‖₊
[PROOFSTEP]
rw [← linfty_op_nnnorm_col (A.mulVec v), ← linfty_op_nnnorm_col v]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NonUnitalSeminormedRing α
A : Matrix l m α
v : m → α
⊢ ‖col (mulVec A v)‖₊ ≤ ‖A‖₊ * ‖col v‖₊
[PROOFSTEP]
exact linfty_op_nnnorm_mul A (col v)
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : NormedAddCommGroup α
⊢ NormedAddCommGroup (PiLp 2 fun i => PiLp 2 fun j => α)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : NormedField R
inst✝¹ : SeminormedAddCommGroup α
inst✝ : NormedSpace R α
⊢ NormedSpace R (PiLp 2 fun i => PiLp 2 fun j => α)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
⊢ ‖A‖₊ = (∑ i : m, ∑ j : n, ‖A i j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
change ‖(PiLp.equiv 2 _).symm <| fun i => (PiLp.equiv 2 _).symm <| fun j => A i j‖₊ = _
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
⊢ ‖↑(PiLp.equiv 2 fun i => (fun x => PiLp 2 fun j => α) fun j => A i j).symm fun i =>
        ↑(PiLp.equiv 2 fun j => α).symm fun j => A i j‖₊ =
    (∑ i : m, ∑ j : n, ‖A i j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two, PiLp.equiv_symm_apply]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
⊢ ↑((∑ i : m, ∑ j : n, ‖A i j‖₊ ^ 2) ^ (1 / 2)) = (∑ i : m, ∑ j : n, ‖A i j‖ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp [NNReal.coe_sum]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
f : α → β
hf : ∀ (a : α), ‖f a‖₊ = ‖a‖₊
⊢ ‖map A f‖₊ = ‖A‖₊
[PROOFSTEP]
simp_rw [frobenius_nnnorm_def, Matrix.map_apply, hf]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
⊢ ‖Aᵀ‖₊ = ‖A‖₊
[PROOFSTEP]
rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
A : Matrix m n α
⊢ (∑ y : m, ∑ x : n, ‖Aᵀ x y‖₊ ^ 2) ^ (1 / 2) = (∑ i : m, ∑ j : n, ‖A i j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp_rw [Matrix.transpose_apply]
  -- porting note: added
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : m → α
⊢ ‖row v‖ = ‖↑(PiLp.equiv 2 fun i => α).symm v‖
[PROOFSTEP]
rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : m → α
⊢ (∑ j : m, ‖row v default j‖ ^ 2) ^ (1 / 2) = (∑ i : m, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp only [row_apply, Real.rpow_two, PiLp.equiv_symm_apply]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : n → α
⊢ ‖col v‖ = ‖↑(PiLp.equiv 2 fun i => α).symm v‖
[PROOFSTEP]
simp_rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : Fintype l
inst✝³ : Fintype m
inst✝² : Fintype n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : SeminormedAddCommGroup β
v : n → α
⊢ (∑ x : n, ‖col v x default‖ ^ 2) ^ (1 / 2) = (∑ i : n, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp only [col_apply, Real.rpow_two, PiLp.equiv_symm_apply]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
⊢ ‖diagonal v‖₊ = ‖↑(PiLp.equiv 2 fun i => α).symm v‖₊
[PROOFSTEP]
simp_rw [frobenius_nnnorm_def, ← Finset.sum_product', Finset.univ_product_univ, PiLp.nnnorm_eq_of_L2]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
⊢ (∑ x : n × n, ‖diagonal v x.fst x.snd‖₊ ^ 2) ^ (1 / 2) =
    ↑NNReal.sqrt (∑ i : n, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖₊ ^ 2)
[PROOFSTEP]
let s := (Finset.univ : Finset n).map ⟨fun i : n => (i, i), fun i j h => congr_arg Prod.fst h⟩
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
⊢ (∑ x : n × n, ‖diagonal v x.fst x.snd‖₊ ^ 2) ^ (1 / 2) =
    ↑NNReal.sqrt (∑ i : n, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖₊ ^ 2)
[PROOFSTEP]
rw [← Finset.sum_subset (Finset.subset_univ s) fun i _hi his => ?_]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
⊢ (∑ x in s, ‖diagonal v x.fst x.snd‖₊ ^ 2) ^ (1 / 2) =
    ↑NNReal.sqrt (∑ i : n, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖₊ ^ 2)
[PROOFSTEP]
rw [Finset.sum_map, NNReal.sqrt_eq_rpow]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
⊢ (∑ x : n,
        ‖diagonal v
              (↑{ toFun := fun i => (i, i),
                      inj' :=
                        (_ :
                          ∀ (i j : n),
                            (fun i => (i, i)) i = (fun i => (i, i)) j →
                              ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
                  x).fst
              (↑{ toFun := fun i => (i, i),
                      inj' :=
                        (_ :
                          ∀ (i j : n),
                            (fun i => (i, i)) i = (fun i => (i, i)) j →
                              ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
                  x).snd‖₊ ^
          2) ^
      (1 / 2) =
    (∑ i : n, ‖↑(PiLp.equiv 2 fun i => α).symm v i‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
dsimp
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
⊢ (∑ x : n, ‖diagonal v x x‖₊ ^ 2) ^ (1 / 2) = (∑ i : n, ‖v i‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simp_rw [diagonal_apply_eq, NNReal.rpow_two]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
i : n × n
_hi : i ∈ Finset.univ
his : ¬i ∈ s
⊢ ‖diagonal v i.fst i.snd‖₊ ^ 2 = 0
[PROOFSTEP]
suffices i.1 ≠ i.2 by rw [diagonal_apply_ne _ this, nnnorm_zero, NNReal.zero_rpow two_ne_zero]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
i : n × n
_hi : i ∈ Finset.univ
his : ¬i ∈ s
this : i.fst ≠ i.snd
⊢ ‖diagonal v i.fst i.snd‖₊ ^ 2 = 0
[PROOFSTEP]
rw [diagonal_apply_ne _ this, nnnorm_zero, NNReal.zero_rpow two_ne_zero]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
i : n × n
_hi : i ∈ Finset.univ
his : ¬i ∈ s
⊢ i.fst ≠ i.snd
[PROOFSTEP]
intro h
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : SeminormedAddCommGroup α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : DecidableEq n
v : n → α
s : Finset (n × n) :=
  Finset.map
    { toFun := fun i => (i, i),
      inj' :=
        (_ :
          ∀ (i j : n),
            (fun i => (i, i)) i = (fun i => (i, i)) j → ((fun i => (i, i)) i).fst = ((fun i => (i, i)) j).fst) }
    Finset.univ
i : n × n
_hi : i ∈ Finset.univ
his : ¬i ∈ s
h : i.fst = i.snd
⊢ False
[PROOFSTEP]
exact Finset.mem_map.not.mp his ⟨i.1, Finset.mem_univ _, Prod.ext rfl h⟩
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : One α
⊢ ‖1‖₊ = ↑NNReal.sqrt ↑(Fintype.card n) * ‖1‖₊
[PROOFSTEP]
refine'
  (frobenius_nnnorm_diagonal _).trans
    _
      -- porting note: change to erw, since `fun x => 1` no longer matches `Function.const`
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : One α
⊢ ‖↑(PiLp.equiv 2 fun i => α).symm fun x => 1‖₊ = ↑NNReal.sqrt ↑(Fintype.card n) * ‖1‖₊
[PROOFSTEP]
erw [PiLp.nnnorm_equiv_symm_const ENNReal.two_ne_top]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : One α
⊢ ↑(Fintype.card n) ^ ENNReal.toReal (1 / 2) * ‖1‖₊ = ↑NNReal.sqrt ↑(Fintype.card n) * ‖1‖₊
[PROOFSTEP]
simp_rw [NNReal.sqrt_eq_rpow]
  -- porting note: added `ENNReal.toReal_ofNat`
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝⁵ : Fintype l
inst✝⁴ : Fintype m
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : SeminormedAddCommGroup α
inst✝ : One α
⊢ ↑(Fintype.card n) ^ ENNReal.toReal (1 / 2) * ‖1‖₊ = ↑(Fintype.card n) ^ (1 / 2) * ‖1‖₊
[PROOFSTEP]
simp only [ENNReal.toReal_div, ENNReal.one_toReal, ENNReal.toReal_ofNat]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
⊢ ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊
[PROOFSTEP]
simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
⊢ (∑ x : l, ∑ x_1 : n, ‖∑ j : m, A x j * B j x_1‖₊ ^ 2) ^ (1 / 2) ≤
    (∑ i : l, ∑ j : m, ‖A i j‖₊ ^ 2) ^ (1 / 2) * (∑ i : m, ∑ j : n, ‖B i j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum, Finset.sum_product]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
⊢ (∑ x : l, ∑ x_1 : n, ‖∑ j : m, A x j * B j x_1‖₊ ^ 2) ^ (1 / 2) ≤
    (∑ x : l, ∑ y : n, (∑ j : m, ‖A (x, y).fst j‖₊ ^ 2) * ∑ x_1 : m, ‖B x_1 (x, y).snd‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
refine' NNReal.rpow_le_rpow _ one_half_pos.le
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
⊢ ∑ x : l, ∑ x_1 : n, ‖∑ j : m, A x j * B j x_1‖₊ ^ 2 ≤
    ∑ x : l, ∑ y : n, (∑ j : m, ‖A (x, y).fst j‖₊ ^ 2) * ∑ x_1 : m, ‖B x_1 (x, y).snd‖₊ ^ 2
[PROOFSTEP]
refine' Finset.sum_le_sum fun i _ => Finset.sum_le_sum fun j _ => _
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
i : l
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
⊢ ‖∑ j_1 : m, A i j_1 * B j_1 j‖₊ ^ 2 ≤ (∑ j_1 : m, ‖A (i, j).fst j_1‖₊ ^ 2) * ∑ x : m, ‖B x (i, j).snd‖₊ ^ 2
[PROOFSTEP]
rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul, mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one,
  NNReal.mul_rpow]
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
i : l
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
⊢ ‖∑ j_1 : m, A i j_1 * B j_1 j‖₊ ≤
    (∑ j_1 : m, ‖A (i, j).fst j_1‖₊ ^ 2) ^ (1 / 2) * (∑ x : m, ‖B x (i, j).snd‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
dsimp only
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
i : l
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
⊢ ‖∑ j_1 : m, A i j_1 * B j_1 j‖₊ ≤ (∑ j : m, ‖A i j‖₊ ^ 2) ^ (1 / 2) * (∑ x : m, ‖B x j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
have :=
  @nnnorm_inner_le_nnnorm α _ _ _ _ ((PiLp.equiv 2 fun _ => α).symm fun j => star (A i j))
    ((PiLp.equiv 2 fun _ => α).symm fun k => B k j)
[GOAL]
R : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type u_5
β : Type u_6
inst✝³ : Fintype l
inst✝² : Fintype m
inst✝¹ : Fintype n
inst✝ : IsROrC α
A : Matrix l m α
B : Matrix m n α
i : l
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
this :
  ‖inner (↑(PiLp.equiv 2 fun x => α).symm fun j => star (A i j)) (↑(PiLp.equiv 2 fun x => α).symm fun k => B k j)‖₊ ≤
    ‖↑(PiLp.equiv 2 fun x => α).symm fun j => star (A i j)‖₊ * ‖↑(PiLp.equiv 2 fun x => α).symm fun k => B k j‖₊
⊢ ‖∑ j_1 : m, A i j_1 * B j_1 j‖₊ ≤ (∑ j : m, ‖A i j‖₊ ^ 2) ^ (1 / 2) * (∑ x : m, ‖B x j‖₊ ^ 2) ^ (1 / 2)
[PROOFSTEP]
simpa only [PiLp.equiv_symm_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply, Pi.nnnorm_def,
  PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow, NNReal.rpow_two] using this


[GOAL]
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
⊢ ↑F ⊆ S → ⋂₀ ↑F ∈ S
[PROOFSTEP]
classical
refine' Finset.induction_on F (fun _ => _) _
· simp [cond.univ_mem]
· intro a s _ h1 h2
  suffices a ∩ ⋂₀ ↑s ∈ S by simpa
  exact cond.inter_mem (h2 (Finset.mem_insert_self a s)) (h1 fun x hx => h2 <| Finset.mem_insert_of_mem hx)
[GOAL]
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
⊢ ↑F ⊆ S → ⋂₀ ↑F ∈ S
[PROOFSTEP]
refine' Finset.induction_on F (fun _ => _) _
[GOAL]
case refine'_1
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
x✝ : ↑∅ ⊆ S
⊢ ⋂₀ ↑∅ ∈ S
[PROOFSTEP]
simp [cond.univ_mem]
[GOAL]
case refine'_2
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
⊢ ∀ ⦃a : Set α⦄ {s : Finset (Set α)}, ¬a ∈ s → (↑s ⊆ S → ⋂₀ ↑s ∈ S) → ↑(insert a s) ⊆ S → ⋂₀ ↑(insert a s) ∈ S
[PROOFSTEP]
intro a s _ h1 h2
[GOAL]
case refine'_2
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
a : Set α
s : Finset (Set α)
a✝ : ¬a ∈ s
h1 : ↑s ⊆ S → ⋂₀ ↑s ∈ S
h2 : ↑(insert a s) ⊆ S
⊢ ⋂₀ ↑(insert a s) ∈ S
[PROOFSTEP]
suffices a ∩ ⋂₀ ↑s ∈ S by simpa
[GOAL]
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
a : Set α
s : Finset (Set α)
a✝ : ¬a ∈ s
h1 : ↑s ⊆ S → ⋂₀ ↑s ∈ S
h2 : ↑(insert a s) ⊆ S
this : a ∩ ⋂₀ ↑s ∈ S
⊢ ⋂₀ ↑(insert a s) ∈ S
[PROOFSTEP]
simpa
[GOAL]
case refine'_2
α : Type u_1
S : Set (Set α)
cond : FiniteInter S
F : Finset (Set α)
a : Set α
s : Finset (Set α)
a✝ : ¬a ∈ s
h1 : ↑s ⊆ S → ⋂₀ ↑s ∈ S
h2 : ↑(insert a s) ⊆ S
⊢ a ∩ ⋂₀ ↑s ∈ S
[PROOFSTEP]
exact cond.inter_mem (h2 (Finset.mem_insert_self a s)) (h1 fun x hx => h2 <| Finset.mem_insert_of_mem hx)
[GOAL]
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P : Set α
H : P ∈ finiteInterClosure (insert A S)
⊢ P ∈ S ∨ ∃ Q, Q ∈ S ∧ P = A ∩ Q
[PROOFSTEP]
induction' H with S h T1 T2 _ _ h1 h2
[GOAL]
case basic
α : Type u_1
S✝ : Set (Set α)
A : Set α
cond : FiniteInter S✝
P S : Set α
h : S ∈ insert A S✝
⊢ S ∈ S✝ ∨ ∃ Q, Q ∈ S✝ ∧ S = A ∩ Q
[PROOFSTEP]
cases h
[GOAL]
case basic.inl
α : Type u_1
S✝ : Set (Set α)
A : Set α
cond : FiniteInter S✝
P S : Set α
h✝ : S = A
⊢ S ∈ S✝ ∨ ∃ Q, Q ∈ S✝ ∧ S = A ∩ Q
[PROOFSTEP]
exact Or.inr ⟨Set.univ, cond.univ_mem, by simpa⟩
[GOAL]
α : Type u_1
S✝ : Set (Set α)
A : Set α
cond : FiniteInter S✝
P S : Set α
h✝ : S = A
⊢ S = A ∩ Set.univ
[PROOFSTEP]
simpa
[GOAL]
case basic.inr
α : Type u_1
S✝ : Set (Set α)
A : Set α
cond : FiniteInter S✝
P S : Set α
h✝ : S ∈ S✝
⊢ S ∈ S✝ ∨ ∃ Q, Q ∈ S✝ ∧ S = A ∩ Q
[PROOFSTEP]
exact Or.inl (by assumption)
[GOAL]
α : Type u_1
S✝ : Set (Set α)
A : Set α
cond : FiniteInter S✝
P S : Set α
h✝ : S ∈ S✝
⊢ S ∈ S✝
[PROOFSTEP]
assumption
[GOAL]
case univ
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P : Set α
⊢ Set.univ ∈ S ∨ ∃ Q, Q ∈ S ∧ Set.univ = A ∩ Q
[PROOFSTEP]
exact Or.inl cond.univ_mem
[GOAL]
case inter
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T1 T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T1
a✝ : finiteInterClosure (insert A S) T2
h1 : T1 ∈ S ∨ ∃ Q, Q ∈ S ∧ T1 = A ∩ Q
h2 : T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T2 = A ∩ Q
⊢ T1 ∩ T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T1 ∩ T2 = A ∩ Q
[PROOFSTEP]
rcases h1 with (h | ⟨Q, hQ, rfl⟩)
[GOAL]
case inter.inl
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T1 T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T1
a✝ : finiteInterClosure (insert A S) T2
h2 : T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T2 = A ∩ Q
h : T1 ∈ S
⊢ T1 ∩ T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T1 ∩ T2 = A ∩ Q
[PROOFSTEP]
rcases h2 with (i | ⟨R, hR, rfl⟩)
[GOAL]
case inter.inr.intro.intro
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T2
h2 : T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T2 = A ∩ Q
Q : Set α
hQ : Q ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ Q)
⊢ A ∩ Q ∩ T2 ∈ S ∨ ∃ Q_1, Q_1 ∈ S ∧ A ∩ Q ∩ T2 = A ∩ Q_1
[PROOFSTEP]
rcases h2 with (i | ⟨R, hR, rfl⟩)
[GOAL]
case inter.inl.inl
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T1 T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T1
a✝ : finiteInterClosure (insert A S) T2
h : T1 ∈ S
i : T2 ∈ S
⊢ T1 ∩ T2 ∈ S ∨ ∃ Q, Q ∈ S ∧ T1 ∩ T2 = A ∩ Q
[PROOFSTEP]
exact Or.inl (cond.inter_mem h i)
[GOAL]
case inter.inl.inr.intro.intro
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T1 : Set α
a✝¹ : finiteInterClosure (insert A S) T1
h : T1 ∈ S
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
⊢ T1 ∩ (A ∩ R) ∈ S ∨ ∃ Q, Q ∈ S ∧ T1 ∩ (A ∩ R) = A ∩ Q
[PROOFSTEP]
exact Or.inr ⟨T1 ∩ R, cond.inter_mem h hR, by simp only [← Set.inter_assoc, Set.inter_comm _ A]⟩
[GOAL]
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T1 : Set α
a✝¹ : finiteInterClosure (insert A S) T1
h : T1 ∈ S
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
⊢ T1 ∩ (A ∩ R) = A ∩ (T1 ∩ R)
[PROOFSTEP]
simp only [← Set.inter_assoc, Set.inter_comm _ A]
[GOAL]
case inter.inr.intro.intro.inl
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T2
Q : Set α
hQ : Q ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ Q)
i : T2 ∈ S
⊢ A ∩ Q ∩ T2 ∈ S ∨ ∃ Q_1, Q_1 ∈ S ∧ A ∩ Q ∩ T2 = A ∩ Q_1
[PROOFSTEP]
exact Or.inr ⟨Q ∩ T2, cond.inter_mem hQ i, by simp only [Set.inter_assoc]⟩
[GOAL]
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P T2 : Set α
a✝¹ : finiteInterClosure (insert A S) T2
Q : Set α
hQ : Q ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ Q)
i : T2 ∈ S
⊢ A ∩ Q ∩ T2 = A ∩ (Q ∩ T2)
[PROOFSTEP]
simp only [Set.inter_assoc]
[GOAL]
case inter.inr.intro.intro.inr.intro.intro
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P Q : Set α
hQ : Q ∈ S
a✝¹ : finiteInterClosure (insert A S) (A ∩ Q)
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
⊢ A ∩ Q ∩ (A ∩ R) ∈ S ∨ ∃ Q_1, Q_1 ∈ S ∧ A ∩ Q ∩ (A ∩ R) = A ∩ Q_1
[PROOFSTEP]
exact
  Or.inr
    ⟨Q ∩ R, cond.inter_mem hQ hR, by
      ext x
      constructor <;> simp (config := { contextual := true })⟩
[GOAL]
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P Q : Set α
hQ : Q ∈ S
a✝¹ : finiteInterClosure (insert A S) (A ∩ Q)
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
⊢ A ∩ Q ∩ (A ∩ R) = A ∩ (Q ∩ R)
[PROOFSTEP]
ext x
[GOAL]
case h
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P Q : Set α
hQ : Q ∈ S
a✝¹ : finiteInterClosure (insert A S) (A ∩ Q)
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
x : α
⊢ x ∈ A ∩ Q ∩ (A ∩ R) ↔ x ∈ A ∩ (Q ∩ R)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P Q : Set α
hQ : Q ∈ S
a✝¹ : finiteInterClosure (insert A S) (A ∩ Q)
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
x : α
⊢ x ∈ A ∩ Q ∩ (A ∩ R) → x ∈ A ∩ (Q ∩ R)
[PROOFSTEP]
simp (config := { contextual := true })
[GOAL]
case h.mpr
α : Type u_1
S : Set (Set α)
A : Set α
cond : FiniteInter S
P Q : Set α
hQ : Q ∈ S
a✝¹ : finiteInterClosure (insert A S) (A ∩ Q)
R : Set α
hR : R ∈ S
a✝ : finiteInterClosure (insert A S) (A ∩ R)
x : α
⊢ x ∈ A ∩ (Q ∩ R) → x ∈ A ∩ Q ∩ (A ∩ R)
[PROOFSTEP]
simp (config := { contextual := true })


[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
⊢ g • s = s
[PROOFSTEP]
suffices ∀ {g' : G} (_ : g' ^ n ^ j = 1), g' • s ⊆ s
  by
  refine' le_antisymm (this hg) _
  conv_lhs => rw [← smul_inv_smul g s]
  replace hg : g⁻¹ ^ n ^ j = 1
  · rw [inv_zpow, hg, inv_one]
  simpa only [le_eq_subset, set_smul_subset_set_smul_iff] using this hg
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
⊢ g • s = s
[PROOFSTEP]
refine' le_antisymm (this hg) _
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
⊢ s ≤ g • s
[PROOFSTEP]
conv_lhs => rw [← smul_inv_smul g s]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
| s
[PROOFSTEP]
rw [← smul_inv_smul g s]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
| s
[PROOFSTEP]
rw [← smul_inv_smul g s]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
| s
[PROOFSTEP]
rw [← smul_inv_smul g s]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
⊢ g • g⁻¹ • s ≤ g • s
[PROOFSTEP]
replace hg : g⁻¹ ^ n ^ j = 1
[GOAL]
case hg
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
⊢ g⁻¹ ^ n ^ j = 1
[PROOFSTEP]
rw [inv_zpow, hg, inv_one]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
this : ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
hg : g⁻¹ ^ n ^ j = 1
⊢ g • g⁻¹ • s ≤ g • s
[PROOFSTEP]
simpa only [le_eq_subset, set_smul_subset_set_smul_iff] using this hg
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
⊢ ∀ {g' : G}, g' ^ n ^ j = 1 → g' • s ⊆ s
[PROOFSTEP]
rw [(IsFixedPt.preimage_iterate hs j : (zpowGroupHom n)^[j] ⁻¹' s = s).symm]
[GOAL]
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
⊢ ∀ {g' : G}, g' ^ n ^ j = 1 → g' • (fun x => x ^ n)^[j] ⁻¹' s ⊆ (fun x => x ^ n)^[j] ⁻¹' s
[PROOFSTEP]
rintro g' hg' - ⟨y, hy, rfl⟩
[GOAL]
case intro.intro
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
g' : G
hg' : g' ^ n ^ j = 1
y : G
hy : y ∈ (fun x => x ^ n)^[j] ⁻¹' s
⊢ (fun x => g' • x) y ∈ (fun x => x ^ n)^[j] ⁻¹' s
[PROOFSTEP]
change (zpowGroupHom n)^[j] (g' * y) ∈ s
[GOAL]
case intro.intro
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
g' : G
hg' : g' ^ n ^ j = 1
y : G
hy : y ∈ (fun x => x ^ n)^[j] ⁻¹' s
⊢ (↑(zpowGroupHom n))^[j] (g' * y) ∈ s
[PROOFSTEP]
replace hg' : (zpowGroupHom n)^[j] g' = 1
[GOAL]
case hg'
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
g' : G
hg' : g' ^ n ^ j = 1
y : G
hy : y ∈ (fun x => x ^ n)^[j] ⁻¹' s
⊢ (↑(zpowGroupHom n))^[j] g' = 1
[PROOFSTEP]
simpa [zpowGroupHom]
[GOAL]
case intro.intro
G : Type u_1
inst✝ : CommGroup G
n : ℤ
s : Set G
hs : (fun x => x ^ n) ⁻¹' s = s
g : G
j : ℕ
hg : g ^ n ^ j = 1
g' y : G
hy : y ∈ (fun x => x ^ n)^[j] ⁻¹' s
hg' : (↑(zpowGroupHom n))^[j] g' = 1
⊢ (↑(zpowGroupHom n))^[j] (g' * y) ∈ s
[PROOFSTEP]
rwa [iterate_map_mul, hg', one_mul]