AFTD Auto-Formalizing Theoretical Domains

FieldStatistic.instAddMonoid

instanceimported Lean

The instance of an additive monoid on FieldStatistic.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open FieldStatistic in
variable {𝓕 : Type} in
variable (q : 𝓕 β†’ FieldStatistic) in
instance FieldStatistic.instAddMonoid : AddMonoid FieldStatistic
Defined in
Physlib, `FieldStatistic.instAddMonoid`
Lean proof
By Joseph Tooby-Smith, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
10 Oct 2026
Axioms
none listed
Built on 19
Used by 9

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open FieldStatistic in
variable {𝓕 : Type} in
variable (q : 𝓕 β†’ FieldStatistic) in
/-- The instance of an additive monoid on `FieldStatistic`. -/
instance FieldStatistic.instAddMonoid : AddMonoid FieldStatistic where
  zero := bosonic
  add a b := a * b
  nsmul n a := ∏ (i : Fin n), a
  zero_add a := by
    cases a <;> rfl
  add_zero a := by
    cases a <;> rfl
  add_assoc a b c := by
    cases a <;> cases b <;> cases c <;> rfl
  nsmul_zero a := by
    show (∏ _i : Fin 0, a) = (1 : FieldStatistic)
    rw [Finset.prod_const, Finset.card_univ, Fintype.card_fin, pow_zero]
  nsmul_succ a n := by
    show (∏ _i : Fin (a + 1), n) = (∏ _i : Fin a, n) * n
    simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin, pow_succ]
See it in the graphDiscuss this resultChallenge it