algebra.star.piMathlib.Algebra.Star.Pi

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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

refactor(linear_algebra/matrix/hermitian): golf and generalize (#18565)

A handful of these results can be proven trivially using results about is_self_adjoint. This also generalizes the typeclass arguments throughout the file, though largely in a mathematically meaningless way.

Diff
@@ -29,6 +29,9 @@ instance [Π i, has_star (f i)] : has_star (Π i, f i) :=
 
 lemma star_def [Π i, has_star (f i)] (x : Π i, f i) : star x = λ i, star (x i) := rfl
 
+instance [Π i, has_star (f i)] [∀ i, has_trivial_star (f i)] : has_trivial_star (Π i, f i) :=
+{ star_trivial  := λ _, funext $ λ _, star_trivial _ }
+
 instance [Π i, has_involutive_star (f i)] : has_involutive_star (Π i, f i) :=
 { star_involutive := λ _, funext $ λ _, star_star _ }
 

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.Algebra.Star.Basic
-import Mathbin.Algebra.Ring.Pi
+import Algebra.Star.Basic
+import Algebra.Ring.Pi
 
 #align_import algebra.star.pi from "leanprover-community/mathlib"@"9abfa6f0727d5adc99067e325e15d1a9de17fd8e"
 
Diff
@@ -50,14 +50,14 @@ instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f
 instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
     where star_involutive _ := funext fun _ => star_star _
 
-instance [∀ i, Semigroup (f i)] [∀ i, StarSemigroup (f i)] : StarSemigroup (∀ i, f i)
+instance [∀ i, Semigroup (f i)] [∀ i, StarMul (f i)] : StarMul (∀ i, f i)
     where star_hMul _ _ := funext fun _ => star_hMul _ _
 
 instance [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] : StarAddMonoid (∀ i, f i)
     where star_add _ _ := funext fun _ => star_add _ _
 
 instance [∀ i, NonUnitalSemiring (f i)] [∀ i, StarRing (f i)] : StarRing (∀ i, f i) :=
-  { Pi.starAddMonoid, (Pi.starSemigroup : StarSemigroup (∀ i, f i)) with }
+  { Pi.starAddMonoid, (Pi.starSemigroup : StarMul (∀ i, f i)) with }
 
 instance {R : Type w} [∀ i, SMul R (f i)] [Star R] [∀ i, Star (f i)] [∀ i, StarModule R (f i)] :
     StarModule R (∀ i, f i) where star_smul r x := funext fun i => star_smul r (x i)
Diff
@@ -51,7 +51,7 @@ instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
     where star_involutive _ := funext fun _ => star_star _
 
 instance [∀ i, Semigroup (f i)] [∀ i, StarSemigroup (f i)] : StarSemigroup (∀ i, f i)
-    where star_mul _ _ := funext fun _ => star_mul _ _
+    where star_hMul _ _ := funext fun _ => star_hMul _ _
 
 instance [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] : StarAddMonoid (∀ i, f i)
     where star_add _ _ := funext fun _ => star_add _ _
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module algebra.star.pi
-! leanprover-community/mathlib commit 9abfa6f0727d5adc99067e325e15d1a9de17fd8e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Star.Basic
 import Mathbin.Algebra.Ring.Pi
 
+#align_import algebra.star.pi from "leanprover-community/mathlib"@"9abfa6f0727d5adc99067e325e15d1a9de17fd8e"
+
 /-!
 # `star` on pi types
 
Diff
@@ -65,10 +65,12 @@ instance [∀ i, NonUnitalSemiring (f i)] [∀ i, StarRing (f i)] : StarRing (
 instance {R : Type w} [∀ i, SMul R (f i)] [Star R] [∀ i, Star (f i)] [∀ i, StarModule R (f i)] :
     StarModule R (∀ i, f i) where star_smul r x := funext fun i => star_smul r (x i)
 
+#print Pi.single_star /-
 theorem single_star [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] [DecidableEq I] (i : I)
     (a : f i) : Pi.single i (star a) = star (Pi.single i a) :=
   single_op (fun i => @star (f i) _) (fun i => star_zero _) i a
 #align pi.single_star Pi.single_star
+-/
 
 end Pi
 
@@ -81,9 +83,11 @@ theorem update_star [∀ i, Star (f i)] [DecidableEq I] (h : ∀ i : I, f i) (i
 #align function.update_star Function.update_star
 -/
 
+#print Function.star_sum_elim /-
 theorem star_sum_elim {I J α : Type _} (x : I → α) (y : J → α) [Star α] :
     star (Sum.elim x y) = Sum.elim (star x) (star y) := by ext x; cases x <;> simp
 #align function.star_sum_elim Function.star_sum_elim
+-/
 
 end Function
 
Diff
@@ -65,12 +65,6 @@ instance [∀ i, NonUnitalSemiring (f i)] [∀ i, StarRing (f i)] : StarRing (
 instance {R : Type w} [∀ i, SMul R (f i)] [Star R] [∀ i, Star (f i)] [∀ i, StarModule R (f i)] :
     StarModule R (∀ i, f i) where star_smul r x := funext fun i => star_smul r (x i)
 
-/- warning: pi.single_star -> Pi.single_star is a dubious translation:
-lean 3 declaration is
-  forall {I : Type.{u1}} {f : I -> Type.{u2}} [_inst_1 : forall (i : I), AddMonoid.{u2} (f i)] [_inst_2 : forall (i : I), StarAddMonoid.{u2} (f i) (_inst_1 i)] [_inst_3 : DecidableEq.{succ u1} I] (i : I) (a : f i), Eq.{max (succ u1) (succ u2)} (forall (i : I), f i) (Pi.single.{u1, u2} I (fun (i : I) => f i) (fun (a : I) (b : I) => _inst_3 a b) (fun (i : I) => AddZeroClass.toHasZero.{u2} (f i) (AddMonoid.toAddZeroClass.{u2} (f i) (_inst_1 i))) i (Star.star.{u2} (f i) (InvolutiveStar.toHasStar.{u2} (f i) (StarAddMonoid.toHasInvolutiveStar.{u2} (f i) (_inst_1 i) (_inst_2 i))) a)) (Star.star.{max u1 u2} (forall (i : I), f i) (Pi.hasStar.{u1, u2} I (fun (i : I) => f i) (fun (i : I) => InvolutiveStar.toHasStar.{u2} (f i) (StarAddMonoid.toHasInvolutiveStar.{u2} (f i) (_inst_1 i) (_inst_2 i)))) (Pi.single.{u1, u2} I (fun (i : I) => f i) (fun (a : I) (b : I) => _inst_3 a b) (fun (i : I) => AddZeroClass.toHasZero.{u2} (f i) (AddMonoid.toAddZeroClass.{u2} (f i) (_inst_1 i))) i a))
-but is expected to have type
-  forall {I : Type.{u1}} {f : I -> Type.{u2}} [_inst_1 : forall (i : I), AddMonoid.{u2} (f i)] [_inst_2 : forall (i : I), StarAddMonoid.{u2} (f i) (_inst_1 i)] [_inst_3 : DecidableEq.{succ u1} I] (i : I) (a : f i), Eq.{max (succ u1) (succ u2)} (forall (i : I), f i) (Pi.single.{u1, u2} I f (fun (a : I) (b : I) => _inst_3 a b) (fun (i : I) => AddMonoid.toZero.{u2} (f i) (_inst_1 i)) i (Star.star.{u2} (f i) (InvolutiveStar.toStar.{u2} (f i) (StarAddMonoid.toInvolutiveStar.{u2} (f i) (_inst_1 i) (_inst_2 i))) a)) (Star.star.{max u2 u1} (forall (i : I), f i) (Pi.instStarForAll.{u1, u2} I (fun (i : I) => f i) (fun (i : I) => InvolutiveStar.toStar.{u2} (f i) (StarAddMonoid.toInvolutiveStar.{u2} (f i) (_inst_1 i) (_inst_2 i)))) (Pi.single.{u1, u2} I f (fun (a : I) (b : I) => _inst_3 a b) (fun (i : I) => AddMonoid.toZero.{u2} (f i) (_inst_1 i)) i a))
-Case conversion may be inaccurate. Consider using '#align pi.single_star Pi.single_starₓ'. -/
 theorem single_star [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] [DecidableEq I] (i : I)
     (a : f i) : Pi.single i (star a) = star (Pi.single i a) :=
   single_op (fun i => @star (f i) _) (fun i => star_zero _) i a
@@ -87,12 +81,6 @@ theorem update_star [∀ i, Star (f i)] [DecidableEq I] (h : ∀ i : I, f i) (i
 #align function.update_star Function.update_star
 -/
 
-/- warning: function.star_sum_elim -> Function.star_sum_elim is a dubious translation:
-lean 3 declaration is
-  forall {I : Type.{u1}} {J : Type.{u2}} {α : Type.{u3}} (x : I -> α) (y : J -> α) [_inst_1 : Star.{u3} α], Eq.{succ (max (max u1 u2) u3)} ((Sum.{u1, u2} I J) -> α) (Star.star.{max (max u1 u2) u3} ((Sum.{u1, u2} I J) -> α) (Pi.hasStar.{max u1 u2, u3} (Sum.{u1, u2} I J) (fun (ᾰ : Sum.{u1, u2} I J) => α) (fun (i : Sum.{u1, u2} I J) => _inst_1)) (Sum.elim.{u1, u2, succ u3} I J α x y)) (Sum.elim.{u1, u2, succ u3} I J α (Star.star.{max u1 u3} (I -> α) (Pi.hasStar.{u1, u3} I (fun (ᾰ : I) => α) (fun (i : I) => _inst_1)) x) (Star.star.{max u2 u3} (J -> α) (Pi.hasStar.{u2, u3} J (fun (ᾰ : J) => α) (fun (i : J) => _inst_1)) y))
-but is expected to have type
-  forall {I : Type.{u3}} {J : Type.{u2}} {α : Type.{u1}} (x : I -> α) (y : J -> α) [_inst_1 : Star.{u1} α], Eq.{max (max (succ u3) (succ u2)) (succ u1)} ((Sum.{u3, u2} I J) -> α) (Star.star.{max (max u3 u2) u1} ((Sum.{u3, u2} I J) -> α) (Pi.instStarForAll.{max u3 u2, u1} (Sum.{u3, u2} I J) (fun (ᾰ : Sum.{u3, u2} I J) => α) (fun (i : Sum.{u3, u2} I J) => _inst_1)) (Sum.elim.{u3, u2, succ u1} I J α x y)) (Sum.elim.{u3, u2, succ u1} I J α (Star.star.{max u3 u1} (I -> α) (Pi.instStarForAll.{u3, u1} I (fun (ᾰ : I) => α) (fun (i : I) => _inst_1)) x) (Star.star.{max u1 u2} (J -> α) (Pi.instStarForAll.{u2, u1} J (fun (ᾰ : J) => α) (fun (i : J) => _inst_1)) y))
-Case conversion may be inaccurate. Consider using '#align function.star_sum_elim Function.star_sum_elimₓ'. -/
 theorem star_sum_elim {I J α : Type _} (x : I → α) (y : J → α) [Star α] :
     star (Sum.elim x y) = Sum.elim (star x) (star y) := by ext x; cases x <;> simp
 #align function.star_sum_elim Function.star_sum_elim
Diff
@@ -94,10 +94,7 @@ but is expected to have type
   forall {I : Type.{u3}} {J : Type.{u2}} {α : Type.{u1}} (x : I -> α) (y : J -> α) [_inst_1 : Star.{u1} α], Eq.{max (max (succ u3) (succ u2)) (succ u1)} ((Sum.{u3, u2} I J) -> α) (Star.star.{max (max u3 u2) u1} ((Sum.{u3, u2} I J) -> α) (Pi.instStarForAll.{max u3 u2, u1} (Sum.{u3, u2} I J) (fun (ᾰ : Sum.{u3, u2} I J) => α) (fun (i : Sum.{u3, u2} I J) => _inst_1)) (Sum.elim.{u3, u2, succ u1} I J α x y)) (Sum.elim.{u3, u2, succ u1} I J α (Star.star.{max u3 u1} (I -> α) (Pi.instStarForAll.{u3, u1} I (fun (ᾰ : I) => α) (fun (i : I) => _inst_1)) x) (Star.star.{max u1 u2} (J -> α) (Pi.instStarForAll.{u2, u1} J (fun (ᾰ : J) => α) (fun (i : J) => _inst_1)) y))
 Case conversion may be inaccurate. Consider using '#align function.star_sum_elim Function.star_sum_elimₓ'. -/
 theorem star_sum_elim {I J α : Type _} (x : I → α) (y : J → α) [Star α] :
-    star (Sum.elim x y) = Sum.elim (star x) (star y) :=
-  by
-  ext x
-  cases x <;> simp
+    star (Sum.elim x y) = Sum.elim (star x) (star y) := by ext x; cases x <;> simp
 #align function.star_sum_elim Function.star_sum_elim
 
 end Function
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module algebra.star.pi
-! leanprover-community/mathlib commit be24ec5de6701447e5df5ca75400ffee19d65659
+! leanprover-community/mathlib commit 9abfa6f0727d5adc99067e325e15d1a9de17fd8e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -47,6 +47,9 @@ theorem star_def [∀ i, Star (f i)] (x : ∀ i, f i) : star x = fun i => star (
 #align pi.star_def Pi.star_def
 -/
 
+instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f i)
+    where star_trivial _ := funext fun _ => star_trivial _
+
 instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
     where star_involutive _ := funext fun _ => star_star _
 

Changes in mathlib4

mathlib3
mathlib4
feat: Every star ring is a Nat-star module (#9470)

and other basic star lemmas

From LeanAPAP

Diff
@@ -61,6 +61,12 @@ theorem single_star [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] [Decid
   single_op (fun i => @star (f i) _) (fun _ => star_zero _) i a
 #align pi.single_star Pi.single_star
 
+open scoped ComplexConjugate
+
+@[simp]
+lemma conj_apply {ι : Type*} {α : ι → Type*} [∀ i, CommSemiring (α i)] [∀ i, StarRing (α i)]
+    (f : ∀ i, α i) (i : ι) : conj f i = conj (f i) := rfl
+
 end Pi
 
 namespace Function
style: fix wrapping of where (#7149)
Diff
@@ -37,24 +37,24 @@ theorem star_def [∀ i, Star (f i)] (x : ∀ i, f i) : star x = fun i => star (
   rfl
 #align pi.star_def Pi.star_def
 
-instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f i)
-    where star_trivial _ := funext fun _ => star_trivial _
+instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f i) where
+  star_trivial _ := funext fun _ => star_trivial _
 
-instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
-    where star_involutive _ := funext fun _ => star_star _
+instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i) where
+  star_involutive _ := funext fun _ => star_star _
 
-instance [∀ i, Mul (f i)] [∀ i, StarMul (f i)] : StarMul (∀ i, f i)
-    where star_mul _ _ := funext fun _ => star_mul _ _
+instance [∀ i, Mul (f i)] [∀ i, StarMul (f i)] : StarMul (∀ i, f i) where
+  star_mul _ _ := funext fun _ => star_mul _ _
 
-instance [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] : StarAddMonoid (∀ i, f i)
-    where star_add _ _ := funext fun _ => star_add _ _
+instance [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] : StarAddMonoid (∀ i, f i) where
+  star_add _ _ := funext fun _ => star_add _ _
 
 instance [∀ i, NonUnitalSemiring (f i)] [∀ i, StarRing (f i)] : StarRing (∀ i, f i)
   where star_add _ _ := funext fun _ => star_add _ _
 
 instance {R : Type w} [∀ i, SMul R (f i)] [Star R] [∀ i, Star (f i)]
-    [∀ i, StarModule R (f i)] : StarModule R (∀ i, f i)
-    where star_smul r x := funext fun i => star_smul r (x i)
+    [∀ i, StarModule R (f i)] : StarModule R (∀ i, f i) where
+  star_smul r x := funext fun i => star_smul r (x i)
 
 theorem single_star [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] [DecidableEq I] (i : I)
     (a : f i) : Pi.single i (star a) = star (Pi.single i a) :=
refactor(Algebra/Star/*): Allow for star operation on non-associative algebras (#6562)

Typically a * operation on a mathematical structure R equipped with a multiplication is an involutive anti-automorphism i.e.

∀ r s : R, star (r * s) = star s * star r

Currently mathlib defines a class StarSemigroup to be a semigroup satisfying this property. However, the requirement for the multiplication to be associative is unnecessarily restrictive. There are important classes of star-algebra which are not associative (e.g. JB*-algebras).

This PR removes the requirement for a StarSemigroup to be a semigroup, merely requiring it to have a multiplication.

I've changed the name from StarSemigroup to StarMul since it's no longer a semigroup.

Zulip discussion

Previously opened as a mathlib PR https://github.com/leanprover-community/mathlib/pull/17949

Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -43,7 +43,7 @@ instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f
 instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
     where star_involutive _ := funext fun _ => star_star _
 
-instance [∀ i, Semigroup (f i)] [∀ i, StarSemigroup (f i)] : StarSemigroup (∀ i, f i)
+instance [∀ i, Mul (f i)] [∀ i, StarMul (f i)] : StarMul (∀ i, f i)
     where star_mul _ _ := funext fun _ => star_mul _ _
 
 instance [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] : StarAddMonoid (∀ i, f i)
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
@@ -70,7 +70,7 @@ theorem update_star [∀ i, Star (f i)] [DecidableEq I] (h : ∀ i : I, f i) (i
   funext fun j => (apply_update (fun _ => star) h i a j).symm
 #align function.update_star Function.update_star
 
-theorem star_sum_elim {I J α : Type _} (x : I → α) (y : J → α) [Star α] :
+theorem star_sum_elim {I J α : Type*} (x : I → α) (y : J → α) [Star α] :
     star (Sum.elim x y) = Sum.elim (star x) (star y) := by
   ext x; cases x <;> simp only [Pi.star_apply, Sum.elim_inl, Sum.elim_inr]
 #align function.star_sum_elim Function.star_sum_elim
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) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module algebra.star.pi
-! leanprover-community/mathlib commit 9abfa6f0727d5adc99067e325e15d1a9de17fd8e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Star.Basic
 import Mathlib.Algebra.Ring.Pi
 
+#align_import algebra.star.pi from "leanprover-community/mathlib"@"9abfa6f0727d5adc99067e325e15d1a9de17fd8e"
+
 /-!
 # `star` on pi types
 
chore: sync Mathlib.Algebra.Star.Pi (#3081)
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module algebra.star.pi
-! leanprover-community/mathlib commit 247a102b14f3cebfee126293341af5f6bed00237
+! leanprover-community/mathlib commit 9abfa6f0727d5adc99067e325e15d1a9de17fd8e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -40,6 +40,9 @@ theorem star_def [∀ i, Star (f i)] (x : ∀ i, f i) : star x = fun i => star (
   rfl
 #align pi.star_def Pi.star_def
 
+instance [∀ i, Star (f i)] [∀ i, TrivialStar (f i)] : TrivialStar (∀ i, f i)
+    where star_trivial _ := funext fun _ => star_trivial _
+
 instance [∀ i, InvolutiveStar (f i)] : InvolutiveStar (∀ i, f i)
     where star_involutive _ := funext fun _ => star_star _
 
feat: port Algebra.Star.Pi (#1432)

Dependencies 3 + 175

176 files ported (98.3%)
65319 lines ported (98.4%)
Show graph

The unported dependencies are