analysis.inner_product_space.of_norm ⟷ Mathlib.Analysis.InnerProductSpace.OfNorm

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -296,7 +296,7 @@ private theorem int_prop (n : β„€) : InnerProp E (n : π•œ) :=
   by
   intro x y
   rw [← n.sign_mul_nat_abs]
-  simp only [Int.cast_ofNat, map_natCast, map_intCast, Int.cast_mul, map_mul, mul_smul]
+  simp only [Int.cast_natCast, map_natCast, map_intCast, Int.cast_mul, map_mul, mul_smul]
   obtain hn | rfl | hn := lt_trichotomy n 0
   Β· rw [Int.sign_eq_neg_one_of_neg hn, inner_prop_neg_one ((n.nat_abs : π•œ) β€’ x), Nat]
     simp only [map_neg, neg_mul, one_mul, mul_eq_mul_left_iff, true_or_iff, Int.natAbs_eq_zero,
Diff
@@ -56,11 +56,11 @@ inner product space, Hilbert space, norm
 -/
 
 
-open IsROrC
+open RCLike
 
 open scoped ComplexConjugate
 
-variable {π•œ : Type _} [IsROrC π•œ] (E : Type _) [NormedAddCommGroup E]
+variable {π•œ : Type _} [RCLike π•œ] (E : Type _) [NormedAddCommGroup E]
 
 #print InnerProductSpaceable /-
 /-- Predicate for the parallelogram identity to hold in a normed group. This is a scalar-less
@@ -144,9 +144,9 @@ theorem inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
   have h₁ : norm_sq (4 : π•œ) = 16 :=
     by
     have : ((4 : ℝ) : π•œ) = (4 : π•œ) := by simp only [of_real_one, of_real_bit0]
-    rw [← this, norm_sq_eq_def', IsROrC.norm_of_nonneg (by norm_num : (0 : ℝ) ≀ 4)]
+    rw [← this, norm_sq_eq_def', RCLike.norm_of_nonneg (by norm_num : (0 : ℝ) ≀ 4)]
     norm_num
-  have hβ‚‚ : β€–x + xβ€– = 2 * β€–xβ€– := by rw [← two_smul π•œ, norm_smul, IsROrC.norm_two]
+  have hβ‚‚ : β€–x + xβ€– = 2 * β€–xβ€– := by rw [← two_smul π•œ, norm_smul, RCLike.norm_two]
   simp only [inner, h₁, hβ‚‚, one_im, bit0_zero, add_zero, norm_zero, I_re, of_real_im, map_add,
     bit0_im, zero_div, MulZeroClass.zero_mul, AddMonoidHom.map_neg, of_real_re, map_sub, sub_zero,
     inv_re, one_re, inv_im, bit0_re, mul_re, MulZeroClass.mul_zero, sub_self, neg_zero,
@@ -160,7 +160,7 @@ theorem inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
   by
   simp only [inner_]
   have h4 : conj (4⁻¹ : π•œ) = 4⁻¹ := by
-    rw [IsROrC.conj_inv, ← of_real_one, ← of_real_bit0, ← of_real_bit0, conj_of_real]
+    rw [RCLike.conj_inv, ← of_real_one, ← of_real_bit0, ← of_real_bit0, conj_of_real]
   rw [map_mul, h4]
   congr 1
   simp only [map_sub, map_add, algebra_map_eq_of_real, ← of_real_mul, conj_of_real, map_mul, conj_I]
@@ -314,11 +314,11 @@ private theorem rat_prop (r : β„š) : InnerProp E (r : π•œ) :=
   intro x y
   have : (r.denom : π•œ) β‰  0 :=
     by
-    haveI : CharZero π•œ := IsROrC.charZero_isROrC
+    haveI : CharZero π•œ := RCLike.charZero_rclike
     exact_mod_cast r.pos.ne'
   rw [← r.num_div_denom, ← mul_right_inj' this, ← Nat r.denom _ y, smul_smul, Rat.cast_div]
-  simp only [map_natCast, Rat.cast_coe_nat, map_intCast, Rat.cast_coe_int, map_divβ‚€]
-  rw [← mul_assoc, mul_div_cancel' _ this, int_prop _ x, map_intCast]
+  simp only [map_natCast, Rat.cast_natCast, map_intCast, Rat.cast_intCast, map_divβ‚€]
+  rw [← mul_assoc, mul_div_cancelβ‚€ _ this, int_prop _ x, map_intCast]
 
 private theorem real_prop (r : ℝ) : InnerProp E (r : π•œ) :=
   by
@@ -328,7 +328,7 @@ private theorem real_prop (r : ℝ) : InnerProp E (r : π•œ) :=
   refine' rat.dense_embedding_coe_real.dense.equalizer _ _ (funext fun X => _)
   Β· exact (continuous_of_real.smul continuous_const).inner_ continuous_const
   Β· exact (continuous_conj.comp continuous_of_real).mul continuous_const
-  Β· simp only [Function.comp_apply, IsROrC.ofReal_ratCast, rat_prop _ _]
+  Β· simp only [Function.comp_apply, RCLike.ofReal_ratCast, rat_prop _ _]
 
 private theorem I_prop : InnerProp E (i : π•œ) :=
   by
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2020 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth
 -/
-import Mathbin.Topology.Algebra.Algebra
-import Mathbin.Analysis.InnerProductSpace.Basic
+import Topology.Algebra.Algebra
+import Analysis.InnerProductSpace.Basic
 
 #align_import analysis.inner_product_space.of_norm from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
 
Diff
@@ -137,8 +137,8 @@ theorem Continuous.inner_ {f g : ℝ β†’ E} (hf : Continuous f) (hg : Continuous
 #align inner_product_spaceable.continuous.inner_ Continuous.inner_
 -/
 
-#print InnerProductSpaceable.Inner_.norm_sq /-
-theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
+#print InnerProductSpaceable.inner_.norm_sq /-
+theorem inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
   by
   simp only [inner_]
   have h₁ : norm_sq (4 : π•œ) = 16 :=
@@ -152,11 +152,11 @@ theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
     inv_re, one_re, inv_im, bit0_re, mul_re, MulZeroClass.mul_zero, sub_self, neg_zero,
     algebra_map_eq_of_real]
   ring
-#align inner_product_spaceable.inner_.norm_sq InnerProductSpaceable.Inner_.norm_sq
+#align inner_product_spaceable.inner_.norm_sq InnerProductSpaceable.inner_.norm_sq
 -/
 
-#print InnerProductSpaceable.Inner_.conj_symm /-
-theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
+#print InnerProductSpaceable.inner_.conj_symm /-
+theorem inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
   by
   simp only [inner_]
   have h4 : conj (4⁻¹ : π•œ) = 4⁻¹ := by
@@ -179,7 +179,7 @@ theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
     Β· rw [smul_add, smul_smul, I_mul_I_of_nonzero hI, neg_one_smul, ← neg_add_eq_sub]
   rw [h₁, hβ‚‚, ← sub_add_eq_add_sub]
   simp only [neg_mul, sub_eq_add_neg, neg_neg]
-#align inner_product_spaceable.inner_.conj_symm InnerProductSpaceable.Inner_.conj_symm
+#align inner_product_spaceable.inner_.conj_symm InnerProductSpaceable.inner_.conj_symm
 -/
 
 variable [InnerProductSpaceable E]
@@ -385,8 +385,8 @@ parallelogram identity can be given a compatible inner product. Do
 `inner_product_space π•œ E`. -/
 theorem nonempty_innerProductSpace : Nonempty (InnerProductSpace π•œ E) :=
   ⟨{  inner := inner_ π•œ
-      norm_sq_eq_inner := Inner_.norm_sq
-      conj_symm := Inner_.conj_symm
+      norm_sq_eq_inner := inner_.norm_sq
+      conj_symm := inner_.conj_symm
       add_left := add_left
       smul_left := fun _ _ _ => innerProp _ _ _ }⟩
 #align nonempty_inner_product_space nonempty_innerProductSpace
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth
-
-! This file was ported from Lean 3 source module analysis.inner_product_space.of_norm
-! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Topology.Algebra.Algebra
 import Mathbin.Analysis.InnerProductSpace.Basic
 
+#align_import analysis.inner_product_space.of_norm from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
+
 /-!
 # Inner product space derived from a norm
 
Diff
@@ -65,6 +65,7 @@ open scoped ComplexConjugate
 
 variable {π•œ : Type _} [IsROrC π•œ] (E : Type _) [NormedAddCommGroup E]
 
+#print InnerProductSpaceable /-
 /-- Predicate for the parallelogram identity to hold in a normed group. This is a scalar-less
 version of `inner_product_space`. If you have an `inner_product_spaceable` assumption, you can
 locally upgrade that to `inner_product_space π•œ E` using `casesI nonempty_inner_product_space π•œ E`.
@@ -73,19 +74,24 @@ class InnerProductSpaceable : Prop where
   parallelogram_identity :
     βˆ€ x y : E, β€–x + yβ€– * β€–x + yβ€– + β€–x - yβ€– * β€–x - yβ€– = 2 * (β€–xβ€– * β€–xβ€– + β€–yβ€– * β€–yβ€–)
 #align inner_product_spaceable InnerProductSpaceable
+-/
 
 variable (π•œ) {E}
 
-theorem InnerProductSpace.to_innerProductSpaceable [InnerProductSpace π•œ E] :
+#print InnerProductSpace.toInnerProductSpaceable /-
+theorem InnerProductSpace.toInnerProductSpaceable [InnerProductSpace π•œ E] :
     InnerProductSpaceable E :=
   ⟨parallelogram_law_with_norm π•œβŸ©
-#align inner_product_space.to_inner_product_spaceable InnerProductSpace.to_innerProductSpaceable
+#align inner_product_space.to_inner_product_spaceable InnerProductSpace.toInnerProductSpaceable
+-/
 
+#print InnerProductSpace.toInnerProductSpaceable_ofReal /-
 -- See note [lower instance priority]
-instance (priority := 100) InnerProductSpace.to_innerProductSpaceable_of_real
+instance (priority := 100) InnerProductSpace.toInnerProductSpaceable_ofReal
     [InnerProductSpace ℝ E] : InnerProductSpaceable E :=
   ⟨parallelogram_law_with_norm β„βŸ©
-#align inner_product_space.to_inner_product_spaceable_of_real InnerProductSpace.to_innerProductSpaceable_of_real
+#align inner_product_space.to_inner_product_spaceable_of_real InnerProductSpace.toInnerProductSpaceable_ofReal
+-/
 
 variable [NormedSpace π•œ E]
 
@@ -102,12 +108,15 @@ namespace InnerProductSpaceable
 
 variable {π•œ} (E)
 
+#print InnerProductSpaceable.innerProp /-
 /-- Auxiliary definition for the `add_left` property -/
 private def innerProp (r : π•œ) : Prop :=
   βˆ€ x y : E, inner_ π•œ (r β€’ x) y = conj r * inner_ π•œ x y
+-/
 
 variable {E}
 
+#print InnerProductSpaceable.innerProp_neg_one /-
 theorem innerProp_neg_one : InnerProp E ((-1 : β„€) : π•œ) :=
   by
   intro x y
@@ -123,11 +132,15 @@ theorem innerProp_neg_one : InnerProp E ((-1 : β„€) : π•œ) :=
   rw [h₁, hβ‚‚, h₃, hβ‚„]
   ring
 #align inner_product_spaceable.inner_prop_neg_one InnerProductSpaceable.innerProp_neg_one
+-/
 
+#print Continuous.inner_ /-
 theorem Continuous.inner_ {f g : ℝ β†’ E} (hf : Continuous f) (hg : Continuous g) :
     Continuous fun x => inner_ π•œ (f x) (g x) := by unfold inner_; continuity
-#align inner_product_spaceable.continuous.inner_ InnerProductSpaceable.Continuous.inner_
+#align inner_product_spaceable.continuous.inner_ Continuous.inner_
+-/
 
+#print InnerProductSpaceable.Inner_.norm_sq /-
 theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
   by
   simp only [inner_]
@@ -143,7 +156,9 @@ theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) :=
     algebra_map_eq_of_real]
   ring
 #align inner_product_spaceable.inner_.norm_sq InnerProductSpaceable.Inner_.norm_sq
+-/
 
+#print InnerProductSpaceable.Inner_.conj_symm /-
 theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
   by
   simp only [inner_]
@@ -168,6 +183,7 @@ theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
   rw [h₁, hβ‚‚, ← sub_add_eq_add_sub]
   simp only [neg_mul, sub_eq_add_neg, neg_neg]
 #align inner_product_spaceable.inner_.conj_symm InnerProductSpaceable.Inner_.conj_symm
+-/
 
 variable [InnerProductSpaceable E]
 
@@ -248,6 +264,7 @@ private theorem add_left_aux8 (y z : E) :
   have hβ‚€ := parallelogram_identity ((I : π•œ) β€’ y - z) z
   convert hβ‚€ using 4 <;> Β· try simp only [two_smul, smul_add]; abel
 
+#print InnerProductSpaceable.add_left /-
 theorem add_left (x y z : E) : inner_ π•œ (x + y) z = inner_ π•œ x z + inner_ π•œ y z :=
   by
   simp only [inner_, ← mul_add]
@@ -261,7 +278,9 @@ theorem add_left (x y z : E) : inner_ π•œ (x + y) z = inner_ π•œ x z + inner_
     simp only [map_sub, map_mul, map_add, div_eq_mul_inv]
     ring
 #align inner_product_spaceable.add_left InnerProductSpaceable.add_left
+-/
 
+#print InnerProductSpaceable.nat /-
 theorem nat (n : β„•) (x y : E) : inner_ π•œ ((n : π•œ) β€’ x) y = (n : π•œ) * inner_ π•œ x y :=
   by
   induction' n with n ih
@@ -271,6 +290,7 @@ theorem nat (n : β„•) (x y : E) : inner_ π•œ ((n : π•œ) β€’ x) y = (n : π•œ)
   Β· simp only [Nat.cast_succ, add_smul, one_smul]
     rw [add_left, ih, add_mul, one_mul]
 #align inner_product_spaceable.nat InnerProductSpaceable.nat
+-/
 
 private theorem nat_prop (r : β„•) : InnerProp E (r : π•œ) := fun x y => by simp only [map_natCast];
   exact Nat r x y
@@ -331,17 +351,20 @@ private theorem I_prop : InnerProp E (i : π•œ) :=
   rw [← neg_mul_eq_neg_mul, ← neg_mul_eq_neg_mul]
   abel
 
+#print InnerProductSpaceable.innerProp /-
 theorem innerProp (r : π•œ) : InnerProp E r := by
   intro x y
   rw [← re_add_im r, add_smul, add_left, real_prop _ x, ← smul_smul, real_prop _ _ y, I_prop,
     map_add, map_mul, conj_of_real, conj_of_real, conj_I]
   ring
 #align inner_product_spaceable.inner_prop InnerProductSpaceable.innerProp
+-/
 
 end InnerProductSpaceable
 
 open InnerProductSpaceable
 
+#print InnerProductSpace.ofNorm /-
 /-- **FrΓ©chet–von Neumann–Jordan Theorem**. A normed space `E` whose norm satisfies the
 parallelogram identity can be given a compatible inner product. -/
 noncomputable def InnerProductSpace.ofNorm
@@ -354,9 +377,11 @@ noncomputable def InnerProductSpace.ofNorm
     add_left
     smul_left := fun _ _ _ => inner_prop _ _ _ }
 #align inner_product_space.of_norm InnerProductSpace.ofNorm
+-/
 
 variable (π•œ E) [InnerProductSpaceable E]
 
+#print nonempty_innerProductSpace /-
 /-- **FrΓ©chet–von Neumann–Jordan Theorem**. A normed space `E` whose norm satisfies the
 parallelogram identity can be given a compatible inner product. Do
 `casesI nonempty_inner_product_space π•œ E` to locally upgrade `inner_product_spaceable E` to
@@ -368,12 +393,15 @@ theorem nonempty_innerProductSpace : Nonempty (InnerProductSpace π•œ E) :=
       add_left := add_left
       smul_left := fun _ _ _ => innerProp _ _ _ }⟩
 #align nonempty_inner_product_space nonempty_innerProductSpace
+-/
 
 variable {π•œ E} [NormedSpace ℝ E]
 
+#print InnerProductSpaceable.to_uniformConvexSpace /-
 -- TODO: Replace `inner_product_space.to_uniform_convex_space`
 -- See note [lower instance priority]
 instance (priority := 100) InnerProductSpaceable.to_uniformConvexSpace : UniformConvexSpace E := by
   cases nonempty_innerProductSpace ℝ E; infer_instance
 #align inner_product_spaceable.to_uniform_convex_space InnerProductSpaceable.to_uniformConvexSpace
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth
 
 ! This file was ported from Lean 3 source module analysis.inner_product_space.of_norm
-! leanprover-community/mathlib commit baa88307f3e699fa7054ef04ec79fa4f056169cb
+! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.InnerProductSpace.Basic
 /-!
 # Inner product space derived from a norm
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines an `inner_product_space` instance from a norm that respects the
 parallellogram identity. The parallelogram identity is a way to express the inner product of `x` and
 `y` in terms of the norms of `x`, `y`, `x + y`, `x - y`.

Changes in mathlib4

mathlib3
mathlib4
chore(Data/Int/Cast): fix confusion between OfNat and Nat.cast lemmas (#11861)

This renames

  • Int.cast_ofNat to Int.cast_natCast
  • Int.int_cast_ofNat to Int.cast_ofNat

I think the history here is that this lemma was previously about Int.ofNat, before we globally fixed the simp-normal form to be Nat.cast.

Since the Int.cast_ofNat name is repurposed, it can't be deprecated. Int.int_cast_ofNat is such a wonky name that it was probably never used.

Diff
@@ -255,7 +255,7 @@ private theorem nat_prop (r : β„•) : innerProp' E (r : π•œ) := fun x y => by
 private theorem int_prop (n : β„€) : innerProp' E (n : π•œ) := by
   intro x y
   rw [← n.sign_mul_natAbs]
-  simp only [Int.cast_ofNat, map_natCast, map_intCast, Int.cast_mul, map_mul, mul_smul]
+  simp only [Int.cast_natCast, map_natCast, map_intCast, Int.cast_mul, map_mul, mul_smul]
   obtain hn | rfl | hn := lt_trichotomy n 0
   Β· rw [Int.sign_eq_neg_one_of_neg hn, innerProp_neg_one ((n.natAbs : π•œ) β€’ x), nat]
     simp only [map_neg, neg_mul, one_mul, mul_eq_mul_left_iff, true_or_iff, Int.natAbs_eq_zero,
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -53,11 +53,11 @@ inner product space, Hilbert space, norm
 -/
 
 
-open IsROrC
+open RCLike
 
 open scoped ComplexConjugate
 
-variable {π•œ : Type*} [IsROrC π•œ] (E : Type*) [NormedAddCommGroup E]
+variable {π•œ : Type*} [RCLike π•œ] (E : Type*) [NormedAddCommGroup E]
 
 /-- Predicate for the parallelogram identity to hold in a normed group. This is a scalar-less
 version of `InnerProductSpace`. If you have an `InnerProductSpaceable` assumption, you can
@@ -126,11 +126,11 @@ theorem _root_.Continuous.inner_ {f g : ℝ β†’ E} (hf : Continuous f) (hg : Con
 
 theorem inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) := by
   simp only [inner_]
-  have h₁ : IsROrC.normSq (4 : π•œ) = 16 := by
+  have h₁ : RCLike.normSq (4 : π•œ) = 16 := by
     have : ((4 : ℝ) : π•œ) = (4 : π•œ) := by norm_cast
-    rw [← this, normSq_eq_def', IsROrC.norm_of_nonneg (by norm_num : (0 : ℝ) ≀ 4)]
+    rw [← this, normSq_eq_def', RCLike.norm_of_nonneg (by norm_num : (0 : ℝ) ≀ 4)]
     norm_num
-  have hβ‚‚ : β€–x + xβ€– = 2 * β€–xβ€– := by rw [← two_smul π•œ, norm_smul, IsROrC.norm_two]
+  have hβ‚‚ : β€–x + xβ€– = 2 * β€–xβ€– := by rw [← two_smul π•œ, norm_smul, RCLike.norm_two]
   simp only [h₁, hβ‚‚, algebraMap_eq_ofReal, sub_self, norm_zero, mul_re, inv_re, ofNat_re, map_sub,
     map_add, ofReal_re, ofNat_im, ofReal_im, mul_im, I_re, inv_im]
   ring
@@ -270,7 +270,7 @@ private theorem int_prop (n : β„€) : innerProp' E (n : π•œ) := by
 private theorem rat_prop (r : β„š) : innerProp' E (r : π•œ) := by
   intro x y
   have : (r.den : π•œ) β‰  0 := by
-    haveI : CharZero π•œ := IsROrC.charZero_isROrC
+    haveI : CharZero π•œ := RCLike.charZero_rclike
     exact mod_cast r.pos.ne'
   rw [← r.num_div_den, ← mul_right_inj' this, ← nat r.den _ y, smul_smul, Rat.cast_div]
   simp only [map_natCast, Rat.cast_natCast, map_intCast, Rat.cast_intCast, map_divβ‚€]
@@ -283,7 +283,7 @@ private theorem real_prop (r : ℝ) : innerProp' E (r : π•œ) := by
   refine' Rat.denseEmbedding_coe_real.dense.equalizer _ _ (funext fun X => _)
   Β· exact (continuous_ofReal.smul continuous_const).inner_ continuous_const
   Β· exact (continuous_conj.comp continuous_ofReal).mul continuous_const
-  Β· simp only [Function.comp_apply, IsROrC.ofReal_ratCast, rat_prop _ _]
+  Β· simp only [Function.comp_apply, RCLike.ofReal_ratCast, rat_prop _ _]
 
 private theorem I_prop : innerProp' E (I : π•œ) := by
   by_cases hI : (I : π•œ) = 0
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -274,7 +274,7 @@ private theorem rat_prop (r : β„š) : innerProp' E (r : π•œ) := by
     exact mod_cast r.pos.ne'
   rw [← r.num_div_den, ← mul_right_inj' this, ← nat r.den _ y, smul_smul, Rat.cast_div]
   simp only [map_natCast, Rat.cast_natCast, map_intCast, Rat.cast_intCast, map_divβ‚€]
-  rw [← mul_assoc, mul_div_cancel' _ this, int_prop _ x, map_intCast]
+  rw [← mul_assoc, mul_div_cancelβ‚€ _ this, int_prop _ x, map_intCast]
 
 private theorem real_prop (r : ℝ) : innerProp' E (r : π•œ) := by
   intro x y
chore: Rename cat_coe_nat/cast_coe_int to cast_natCast/cast_intCast (#11552)

Reduce the diff of #11499

Diff
@@ -273,7 +273,7 @@ private theorem rat_prop (r : β„š) : innerProp' E (r : π•œ) := by
     haveI : CharZero π•œ := IsROrC.charZero_isROrC
     exact mod_cast r.pos.ne'
   rw [← r.num_div_den, ← mul_right_inj' this, ← nat r.den _ y, smul_smul, Rat.cast_div]
-  simp only [map_natCast, Rat.cast_coe_nat, map_intCast, Rat.cast_coe_int, map_divβ‚€]
+  simp only [map_natCast, Rat.cast_natCast, map_intCast, Rat.cast_intCast, map_divβ‚€]
   rw [← mul_assoc, mul_div_cancel' _ this, int_prop _ x, map_intCast]
 
 private theorem real_prop (r : ℝ) : innerProp' E (r : π•œ) := by
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -327,7 +327,6 @@ noncomputable def InnerProductSpace.ofNorm
 #align inner_product_space.of_norm InnerProductSpace.ofNorm
 
 variable (E)
-
 variable [InnerProductSpaceable E]
 
 /-- **FrΓ©chet–von Neumann–Jordan Theorem**. A normed space `E` whose norm satisfies the
@@ -343,7 +342,6 @@ theorem nonempty_innerProductSpace : Nonempty (InnerProductSpace π•œ E) :=
 #align nonempty_inner_product_space nonempty_innerProductSpace
 
 variable {π•œ E}
-
 variable [NormedSpace ℝ E]
 
 -- TODO: Replace `InnerProductSpace.toUniformConvexSpace`
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -271,7 +271,7 @@ private theorem rat_prop (r : β„š) : innerProp' E (r : π•œ) := by
   intro x y
   have : (r.den : π•œ) β‰  0 := by
     haveI : CharZero π•œ := IsROrC.charZero_isROrC
-    exact_mod_cast r.pos.ne'
+    exact mod_cast r.pos.ne'
   rw [← r.num_div_den, ← mul_right_inj' this, ← nat r.den _ y, smul_smul, Rat.cast_div]
   simp only [map_natCast, Rat.cast_coe_nat, map_intCast, Rat.cast_coe_int, map_divβ‚€]
   rw [← mul_assoc, mul_div_cancel' _ this, int_prop _ x, map_intCast]
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -144,7 +144,7 @@ theorem inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
   simp only [map_sub, map_add, algebraMap_eq_ofReal, ← ofReal_mul, conj_ofReal, map_mul, conj_I]
   rw [add_comm y x, norm_sub_rev]
   by_cases hI : (I : π•œ) = 0
-  Β· simp only [hI, neg_zero, MulZeroClass.zero_mul]
+  Β· simp only [hI, neg_zero, zero_mul]
   -- Porting note: this replaces `norm_I_of_ne_zero` which does not exist in Lean 4
   have : β€–(I : π•œ)β€– = 1 := by
     rw [← mul_self_inj_of_nonneg (norm_nonneg I) zero_le_one, one_mul, ← norm_mul,
@@ -243,8 +243,8 @@ theorem add_left (x y z : E) : inner_ π•œ (x + y) z = inner_ π•œ x z + inner_
 
 theorem nat (n : β„•) (x y : E) : inner_ π•œ ((n : π•œ) β€’ x) y = (n : π•œ) * inner_ π•œ x y := by
   induction' n with n ih
-  Β· simp only [inner_, Nat.zero_eq, zero_sub, Nat.cast_zero, MulZeroClass.zero_mul,
-      eq_self_iff_true, zero_smul, zero_add, MulZeroClass.mul_zero, sub_self, norm_neg, smul_zero]
+  Β· simp only [inner_, Nat.zero_eq, zero_sub, Nat.cast_zero, zero_mul,
+      eq_self_iff_true, zero_smul, zero_add, mul_zero, sub_self, norm_neg, smul_zero]
   Β· simp only [Nat.cast_succ, add_smul, one_smul]
     rw [add_left, ih, add_mul, one_mul]
 #align inner_product_spaceable.nat InnerProductSpaceable.nat
@@ -260,8 +260,8 @@ private theorem int_prop (n : β„€) : innerProp' E (n : π•œ) := by
   Β· rw [Int.sign_eq_neg_one_of_neg hn, innerProp_neg_one ((n.natAbs : π•œ) β€’ x), nat]
     simp only [map_neg, neg_mul, one_mul, mul_eq_mul_left_iff, true_or_iff, Int.natAbs_eq_zero,
       eq_self_iff_true, Int.cast_one, map_one, neg_inj, Nat.cast_eq_zero, Int.cast_neg]
-  Β· simp only [inner_, Int.cast_zero, zero_sub, Nat.cast_zero, MulZeroClass.zero_mul,
-      eq_self_iff_true, Int.sign_zero, zero_smul, zero_add, MulZeroClass.mul_zero, smul_zero,
+  Β· simp only [inner_, Int.cast_zero, zero_sub, Nat.cast_zero, zero_mul,
+      eq_self_iff_true, Int.sign_zero, zero_smul, zero_add, mul_zero, smul_zero,
       sub_self, norm_neg, Int.natAbs_zero]
   Β· rw [Int.sign_eq_one_of_pos hn]
     simp only [one_mul, mul_eq_mul_left_iff, true_or_iff, Int.natAbs_eq_zero, eq_self_iff_true,
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -219,14 +219,14 @@ private theorem add_left_aux7 (y z : E) :
     2 * (β€–(I : π•œ) β€’ y + zβ€– * β€–(I : π•œ) β€’ y + zβ€– + β€–zβ€– * β€–zβ€–) - β€–(I : π•œ) β€’ yβ€– * β€–(I : π•œ) β€’ yβ€– := by
   apply eq_sub_of_add_eq
   have hβ‚€ := parallelogram_identity ((I : π•œ) β€’ y + z) z
-  convert hβ‚€ using 4 <;> Β· try simp only [two_smul, smul_add]; abel
+  convert hβ‚€ using 4 <;> Β· (try simp only [two_smul, smul_add]); abel
 
 private theorem add_left_aux8 (y z : E) :
     β€–(I : π•œ) β€’ y - 2 β€’ zβ€– * β€–(I : π•œ) β€’ y - 2 β€’ zβ€– =
     2 * (β€–(I : π•œ) β€’ y - zβ€– * β€–(I : π•œ) β€’ y - zβ€– + β€–zβ€– * β€–zβ€–) - β€–(I : π•œ) β€’ yβ€– * β€–(I : π•œ) β€’ yβ€– := by
   apply eq_sub_of_add_eq'
   have hβ‚€ := parallelogram_identity ((I : π•œ) β€’ y - z) z
-  convert hβ‚€ using 4 <;> Β· try simp only [two_smul, smul_add]; abel
+  convert hβ‚€ using 4 <;> Β· (try simp only [two_smul, smul_add]); abel
 
 theorem add_left (x y z : E) : inner_ π•œ (x + y) z = inner_ π•œ x z + inner_ π•œ y z := by
   simp only [inner_, ← mul_add]
chore: tidy various files (#6393)
Diff
@@ -30,7 +30,7 @@ and use the parallelogram identity
 
 $$β€–x + yβ€–^2 + β€–x - yβ€–^2 = 2 (β€–xβ€–^2 + β€–yβ€–^2)$$
 
-to prove it is an inner product, i.e., that it is conjugate-symmetric (`Inner_.conj_symm`) and
+to prove it is an inner product, i.e., that it is conjugate-symmetric (`inner_.conj_symm`) and
 linear in the first argument. `add_left` is proved by judicious application of the parallelogram
 identity followed by tedious arithmetic. `smul_left` is proved step by step, first noting that
 $\langle Ξ» x, y \rangle = Ξ» \langle x, y \rangle$ for $Ξ» ∈ β„•$, $Ξ» = -1$, hence $Ξ» ∈ β„€$ and $Ξ» ∈ β„š$
@@ -124,7 +124,7 @@ theorem _root_.Continuous.inner_ {f g : ℝ β†’ E} (hf : Continuous f) (hg : Con
   continuity
 #align inner_product_spaceable.continuous.inner_ Continuous.inner_
 
-theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) := by
+theorem inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) := by
   simp only [inner_]
   have h₁ : IsROrC.normSq (4 : π•œ) = 16 := by
     have : ((4 : ℝ) : π•œ) = (4 : π•œ) := by norm_cast
@@ -134,9 +134,9 @@ theorem Inner_.norm_sq (x : E) : β€–xβ€– ^ 2 = re (inner_ π•œ x x) := by
   simp only [h₁, hβ‚‚, algebraMap_eq_ofReal, sub_self, norm_zero, mul_re, inv_re, ofNat_re, map_sub,
     map_add, ofReal_re, ofNat_im, ofReal_im, mul_im, I_re, inv_im]
   ring
-#align inner_product_spaceable.inner_.norm_sq InnerProductSpaceable.Inner_.norm_sq
+#align inner_product_spaceable.inner_.norm_sq InnerProductSpaceable.inner_.norm_sq
 
-theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y := by
+theorem inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y := by
   simp only [inner_]
   have h4 : conj (4⁻¹ : π•œ) = 4⁻¹ := by norm_num
   rw [map_mul, h4]
@@ -159,7 +159,7 @@ theorem Inner_.conj_symm (x y : E) : conj (inner_ π•œ y x) = inner_ π•œ x y :=
     Β· rw [smul_add, smul_smul, I_mul_I_of_nonzero hI, neg_one_smul, ← neg_add_eq_sub]
   rw [h₁, hβ‚‚, ← sub_add_eq_add_sub]
   simp only [neg_mul, sub_eq_add_neg, neg_neg]
-#align inner_product_spaceable.inner_.conj_symm InnerProductSpaceable.Inner_.conj_symm
+#align inner_product_spaceable.inner_.conj_symm InnerProductSpaceable.inner_.conj_symm
 
 variable [InnerProductSpaceable E]
 
@@ -320,8 +320,8 @@ noncomputable def InnerProductSpace.ofNorm
     InnerProductSpace π•œ E :=
   haveI : InnerProductSpaceable E := ⟨h⟩
   { inner := inner_ π•œ
-    norm_sq_eq_inner := Inner_.norm_sq
-    conj_symm := Inner_.conj_symm
+    norm_sq_eq_inner := inner_.norm_sq
+    conj_symm := inner_.conj_symm
     add_left := InnerProductSpaceable.add_left
     smul_left := fun _ _ _ => innerProp _ _ _ }
 #align inner_product_space.of_norm InnerProductSpace.ofNorm
@@ -336,8 +336,8 @@ parallelogram identity can be given a compatible inner product. Do
 `InnerProductSpace π•œ E`. -/
 theorem nonempty_innerProductSpace : Nonempty (InnerProductSpace π•œ E) :=
   ⟨{  inner := inner_ π•œ
-      norm_sq_eq_inner := Inner_.norm_sq
-      conj_symm := Inner_.conj_symm
+      norm_sq_eq_inner := inner_.norm_sq
+      conj_symm := inner_.conj_symm
       add_left := add_left
       smul_left := fun _ _ _ => innerProp _ _ _ }⟩
 #align nonempty_inner_product_space nonempty_innerProductSpace
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -57,7 +57,7 @@ open IsROrC
 
 open scoped ComplexConjugate
 
-variable {π•œ : Type _} [IsROrC π•œ] (E : Type _) [NormedAddCommGroup E]
+variable {π•œ : Type*} [IsROrC π•œ] (E : Type*) [NormedAddCommGroup E]
 
 /-- Predicate for the parallelogram identity to hold in a normed group. This is a scalar-less
 version of `InnerProductSpace`. If you have an `InnerProductSpaceable` assumption, you can
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2020 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth
-
-! This file was ported from Lean 3 source module analysis.inner_product_space.of_norm
-! leanprover-community/mathlib commit baa88307f3e699fa7054ef04ec79fa4f056169cb
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Topology.Algebra.Algebra
 import Mathlib.Analysis.InnerProductSpace.Basic
 
+#align_import analysis.inner_product_space.of_norm from "leanprover-community/mathlib"@"baa88307f3e699fa7054ef04ec79fa4f056169cb"
+
 /-!
 # Inner product space derived from a norm
 
feat: port Analysis.InnerProductSpace.OfNorm (#5885)

Dependencies 12 + 774

775 files ported (98.5%)
346801 lines ported (98.4%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file