Skip to content

Commit

Permalink
feat(Data/Part): Add missing to_additive in Part.lean (#22267)
Browse files Browse the repository at this point in the history
  • Loading branch information
staroperator committed Feb 25, 2025
1 parent 2f02187 commit d45d317
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mathlib/Data/Part.lean
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,18 @@ instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b

section

@[to_additive]
theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * ·) b := rfl

@[to_additive]
theorem one_def [One α] : (1 : Part α) = some 1 := rfl

@[to_additive]
theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (· ⁻¹) a := rfl

@[to_additive]
theorem div_def [Div α] (a b : Part α) : a / b = bind a fun y => map (y / ·) b := rfl

theorem mod_def [Mod α] (a b : Part α) : a % b = bind a fun y => map (y % ·) b := rfl
theorem append_def [Append α] (a b : Part α) : a ++ b = bind a fun y => map (y ++ ·) b := rfl
theorem inter_def [Inter α] (a b : Part α) : a ∩ b = bind a fun y => map (y ∩ ·) b := rfl
Expand Down

0 comments on commit d45d317

Please sign in to comment.