Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
num_lines
int64
1
150
complexity_score
float64
2.72
139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B
diff_level
int64
0
2
file_diff_level
float64
0
2
theorem_same_file
int64
1
32
rank_file
int64
0
2.51k
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp]
Mathlib/Order/SymmDiff.lean
121
121
theorem symmDiff_self : a ∆ a = ⊥ := by
rw [symmDiff, sup_idem, sdiff_self]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp]
Mathlib/Order/SymmDiff.lean
125
125
theorem symmDiff_bot : a ∆ ⊥ = a := by
rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp]
Mathlib/Order/SymmDiff.lean
129
129
theorem bot_symmDiff : ⊥ ∆ a = a := by
rw [symmDiff_comm, symmDiff_bot]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp]
Mathlib/Order/SymmDiff.lean
133
134
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot
Mathlib/Order/SymmDiff.lean
137
138
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le
Mathlib/Order/SymmDiff.lean
141
142
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le
Mathlib/Order/SymmDiff.lean
149
150
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by simp_rw [symmDiff, sup_le_iff, sdiff_le_iff] #align symm_diff_le_iff symmDiff_le_iff @[simp] theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b := sup_le_sup sdiff_le sdiff_le #align symm_diff_le_sup symmDiff_le_sup
Mathlib/Order/SymmDiff.lean
158
158
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by
simp [sup_sdiff, symmDiff]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by simp_rw [symmDiff, sup_le_iff, sdiff_le_iff] #align symm_diff_le_iff symmDiff_le_iff @[simp] theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b := sup_le_sup sdiff_le sdiff_le #align symm_diff_le_sup symmDiff_le_sup theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff] #align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
Mathlib/Order/SymmDiff.lean
161
162
theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by simp_rw [symmDiff, sup_le_iff, sdiff_le_iff] #align symm_diff_le_iff symmDiff_le_iff @[simp] theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b := sup_le_sup sdiff_le sdiff_le #align symm_diff_le_sup symmDiff_le_sup theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff] #align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right] #align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup
Mathlib/Order/SymmDiff.lean
165
166
theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by
rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by simp_rw [symmDiff, sup_le_iff, sdiff_le_iff] #align symm_diff_le_iff symmDiff_le_iff @[simp] theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b := sup_le_sup sdiff_le sdiff_le #align symm_diff_le_sup symmDiff_le_sup theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff] #align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right] #align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left] #align symm_diff_sdiff symmDiff_sdiff @[simp]
Mathlib/Order/SymmDiff.lean
170
172
theorem symmDiff_sdiff_inf : a ∆ b \ (a ⊓ b) = a ∆ b := by
rw [symmDiff_sdiff] simp [symmDiff]
2
7.389056
1
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedCoheytingAlgebra variable [GeneralizedCoheytingAlgebra α] (a b c d : α) @[simp] theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b := rfl #align to_dual_symm_diff toDual_symmDiff @[simp] theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b := rfl #align of_dual_bihimp ofDual_bihimp theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm] #align symm_diff_comm symmDiff_comm instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) := ⟨symmDiff_comm⟩ #align symm_diff_is_comm symmDiff_isCommutative @[simp] theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self] #align symm_diff_self symmDiff_self @[simp] theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq] #align symm_diff_bot symmDiff_bot @[simp] theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot] #align bot_symm_diff bot_symmDiff @[simp] theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff] #align symm_diff_eq_bot symmDiff_eq_bot theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq] #align symm_diff_of_le symmDiff_of_le theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq] #align symm_diff_of_ge symmDiff_of_ge theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c := sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb #align symm_diff_le symmDiff_le theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by simp_rw [symmDiff, sup_le_iff, sdiff_le_iff] #align symm_diff_le_iff symmDiff_le_iff @[simp] theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b := sup_le_sup sdiff_le sdiff_le #align symm_diff_le_sup symmDiff_le_sup theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff] #align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right] #align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left] #align symm_diff_sdiff symmDiff_sdiff @[simp] theorem symmDiff_sdiff_inf : a ∆ b \ (a ⊓ b) = a ∆ b := by rw [symmDiff_sdiff] simp [symmDiff] #align symm_diff_sdiff_inf symmDiff_sdiff_inf @[simp]
Mathlib/Order/SymmDiff.lean
176
180
theorem symmDiff_sdiff_eq_sup : a ∆ (b \ a) = a ⊔ b := by
rw [symmDiff, sdiff_idem] exact le_antisymm (sup_le_sup sdiff_le sdiff_le) (sup_le le_sdiff_sup <| le_sdiff_sup.trans <| sup_le le_sup_right le_sdiff_sup)
4
54.59815
2
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedHeytingAlgebra variable [GeneralizedHeytingAlgebra α] (a b c d : α) @[simp] theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b := rfl #align to_dual_bihimp toDual_bihimp @[simp] theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b := rfl #align of_dual_symm_diff ofDual_symmDiff theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm] #align bihimp_comm bihimp_comm instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) := ⟨bihimp_comm⟩ #align bihimp_is_comm bihimp_isCommutative @[simp]
Mathlib/Order/SymmDiff.lean
248
248
theorem bihimp_self : a ⇔ a = ⊤ := by
rw [bihimp, inf_idem, himp_self]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedHeytingAlgebra variable [GeneralizedHeytingAlgebra α] (a b c d : α) @[simp] theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b := rfl #align to_dual_bihimp toDual_bihimp @[simp] theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b := rfl #align of_dual_symm_diff ofDual_symmDiff theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm] #align bihimp_comm bihimp_comm instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) := ⟨bihimp_comm⟩ #align bihimp_is_comm bihimp_isCommutative @[simp] theorem bihimp_self : a ⇔ a = ⊤ := by rw [bihimp, inf_idem, himp_self] #align bihimp_self bihimp_self @[simp]
Mathlib/Order/SymmDiff.lean
252
252
theorem bihimp_top : a ⇔ ⊤ = a := by
rw [bihimp, himp_top, top_himp, inf_top_eq]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section GeneralizedHeytingAlgebra variable [GeneralizedHeytingAlgebra α] (a b c d : α) @[simp] theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b := rfl #align to_dual_bihimp toDual_bihimp @[simp] theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b := rfl #align of_dual_symm_diff ofDual_symmDiff theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm] #align bihimp_comm bihimp_comm instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) := ⟨bihimp_comm⟩ #align bihimp_is_comm bihimp_isCommutative @[simp] theorem bihimp_self : a ⇔ a = ⊤ := by rw [bihimp, inf_idem, himp_self] #align bihimp_self bihimp_self @[simp] theorem bihimp_top : a ⇔ ⊤ = a := by rw [bihimp, himp_top, top_himp, inf_top_eq] #align bihimp_top bihimp_top @[simp]
Mathlib/Order/SymmDiff.lean
256
256
theorem top_bihimp : ⊤ ⇔ a = a := by
rw [bihimp_comm, bihimp_top]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section CoheytingAlgebra variable [CoheytingAlgebra α] (a : α) @[simp]
Mathlib/Order/SymmDiff.lean
343
343
theorem symmDiff_top' : a ∆ ⊤ = ¬a := by
simp [symmDiff]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section CoheytingAlgebra variable [CoheytingAlgebra α] (a : α) @[simp] theorem symmDiff_top' : a ∆ ⊤ = ¬a := by simp [symmDiff] #align symm_diff_top' symmDiff_top' @[simp]
Mathlib/Order/SymmDiff.lean
347
347
theorem top_symmDiff' : ⊤ ∆ a = ¬a := by
simp [symmDiff]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section CoheytingAlgebra variable [CoheytingAlgebra α] (a : α) @[simp] theorem symmDiff_top' : a ∆ ⊤ = ¬a := by simp [symmDiff] #align symm_diff_top' symmDiff_top' @[simp] theorem top_symmDiff' : ⊤ ∆ a = ¬a := by simp [symmDiff] #align top_symm_diff' top_symmDiff' @[simp]
Mathlib/Order/SymmDiff.lean
351
353
theorem hnot_symmDiff_self : (¬a) ∆ a = ⊤ := by
rw [eq_top_iff, symmDiff, hnot_sdiff, sup_sdiff_self] exact Codisjoint.top_le codisjoint_hnot_left
2
7.389056
1
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section HeytingAlgebra variable [HeytingAlgebra α] (a : α) @[simp]
Mathlib/Order/SymmDiff.lean
371
371
theorem bihimp_bot : a ⇔ ⊥ = aᶜ := by
simp [bihimp]
1
2.718282
0
0.181818
22
266
import Mathlib.Order.BooleanAlgebra import Mathlib.Logic.Equiv.Basic #align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904" open Function OrderDual variable {ι α β : Type*} {π : ι → Type*} def symmDiff [Sup α] [SDiff α] (a b : α) : α := a \ b ⊔ b \ a #align symm_diff symmDiff def bihimp [Inf α] [HImp α] (a b : α) : α := (b ⇨ a) ⊓ (a ⇨ b) #align bihimp bihimp scoped[symmDiff] infixl:100 " ∆ " => symmDiff scoped[symmDiff] infixl:100 " ⇔ " => bihimp open scoped symmDiff theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a := rfl #align symm_diff_def symmDiff_def theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) := rfl #align bihimp_def bihimp_def theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q := rfl #align symm_diff_eq_xor symmDiff_eq_Xor' @[simp] theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) := (iff_iff_implies_and_implies _ _).symm.trans Iff.comm #align bihimp_iff_iff bihimp_iff_iff @[simp] theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide #align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor section HeytingAlgebra variable [HeytingAlgebra α] (a : α) @[simp] theorem bihimp_bot : a ⇔ ⊥ = aᶜ := by simp [bihimp] #align bihimp_bot bihimp_bot @[simp]
Mathlib/Order/SymmDiff.lean
375
375
theorem bot_bihimp : ⊥ ⇔ a = aᶜ := by
simp [bihimp]
1
2.718282
0
0.181818
22
266
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul
Mathlib/Algebra/Ring/Defs.lean
94
95
theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by
simp [right_distrib]
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring section DistribMulOneClass variable [Add α] [MulOneClass α]
Mathlib/Algebra/Ring/Defs.lean
156
157
theorem add_one_mul [RightDistribClass α] (a b : α) : (a + 1) * b = a * b + b := by
rw [add_mul, one_mul]
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring section DistribMulOneClass variable [Add α] [MulOneClass α] theorem add_one_mul [RightDistribClass α] (a b : α) : (a + 1) * b = a * b + b := by rw [add_mul, one_mul] #align add_one_mul add_one_mul
Mathlib/Algebra/Ring/Defs.lean
160
161
theorem mul_add_one [LeftDistribClass α] (a b : α) : a * (b + 1) = a * b + a := by
rw [mul_add, mul_one]
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring section DistribMulOneClass variable [Add α] [MulOneClass α] theorem add_one_mul [RightDistribClass α] (a b : α) : (a + 1) * b = a * b + b := by rw [add_mul, one_mul] #align add_one_mul add_one_mul theorem mul_add_one [LeftDistribClass α] (a b : α) : a * (b + 1) = a * b + a := by rw [mul_add, mul_one] #align mul_add_one mul_add_one
Mathlib/Algebra/Ring/Defs.lean
164
165
theorem one_add_mul [RightDistribClass α] (a b : α) : (1 + a) * b = b + a * b := by
rw [add_mul, one_mul]
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring section DistribMulOneClass variable [Add α] [MulOneClass α] theorem add_one_mul [RightDistribClass α] (a b : α) : (a + 1) * b = a * b + b := by rw [add_mul, one_mul] #align add_one_mul add_one_mul theorem mul_add_one [LeftDistribClass α] (a b : α) : a * (b + 1) = a * b + a := by rw [mul_add, mul_one] #align mul_add_one mul_add_one theorem one_add_mul [RightDistribClass α] (a b : α) : (1 + a) * b = b + a * b := by rw [add_mul, one_mul] #align one_add_mul one_add_mul
Mathlib/Algebra/Ring/Defs.lean
168
169
theorem mul_one_add [LeftDistribClass α] (a b : α) : a * (1 + b) = a + a * b := by
rw [mul_add, mul_one]
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive]
Mathlib/Algebra/Ring/Defs.lean
197
198
theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by
split_ifs <;> rfl
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive]
Mathlib/Algebra/Ring/Defs.lean
203
204
theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (if P then a else b) * c = if P then a * c else b * c := by
split_ifs <;> rfl
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive] theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (if P then a else b) * c = if P then a * c else b * c := by split_ifs <;> rfl #align ite_mul ite_mul #align ite_add ite_add -- We make `mul_ite` and `ite_mul` simp lemmas, -- but not `add_ite` or `ite_add`. -- The problem we're trying to avoid is dealing with -- summations of the form `∑ x ∈ s, (f x + ite P 1 0)`, -- in which `add_ite` followed by `sum_ite` would needlessly slice up -- the `f x` terms according to whether `P` holds at `x`. -- There doesn't appear to be a corresponding difficulty so far with -- `mul_ite` and `ite_mul`. attribute [simp] mul_ite ite_mul
Mathlib/Algebra/Ring/Defs.lean
218
221
theorem ite_sub_ite {α} [Sub α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) - if P then c else d) = if P then a - c else b - d := by
split repeat rfl
2
7.389056
1
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive] theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (if P then a else b) * c = if P then a * c else b * c := by split_ifs <;> rfl #align ite_mul ite_mul #align ite_add ite_add -- We make `mul_ite` and `ite_mul` simp lemmas, -- but not `add_ite` or `ite_add`. -- The problem we're trying to avoid is dealing with -- summations of the form `∑ x ∈ s, (f x + ite P 1 0)`, -- in which `add_ite` followed by `sum_ite` would needlessly slice up -- the `f x` terms according to whether `P` holds at `x`. -- There doesn't appear to be a corresponding difficulty so far with -- `mul_ite` and `ite_mul`. attribute [simp] mul_ite ite_mul theorem ite_sub_ite {α} [Sub α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) - if P then c else d) = if P then a - c else b - d := by split repeat rfl
Mathlib/Algebra/Ring/Defs.lean
223
226
theorem ite_add_ite {α} [Add α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) + if P then c else d) = if P then a + c else b + d := by
split repeat rfl
2
7.389056
1
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive] theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (if P then a else b) * c = if P then a * c else b * c := by split_ifs <;> rfl #align ite_mul ite_mul #align ite_add ite_add -- We make `mul_ite` and `ite_mul` simp lemmas, -- but not `add_ite` or `ite_add`. -- The problem we're trying to avoid is dealing with -- summations of the form `∑ x ∈ s, (f x + ite P 1 0)`, -- in which `add_ite` followed by `sum_ite` would needlessly slice up -- the `f x` terms according to whether `P` holds at `x`. -- There doesn't appear to be a corresponding difficulty so far with -- `mul_ite` and `ite_mul`. attribute [simp] mul_ite ite_mul theorem ite_sub_ite {α} [Sub α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) - if P then c else d) = if P then a - c else b - d := by split repeat rfl theorem ite_add_ite {α} [Add α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) + if P then c else d) = if P then a + c else b + d := by split repeat rfl -- Porting note: no @[simp] because simp proves it
Mathlib/Algebra/Ring/Defs.lean
244
245
theorem mul_boole {α} [MulZeroOneClass α] (P : Prop) [Decidable P] (a : α) : (a * if P then 1 else 0) = if P then a else 0 := by
simp
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Data.Int.Cast.Defs import Mathlib.Tactic.Spread import Mathlib.Util.AssertExists #align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function class Distrib (R : Type*) extends Mul R, Add R where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align distrib Distrib class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c #align left_distrib_class LeftDistribClass class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c #align right_distrib_class RightDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R := ⟨Distrib.left_distrib⟩ #align distrib.left_distrib_class Distrib.leftDistribClass -- see Note [lower instance priority] instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] : RightDistribClass R := ⟨Distrib.right_distrib⟩ #align distrib.right_distrib_class Distrib.rightDistribClass theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) : a * (b + c) = a * b + a * c := LeftDistribClass.left_distrib a b c #align left_distrib left_distrib alias mul_add := left_distrib #align mul_add mul_add theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) : (a + b) * c = a * c + b * c := RightDistribClass.right_distrib a b c #align right_distrib right_distrib alias add_mul := right_distrib #align add_mul add_mul theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) : (a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib] #align distrib_three_right distrib_three_right class NonUnitalNonAssocSemiring (α : Type u) extends AddCommMonoid α, Distrib α, MulZeroClass α #align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring class NonUnitalSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, SemigroupWithZero α #align non_unital_semiring NonUnitalSemiring class NonAssocSemiring (α : Type u) extends NonUnitalNonAssocSemiring α, MulZeroOneClass α, AddCommMonoidWithOne α #align non_assoc_semiring NonAssocSemiring class NonUnitalNonAssocRing (α : Type u) extends AddCommGroup α, NonUnitalNonAssocSemiring α #align non_unital_non_assoc_ring NonUnitalNonAssocRing class NonUnitalRing (α : Type*) extends NonUnitalNonAssocRing α, NonUnitalSemiring α #align non_unital_ring NonUnitalRing class NonAssocRing (α : Type*) extends NonUnitalNonAssocRing α, NonAssocSemiring α, AddCommGroupWithOne α #align non_assoc_ring NonAssocRing class Semiring (α : Type u) extends NonUnitalSemiring α, NonAssocSemiring α, MonoidWithZero α #align semiring Semiring class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R #align ring Ring @[to_additive] theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (a * if P then b else c) = if P then a * b else a * c := by split_ifs <;> rfl #align mul_ite mul_ite #align add_ite add_ite @[to_additive] theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) : (if P then a else b) * c = if P then a * c else b * c := by split_ifs <;> rfl #align ite_mul ite_mul #align ite_add ite_add -- We make `mul_ite` and `ite_mul` simp lemmas, -- but not `add_ite` or `ite_add`. -- The problem we're trying to avoid is dealing with -- summations of the form `∑ x ∈ s, (f x + ite P 1 0)`, -- in which `add_ite` followed by `sum_ite` would needlessly slice up -- the `f x` terms according to whether `P` holds at `x`. -- There doesn't appear to be a corresponding difficulty so far with -- `mul_ite` and `ite_mul`. attribute [simp] mul_ite ite_mul theorem ite_sub_ite {α} [Sub α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) - if P then c else d) = if P then a - c else b - d := by split repeat rfl theorem ite_add_ite {α} [Add α] (P : Prop) [Decidable P] (a b c d : α) : ((if P then a else b) + if P then c else d) = if P then a + c else b + d := by split repeat rfl -- Porting note: no @[simp] because simp proves it theorem mul_boole {α} [MulZeroOneClass α] (P : Prop) [Decidable P] (a : α) : (a * if P then 1 else 0) = if P then a else 0 := by simp #align mul_boole mul_boole -- Porting note: no @[simp] because simp proves it
Mathlib/Algebra/Ring/Defs.lean
249
250
theorem boole_mul {α} [MulZeroOneClass α] (P : Prop) [Decidable P] (a : α) : (if P then 1 else 0) * a = if P then a else 0 := by
simp
1
2.718282
0
0.181818
11
267
import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.Submonoid.Basic import Mathlib.Data.Set.Finite #align_import data.finsupp.defs from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {α β γ ι M M' N P G H R S : Type*} structure Finsupp (α : Type*) (M : Type*) [Zero M] where support : Finset α toFun : α → M mem_support_toFun : ∀ a, a ∈ support ↔ toFun a ≠ 0 #align finsupp Finsupp #align finsupp.support Finsupp.support #align finsupp.to_fun Finsupp.toFun #align finsupp.mem_support_to_fun Finsupp.mem_support_toFun @[inherit_doc] infixr:25 " →₀ " => Finsupp namespace Finsupp section Basic variable [Zero M] instance instFunLike : FunLike (α →₀ M) α M := ⟨toFun, by rintro ⟨s, f, hf⟩ ⟨t, g, hg⟩ (rfl : f = g) congr ext a exact (hf _).trans (hg _).symm⟩ #align finsupp.fun_like Finsupp.instFunLike instance instCoeFun : CoeFun (α →₀ M) fun _ => α → M := inferInstance #align finsupp.has_coe_to_fun Finsupp.instCoeFun @[ext] theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ h #align finsupp.ext Finsupp.ext #align finsupp.ext_iff DFunLike.ext_iff lemma ne_iff {f g : α →₀ M} : f ≠ g ↔ ∃ a, f a ≠ g a := DFunLike.ne_iff #align finsupp.coe_fn_inj DFunLike.coe_fn_eq #align finsupp.coe_fn_injective DFunLike.coe_injective #align finsupp.congr_fun DFunLike.congr_fun @[simp, norm_cast] theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f := rfl #align finsupp.coe_mk Finsupp.coe_mk instance instZero : Zero (α →₀ M) := ⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩ #align finsupp.has_zero Finsupp.instZero @[simp, norm_cast] lemma coe_zero : ⇑(0 : α →₀ M) = 0 := rfl #align finsupp.coe_zero Finsupp.coe_zero theorem zero_apply {a : α} : (0 : α →₀ M) a = 0 := rfl #align finsupp.zero_apply Finsupp.zero_apply @[simp] theorem support_zero : (0 : α →₀ M).support = ∅ := rfl #align finsupp.support_zero Finsupp.support_zero instance instInhabited : Inhabited (α →₀ M) := ⟨0⟩ #align finsupp.inhabited Finsupp.instInhabited @[simp] theorem mem_support_iff {f : α →₀ M} : ∀ {a : α}, a ∈ f.support ↔ f a ≠ 0 := @(f.mem_support_toFun) #align finsupp.mem_support_iff Finsupp.mem_support_iff @[simp, norm_cast] theorem fun_support_eq (f : α →₀ M) : Function.support f = f.support := Set.ext fun _x => mem_support_iff.symm #align finsupp.fun_support_eq Finsupp.fun_support_eq theorem not_mem_support_iff {f : α →₀ M} {a} : a ∉ f.support ↔ f a = 0 := not_iff_comm.1 mem_support_iff.symm #align finsupp.not_mem_support_iff Finsupp.not_mem_support_iff @[simp, norm_cast]
Mathlib/Data/Finsupp/Defs.lean
185
185
theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0 := by
rw [← coe_zero, DFunLike.coe_fn_eq]
1
2.718282
0
0.2
5
268
import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.Submonoid.Basic import Mathlib.Data.Set.Finite #align_import data.finsupp.defs from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {α β γ ι M M' N P G H R S : Type*} structure Finsupp (α : Type*) (M : Type*) [Zero M] where support : Finset α toFun : α → M mem_support_toFun : ∀ a, a ∈ support ↔ toFun a ≠ 0 #align finsupp Finsupp #align finsupp.support Finsupp.support #align finsupp.to_fun Finsupp.toFun #align finsupp.mem_support_to_fun Finsupp.mem_support_toFun @[inherit_doc] infixr:25 " →₀ " => Finsupp namespace Finsupp section Basic variable [Zero M] instance instFunLike : FunLike (α →₀ M) α M := ⟨toFun, by rintro ⟨s, f, hf⟩ ⟨t, g, hg⟩ (rfl : f = g) congr ext a exact (hf _).trans (hg _).symm⟩ #align finsupp.fun_like Finsupp.instFunLike instance instCoeFun : CoeFun (α →₀ M) fun _ => α → M := inferInstance #align finsupp.has_coe_to_fun Finsupp.instCoeFun @[ext] theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ h #align finsupp.ext Finsupp.ext #align finsupp.ext_iff DFunLike.ext_iff lemma ne_iff {f g : α →₀ M} : f ≠ g ↔ ∃ a, f a ≠ g a := DFunLike.ne_iff #align finsupp.coe_fn_inj DFunLike.coe_fn_eq #align finsupp.coe_fn_injective DFunLike.coe_injective #align finsupp.congr_fun DFunLike.congr_fun @[simp, norm_cast] theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f := rfl #align finsupp.coe_mk Finsupp.coe_mk instance instZero : Zero (α →₀ M) := ⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩ #align finsupp.has_zero Finsupp.instZero @[simp, norm_cast] lemma coe_zero : ⇑(0 : α →₀ M) = 0 := rfl #align finsupp.coe_zero Finsupp.coe_zero theorem zero_apply {a : α} : (0 : α →₀ M) a = 0 := rfl #align finsupp.zero_apply Finsupp.zero_apply @[simp] theorem support_zero : (0 : α →₀ M).support = ∅ := rfl #align finsupp.support_zero Finsupp.support_zero instance instInhabited : Inhabited (α →₀ M) := ⟨0⟩ #align finsupp.inhabited Finsupp.instInhabited @[simp] theorem mem_support_iff {f : α →₀ M} : ∀ {a : α}, a ∈ f.support ↔ f a ≠ 0 := @(f.mem_support_toFun) #align finsupp.mem_support_iff Finsupp.mem_support_iff @[simp, norm_cast] theorem fun_support_eq (f : α →₀ M) : Function.support f = f.support := Set.ext fun _x => mem_support_iff.symm #align finsupp.fun_support_eq Finsupp.fun_support_eq theorem not_mem_support_iff {f : α →₀ M} {a} : a ∉ f.support ↔ f a = 0 := not_iff_comm.1 mem_support_iff.symm #align finsupp.not_mem_support_iff Finsupp.not_mem_support_iff @[simp, norm_cast] theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0 := by rw [← coe_zero, DFunLike.coe_fn_eq] #align finsupp.coe_eq_zero Finsupp.coe_eq_zero
Mathlib/Data/Finsupp/Defs.lean
188
195
theorem ext_iff' {f g : α →₀ M} : f = g ↔ f.support = g.support ∧ ∀ x ∈ f.support, f x = g x := ⟨fun h => h ▸ ⟨rfl, fun _ _ => rfl⟩, fun ⟨h₁, h₂⟩ => ext fun a => by classical exact if h : a ∈ f.support then h₂ a h else by have hf : f a = 0 := not_mem_support_iff.1 h have hg : g a = 0 := by
rwa [h₁, not_mem_support_iff] at h rw [hf, hg]⟩
2
7.389056
1
0.2
5
268
import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.Submonoid.Basic import Mathlib.Data.Set.Finite #align_import data.finsupp.defs from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {α β γ ι M M' N P G H R S : Type*} structure Finsupp (α : Type*) (M : Type*) [Zero M] where support : Finset α toFun : α → M mem_support_toFun : ∀ a, a ∈ support ↔ toFun a ≠ 0 #align finsupp Finsupp #align finsupp.support Finsupp.support #align finsupp.to_fun Finsupp.toFun #align finsupp.mem_support_to_fun Finsupp.mem_support_toFun @[inherit_doc] infixr:25 " →₀ " => Finsupp namespace Finsupp section Basic variable [Zero M] instance instFunLike : FunLike (α →₀ M) α M := ⟨toFun, by rintro ⟨s, f, hf⟩ ⟨t, g, hg⟩ (rfl : f = g) congr ext a exact (hf _).trans (hg _).symm⟩ #align finsupp.fun_like Finsupp.instFunLike instance instCoeFun : CoeFun (α →₀ M) fun _ => α → M := inferInstance #align finsupp.has_coe_to_fun Finsupp.instCoeFun @[ext] theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ h #align finsupp.ext Finsupp.ext #align finsupp.ext_iff DFunLike.ext_iff lemma ne_iff {f g : α →₀ M} : f ≠ g ↔ ∃ a, f a ≠ g a := DFunLike.ne_iff #align finsupp.coe_fn_inj DFunLike.coe_fn_eq #align finsupp.coe_fn_injective DFunLike.coe_injective #align finsupp.congr_fun DFunLike.congr_fun @[simp, norm_cast] theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f := rfl #align finsupp.coe_mk Finsupp.coe_mk instance instZero : Zero (α →₀ M) := ⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩ #align finsupp.has_zero Finsupp.instZero @[simp, norm_cast] lemma coe_zero : ⇑(0 : α →₀ M) = 0 := rfl #align finsupp.coe_zero Finsupp.coe_zero theorem zero_apply {a : α} : (0 : α →₀ M) a = 0 := rfl #align finsupp.zero_apply Finsupp.zero_apply @[simp] theorem support_zero : (0 : α →₀ M).support = ∅ := rfl #align finsupp.support_zero Finsupp.support_zero instance instInhabited : Inhabited (α →₀ M) := ⟨0⟩ #align finsupp.inhabited Finsupp.instInhabited @[simp] theorem mem_support_iff {f : α →₀ M} : ∀ {a : α}, a ∈ f.support ↔ f a ≠ 0 := @(f.mem_support_toFun) #align finsupp.mem_support_iff Finsupp.mem_support_iff @[simp, norm_cast] theorem fun_support_eq (f : α →₀ M) : Function.support f = f.support := Set.ext fun _x => mem_support_iff.symm #align finsupp.fun_support_eq Finsupp.fun_support_eq theorem not_mem_support_iff {f : α →₀ M} {a} : a ∉ f.support ↔ f a = 0 := not_iff_comm.1 mem_support_iff.symm #align finsupp.not_mem_support_iff Finsupp.not_mem_support_iff @[simp, norm_cast] theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0 := by rw [← coe_zero, DFunLike.coe_fn_eq] #align finsupp.coe_eq_zero Finsupp.coe_eq_zero theorem ext_iff' {f g : α →₀ M} : f = g ↔ f.support = g.support ∧ ∀ x ∈ f.support, f x = g x := ⟨fun h => h ▸ ⟨rfl, fun _ _ => rfl⟩, fun ⟨h₁, h₂⟩ => ext fun a => by classical exact if h : a ∈ f.support then h₂ a h else by have hf : f a = 0 := not_mem_support_iff.1 h have hg : g a = 0 := by rwa [h₁, not_mem_support_iff] at h rw [hf, hg]⟩ #align finsupp.ext_iff' Finsupp.ext_iff' @[simp] theorem support_eq_empty {f : α →₀ M} : f.support = ∅ ↔ f = 0 := mod_cast @Function.support_eq_empty_iff _ _ _ f #align finsupp.support_eq_empty Finsupp.support_eq_empty
Mathlib/Data/Finsupp/Defs.lean
203
204
theorem support_nonempty_iff {f : α →₀ M} : f.support.Nonempty ↔ f ≠ 0 := by
simp only [Finsupp.support_eq_empty, Finset.nonempty_iff_ne_empty, Ne]
1
2.718282
0
0.2
5
268
import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.Submonoid.Basic import Mathlib.Data.Set.Finite #align_import data.finsupp.defs from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {α β γ ι M M' N P G H R S : Type*} structure Finsupp (α : Type*) (M : Type*) [Zero M] where support : Finset α toFun : α → M mem_support_toFun : ∀ a, a ∈ support ↔ toFun a ≠ 0 #align finsupp Finsupp #align finsupp.support Finsupp.support #align finsupp.to_fun Finsupp.toFun #align finsupp.mem_support_to_fun Finsupp.mem_support_toFun @[inherit_doc] infixr:25 " →₀ " => Finsupp namespace Finsupp section Basic variable [Zero M] instance instFunLike : FunLike (α →₀ M) α M := ⟨toFun, by rintro ⟨s, f, hf⟩ ⟨t, g, hg⟩ (rfl : f = g) congr ext a exact (hf _).trans (hg _).symm⟩ #align finsupp.fun_like Finsupp.instFunLike instance instCoeFun : CoeFun (α →₀ M) fun _ => α → M := inferInstance #align finsupp.has_coe_to_fun Finsupp.instCoeFun @[ext] theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ h #align finsupp.ext Finsupp.ext #align finsupp.ext_iff DFunLike.ext_iff lemma ne_iff {f g : α →₀ M} : f ≠ g ↔ ∃ a, f a ≠ g a := DFunLike.ne_iff #align finsupp.coe_fn_inj DFunLike.coe_fn_eq #align finsupp.coe_fn_injective DFunLike.coe_injective #align finsupp.congr_fun DFunLike.congr_fun @[simp, norm_cast] theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f := rfl #align finsupp.coe_mk Finsupp.coe_mk instance instZero : Zero (α →₀ M) := ⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩ #align finsupp.has_zero Finsupp.instZero @[simp, norm_cast] lemma coe_zero : ⇑(0 : α →₀ M) = 0 := rfl #align finsupp.coe_zero Finsupp.coe_zero theorem zero_apply {a : α} : (0 : α →₀ M) a = 0 := rfl #align finsupp.zero_apply Finsupp.zero_apply @[simp] theorem support_zero : (0 : α →₀ M).support = ∅ := rfl #align finsupp.support_zero Finsupp.support_zero instance instInhabited : Inhabited (α →₀ M) := ⟨0⟩ #align finsupp.inhabited Finsupp.instInhabited @[simp] theorem mem_support_iff {f : α →₀ M} : ∀ {a : α}, a ∈ f.support ↔ f a ≠ 0 := @(f.mem_support_toFun) #align finsupp.mem_support_iff Finsupp.mem_support_iff @[simp, norm_cast] theorem fun_support_eq (f : α →₀ M) : Function.support f = f.support := Set.ext fun _x => mem_support_iff.symm #align finsupp.fun_support_eq Finsupp.fun_support_eq theorem not_mem_support_iff {f : α →₀ M} {a} : a ∉ f.support ↔ f a = 0 := not_iff_comm.1 mem_support_iff.symm #align finsupp.not_mem_support_iff Finsupp.not_mem_support_iff @[simp, norm_cast] theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0 := by rw [← coe_zero, DFunLike.coe_fn_eq] #align finsupp.coe_eq_zero Finsupp.coe_eq_zero theorem ext_iff' {f g : α →₀ M} : f = g ↔ f.support = g.support ∧ ∀ x ∈ f.support, f x = g x := ⟨fun h => h ▸ ⟨rfl, fun _ _ => rfl⟩, fun ⟨h₁, h₂⟩ => ext fun a => by classical exact if h : a ∈ f.support then h₂ a h else by have hf : f a = 0 := not_mem_support_iff.1 h have hg : g a = 0 := by rwa [h₁, not_mem_support_iff] at h rw [hf, hg]⟩ #align finsupp.ext_iff' Finsupp.ext_iff' @[simp] theorem support_eq_empty {f : α →₀ M} : f.support = ∅ ↔ f = 0 := mod_cast @Function.support_eq_empty_iff _ _ _ f #align finsupp.support_eq_empty Finsupp.support_eq_empty theorem support_nonempty_iff {f : α →₀ M} : f.support.Nonempty ↔ f ≠ 0 := by simp only [Finsupp.support_eq_empty, Finset.nonempty_iff_ne_empty, Ne] #align finsupp.support_nonempty_iff Finsupp.support_nonempty_iff #align finsupp.nonzero_iff_exists Finsupp.ne_iff
Mathlib/Data/Finsupp/Defs.lean
209
209
theorem card_support_eq_zero {f : α →₀ M} : card f.support = 0 ↔ f = 0 := by
simp
1
2.718282
0
0.2
5
268
import Mathlib.Algebra.Group.Indicator import Mathlib.Algebra.Group.Submonoid.Basic import Mathlib.Data.Set.Finite #align_import data.finsupp.defs from "leanprover-community/mathlib"@"842328d9df7e96fd90fc424e115679c15fb23a71" noncomputable section open Finset Function variable {α β γ ι M M' N P G H R S : Type*} structure Finsupp (α : Type*) (M : Type*) [Zero M] where support : Finset α toFun : α → M mem_support_toFun : ∀ a, a ∈ support ↔ toFun a ≠ 0 #align finsupp Finsupp #align finsupp.support Finsupp.support #align finsupp.to_fun Finsupp.toFun #align finsupp.mem_support_to_fun Finsupp.mem_support_toFun @[inherit_doc] infixr:25 " →₀ " => Finsupp namespace Finsupp section Basic variable [Zero M] instance instFunLike : FunLike (α →₀ M) α M := ⟨toFun, by rintro ⟨s, f, hf⟩ ⟨t, g, hg⟩ (rfl : f = g) congr ext a exact (hf _).trans (hg _).symm⟩ #align finsupp.fun_like Finsupp.instFunLike instance instCoeFun : CoeFun (α →₀ M) fun _ => α → M := inferInstance #align finsupp.has_coe_to_fun Finsupp.instCoeFun @[ext] theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ h #align finsupp.ext Finsupp.ext #align finsupp.ext_iff DFunLike.ext_iff lemma ne_iff {f g : α →₀ M} : f ≠ g ↔ ∃ a, f a ≠ g a := DFunLike.ne_iff #align finsupp.coe_fn_inj DFunLike.coe_fn_eq #align finsupp.coe_fn_injective DFunLike.coe_injective #align finsupp.congr_fun DFunLike.congr_fun @[simp, norm_cast] theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f := rfl #align finsupp.coe_mk Finsupp.coe_mk instance instZero : Zero (α →₀ M) := ⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩ #align finsupp.has_zero Finsupp.instZero @[simp, norm_cast] lemma coe_zero : ⇑(0 : α →₀ M) = 0 := rfl #align finsupp.coe_zero Finsupp.coe_zero theorem zero_apply {a : α} : (0 : α →₀ M) a = 0 := rfl #align finsupp.zero_apply Finsupp.zero_apply @[simp] theorem support_zero : (0 : α →₀ M).support = ∅ := rfl #align finsupp.support_zero Finsupp.support_zero instance instInhabited : Inhabited (α →₀ M) := ⟨0⟩ #align finsupp.inhabited Finsupp.instInhabited @[simp] theorem mem_support_iff {f : α →₀ M} : ∀ {a : α}, a ∈ f.support ↔ f a ≠ 0 := @(f.mem_support_toFun) #align finsupp.mem_support_iff Finsupp.mem_support_iff @[simp, norm_cast] theorem fun_support_eq (f : α →₀ M) : Function.support f = f.support := Set.ext fun _x => mem_support_iff.symm #align finsupp.fun_support_eq Finsupp.fun_support_eq theorem not_mem_support_iff {f : α →₀ M} {a} : a ∉ f.support ↔ f a = 0 := not_iff_comm.1 mem_support_iff.symm #align finsupp.not_mem_support_iff Finsupp.not_mem_support_iff @[simp, norm_cast] theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0 := by rw [← coe_zero, DFunLike.coe_fn_eq] #align finsupp.coe_eq_zero Finsupp.coe_eq_zero theorem ext_iff' {f g : α →₀ M} : f = g ↔ f.support = g.support ∧ ∀ x ∈ f.support, f x = g x := ⟨fun h => h ▸ ⟨rfl, fun _ _ => rfl⟩, fun ⟨h₁, h₂⟩ => ext fun a => by classical exact if h : a ∈ f.support then h₂ a h else by have hf : f a = 0 := not_mem_support_iff.1 h have hg : g a = 0 := by rwa [h₁, not_mem_support_iff] at h rw [hf, hg]⟩ #align finsupp.ext_iff' Finsupp.ext_iff' @[simp] theorem support_eq_empty {f : α →₀ M} : f.support = ∅ ↔ f = 0 := mod_cast @Function.support_eq_empty_iff _ _ _ f #align finsupp.support_eq_empty Finsupp.support_eq_empty theorem support_nonempty_iff {f : α →₀ M} : f.support.Nonempty ↔ f ≠ 0 := by simp only [Finsupp.support_eq_empty, Finset.nonempty_iff_ne_empty, Ne] #align finsupp.support_nonempty_iff Finsupp.support_nonempty_iff #align finsupp.nonzero_iff_exists Finsupp.ne_iff theorem card_support_eq_zero {f : α →₀ M} : card f.support = 0 ↔ f = 0 := by simp #align finsupp.card_support_eq_zero Finsupp.card_support_eq_zero instance instDecidableEq [DecidableEq α] [DecidableEq M] : DecidableEq (α →₀ M) := fun f g => decidable_of_iff (f.support = g.support ∧ ∀ a ∈ f.support, f a = g a) ext_iff'.symm #align finsupp.decidable_eq Finsupp.instDecidableEq theorem finite_support (f : α →₀ M) : Set.Finite (Function.support f) := f.fun_support_eq.symm ▸ f.support.finite_toSet #align finsupp.finite_support Finsupp.finite_support
Mathlib/Data/Finsupp/Defs.lean
220
222
theorem support_subset_iff {s : Set α} {f : α →₀ M} : ↑f.support ⊆ s ↔ ∀ a ∉ s, f a = 0 := by
simp only [Set.subset_def, mem_coe, mem_support_iff]; exact forall_congr' fun a => not_imp_comm
1
2.718282
0
0.2
5
268
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq
Mathlib/Topology/Order/NhdsSet.lean
36
37
theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by
rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi]
1
2.718282
0
0.2
5
269
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi] theorem nhdsSet_Iic : 𝓝ˢ (Iic a) = 𝓝 a ⊔ 𝓟 (Iio a) := nhdsSet_Ici (α := αᵒᵈ)
Mathlib/Topology/Order/NhdsSet.lean
41
42
theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b) := by
rw [← Ioo_insert_left h, nhdsSet_insert, nhdsSet_Ioo]
1
2.718282
0
0.2
5
269
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi] theorem nhdsSet_Iic : 𝓝ˢ (Iic a) = 𝓝 a ⊔ 𝓟 (Iio a) := nhdsSet_Ici (α := αᵒᵈ) theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_left h, nhdsSet_insert, nhdsSet_Ioo]
Mathlib/Topology/Order/NhdsSet.lean
44
45
theorem nhdsSet_Ioc (h : a < b) : 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b) := by
rw [← Ioo_insert_right h, nhdsSet_insert, nhdsSet_Ioo]
1
2.718282
0
0.2
5
269
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi] theorem nhdsSet_Iic : 𝓝ˢ (Iic a) = 𝓝 a ⊔ 𝓟 (Iio a) := nhdsSet_Ici (α := αᵒᵈ) theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_left h, nhdsSet_insert, nhdsSet_Ioo] theorem nhdsSet_Ioc (h : a < b) : 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_right h, nhdsSet_insert, nhdsSet_Ioo]
Mathlib/Topology/Order/NhdsSet.lean
47
50
theorem nhdsSet_Icc (h : a ≤ b) : 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b) := by
rcases h.eq_or_lt with rfl | hlt · simp · rw [← Ioc_insert_left h, nhdsSet_insert, nhdsSet_Ioc hlt, sup_assoc]
3
20.085537
1
0.2
5
269
import Mathlib.Topology.Order.Basic open Set Filter OrderDual open scoped Topology section OrderClosedTopology variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] {a b c d : α} @[simp] theorem nhdsSet_Ioi : 𝓝ˢ (Ioi a) = 𝓟 (Ioi a) := isOpen_Ioi.nhdsSet_eq @[simp] theorem nhdsSet_Iio : 𝓝ˢ (Iio a) = 𝓟 (Iio a) := isOpen_Iio.nhdsSet_eq @[simp] theorem nhdsSet_Ioo : 𝓝ˢ (Ioo a b) = 𝓟 (Ioo a b) := isOpen_Ioo.nhdsSet_eq theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a) := by rw [← Ioi_insert, nhdsSet_insert, nhdsSet_Ioi] theorem nhdsSet_Iic : 𝓝ˢ (Iic a) = 𝓝 a ⊔ 𝓟 (Iio a) := nhdsSet_Ici (α := αᵒᵈ) theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_left h, nhdsSet_insert, nhdsSet_Ioo] theorem nhdsSet_Ioc (h : a < b) : 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b) := by rw [← Ioo_insert_right h, nhdsSet_insert, nhdsSet_Ioo] theorem nhdsSet_Icc (h : a ≤ b) : 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b) := by rcases h.eq_or_lt with rfl | hlt · simp · rw [← Ioc_insert_left h, nhdsSet_insert, nhdsSet_Ioc hlt, sup_assoc] @[simp]
Mathlib/Topology/Order/NhdsSet.lean
57
58
theorem Ioi_mem_nhdsSet_Ici_iff : Ioi a ∈ 𝓝ˢ (Ici b) ↔ a < b := by
rw [isOpen_Ioi.mem_nhdsSet, Ici_subset_Ioi]
1
2.718282
0
0.2
5
269
import Mathlib.Data.Multiset.Bind #align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Multiset variable {α β : Type*} section Fold variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold : α → Multiset α → α := foldr op (left_comm _ hc.comm ha.assoc) #align multiset.fold Multiset.fold theorem fold_eq_foldr (b : α) (s : Multiset α) : fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s := rfl #align multiset.fold_eq_foldr Multiset.fold_eq_foldr @[simp] theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b := rfl #align multiset.coe_fold_r Multiset.coe_fold_r theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b := (coe_foldr_swap op _ b l).trans <| by simp [hc.comm] #align multiset.coe_fold_l Multiset.coe_fold_l theorem fold_eq_foldl (b : α) (s : Multiset α) : fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s := Quot.inductionOn s fun _ => coe_fold_l _ _ _ #align multiset.fold_eq_foldl Multiset.fold_eq_foldl @[simp] theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b := rfl #align multiset.fold_zero Multiset.fold_zero @[simp] theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b := foldr_cons _ _ #align multiset.fold_cons_left Multiset.fold_cons_left
Mathlib/Data/Multiset/Fold.lean
63
64
theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by
simp [hc.comm]
1
2.718282
0
0.2
5
270
import Mathlib.Data.Multiset.Bind #align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Multiset variable {α β : Type*} section Fold variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold : α → Multiset α → α := foldr op (left_comm _ hc.comm ha.assoc) #align multiset.fold Multiset.fold theorem fold_eq_foldr (b : α) (s : Multiset α) : fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s := rfl #align multiset.fold_eq_foldr Multiset.fold_eq_foldr @[simp] theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b := rfl #align multiset.coe_fold_r Multiset.coe_fold_r theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b := (coe_foldr_swap op _ b l).trans <| by simp [hc.comm] #align multiset.coe_fold_l Multiset.coe_fold_l theorem fold_eq_foldl (b : α) (s : Multiset α) : fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s := Quot.inductionOn s fun _ => coe_fold_l _ _ _ #align multiset.fold_eq_foldl Multiset.fold_eq_foldl @[simp] theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b := rfl #align multiset.fold_zero Multiset.fold_zero @[simp] theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b := foldr_cons _ _ #align multiset.fold_cons_left Multiset.fold_cons_left theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by simp [hc.comm] #align multiset.fold_cons_right Multiset.fold_cons_right
Mathlib/Data/Multiset/Fold.lean
67
68
theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a) := by
rw [fold_eq_foldl, foldl_cons, ← fold_eq_foldl]
1
2.718282
0
0.2
5
270
import Mathlib.Data.Multiset.Bind #align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Multiset variable {α β : Type*} section Fold variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold : α → Multiset α → α := foldr op (left_comm _ hc.comm ha.assoc) #align multiset.fold Multiset.fold theorem fold_eq_foldr (b : α) (s : Multiset α) : fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s := rfl #align multiset.fold_eq_foldr Multiset.fold_eq_foldr @[simp] theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b := rfl #align multiset.coe_fold_r Multiset.coe_fold_r theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b := (coe_foldr_swap op _ b l).trans <| by simp [hc.comm] #align multiset.coe_fold_l Multiset.coe_fold_l theorem fold_eq_foldl (b : α) (s : Multiset α) : fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s := Quot.inductionOn s fun _ => coe_fold_l _ _ _ #align multiset.fold_eq_foldl Multiset.fold_eq_foldl @[simp] theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b := rfl #align multiset.fold_zero Multiset.fold_zero @[simp] theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b := foldr_cons _ _ #align multiset.fold_cons_left Multiset.fold_cons_left theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by simp [hc.comm] #align multiset.fold_cons_right Multiset.fold_cons_right theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a) := by rw [fold_eq_foldl, foldl_cons, ← fold_eq_foldl] #align multiset.fold_cons'_right Multiset.fold_cons'_right
Mathlib/Data/Multiset/Fold.lean
71
72
theorem fold_cons'_left (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (a * b) := by
rw [fold_cons'_right, hc.comm]
1
2.718282
0
0.2
5
270
import Mathlib.Data.Multiset.Bind #align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Multiset variable {α β : Type*} section Fold variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold : α → Multiset α → α := foldr op (left_comm _ hc.comm ha.assoc) #align multiset.fold Multiset.fold theorem fold_eq_foldr (b : α) (s : Multiset α) : fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s := rfl #align multiset.fold_eq_foldr Multiset.fold_eq_foldr @[simp] theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b := rfl #align multiset.coe_fold_r Multiset.coe_fold_r theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b := (coe_foldr_swap op _ b l).trans <| by simp [hc.comm] #align multiset.coe_fold_l Multiset.coe_fold_l theorem fold_eq_foldl (b : α) (s : Multiset α) : fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s := Quot.inductionOn s fun _ => coe_fold_l _ _ _ #align multiset.fold_eq_foldl Multiset.fold_eq_foldl @[simp] theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b := rfl #align multiset.fold_zero Multiset.fold_zero @[simp] theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b := foldr_cons _ _ #align multiset.fold_cons_left Multiset.fold_cons_left theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by simp [hc.comm] #align multiset.fold_cons_right Multiset.fold_cons_right theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a) := by rw [fold_eq_foldl, foldl_cons, ← fold_eq_foldl] #align multiset.fold_cons'_right Multiset.fold_cons'_right theorem fold_cons'_left (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (a * b) := by rw [fold_cons'_right, hc.comm] #align multiset.fold_cons'_left Multiset.fold_cons'_left theorem fold_add (b₁ b₂ : α) (s₁ s₂ : Multiset α) : (s₁ + s₂).fold op (b₁ * b₂) = s₁.fold op b₁ * s₂.fold op b₂ := Multiset.induction_on s₂ (by rw [add_zero, fold_zero, ← fold_cons'_right, ← fold_cons_right op]) (fun a b h => by rw [fold_cons_left, add_cons, fold_cons_left, h, ← ha.assoc, hc.comm a, ha.assoc]) #align multiset.fold_add Multiset.fold_add
Mathlib/Data/Multiset/Fold.lean
82
87
theorem fold_bind {ι : Type*} (s : Multiset ι) (t : ι → Multiset α) (b : ι → α) (b₀ : α) : (s.bind t).fold op ((s.map b).fold op b₀) = (s.map fun i => (t i).fold op (b i)).fold op b₀ := by
induction' s using Multiset.induction_on with a ha ih · rw [zero_bind, map_zero, map_zero, fold_zero] · rw [cons_bind, map_cons, map_cons, fold_cons_left, fold_cons_left, fold_add, ih]
3
20.085537
1
0.2
5
270
import Mathlib.Data.Multiset.Bind #align_import data.multiset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Multiset variable {α β : Type*} section Fold variable (op : α → α → α) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold : α → Multiset α → α := foldr op (left_comm _ hc.comm ha.assoc) #align multiset.fold Multiset.fold theorem fold_eq_foldr (b : α) (s : Multiset α) : fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s := rfl #align multiset.fold_eq_foldr Multiset.fold_eq_foldr @[simp] theorem coe_fold_r (b : α) (l : List α) : fold op b l = l.foldr op b := rfl #align multiset.coe_fold_r Multiset.coe_fold_r theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b := (coe_foldr_swap op _ b l).trans <| by simp [hc.comm] #align multiset.coe_fold_l Multiset.coe_fold_l theorem fold_eq_foldl (b : α) (s : Multiset α) : fold op b s = foldl op (right_comm _ hc.comm ha.assoc) b s := Quot.inductionOn s fun _ => coe_fold_l _ _ _ #align multiset.fold_eq_foldl Multiset.fold_eq_foldl @[simp] theorem fold_zero (b : α) : (0 : Multiset α).fold op b = b := rfl #align multiset.fold_zero Multiset.fold_zero @[simp] theorem fold_cons_left : ∀ (b a : α) (s : Multiset α), (a ::ₘ s).fold op b = a * s.fold op b := foldr_cons _ _ #align multiset.fold_cons_left Multiset.fold_cons_left theorem fold_cons_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op b * a := by simp [hc.comm] #align multiset.fold_cons_right Multiset.fold_cons_right theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a) := by rw [fold_eq_foldl, foldl_cons, ← fold_eq_foldl] #align multiset.fold_cons'_right Multiset.fold_cons'_right theorem fold_cons'_left (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (a * b) := by rw [fold_cons'_right, hc.comm] #align multiset.fold_cons'_left Multiset.fold_cons'_left theorem fold_add (b₁ b₂ : α) (s₁ s₂ : Multiset α) : (s₁ + s₂).fold op (b₁ * b₂) = s₁.fold op b₁ * s₂.fold op b₂ := Multiset.induction_on s₂ (by rw [add_zero, fold_zero, ← fold_cons'_right, ← fold_cons_right op]) (fun a b h => by rw [fold_cons_left, add_cons, fold_cons_left, h, ← ha.assoc, hc.comm a, ha.assoc]) #align multiset.fold_add Multiset.fold_add theorem fold_bind {ι : Type*} (s : Multiset ι) (t : ι → Multiset α) (b : ι → α) (b₀ : α) : (s.bind t).fold op ((s.map b).fold op b₀) = (s.map fun i => (t i).fold op (b i)).fold op b₀ := by induction' s using Multiset.induction_on with a ha ih · rw [zero_bind, map_zero, map_zero, fold_zero] · rw [cons_bind, map_cons, map_cons, fold_cons_left, fold_cons_left, fold_add, ih] #align multiset.fold_bind Multiset.fold_bind theorem fold_singleton (b a : α) : ({a} : Multiset α).fold op b = a * b := foldr_singleton _ _ _ _ #align multiset.fold_singleton Multiset.fold_singleton theorem fold_distrib {f g : β → α} (u₁ u₂ : α) (s : Multiset β) : (s.map fun x => f x * g x).fold op (u₁ * u₂) = (s.map f).fold op u₁ * (s.map g).fold op u₂ := Multiset.induction_on s (by simp) (fun a b h => by rw [map_cons, fold_cons_left, h, map_cons, fold_cons_left, map_cons, fold_cons_right, ha.assoc, ← ha.assoc (g a), hc.comm (g a), ha.assoc, hc.comm (g a), ha.assoc]) #align multiset.fold_distrib Multiset.fold_distrib theorem fold_hom {op' : β → β → β} [Std.Commutative op'] [Std.Associative op'] {m : α → β} (hm : ∀ x y, m (op x y) = op' (m x) (m y)) (b : α) (s : Multiset α) : (s.map m).fold op' (m b) = m (s.fold op b) := Multiset.induction_on s (by simp) (by simp (config := { contextual := true }) [hm]) #align multiset.fold_hom Multiset.fold_hom
Mathlib/Data/Multiset/Fold.lean
108
110
theorem fold_union_inter [DecidableEq α] (s₁ s₂ : Multiset α) (b₁ b₂ : α) : ((s₁ ∪ s₂).fold op b₁ * (s₁ ∩ s₂).fold op b₂) = s₁.fold op b₁ * s₂.fold op b₂ := by
rw [← fold_add op, union_add_inter, fold_add op]
1
2.718282
0
0.2
5
270
import Mathlib.Topology.Algebra.InfiniteSum.Defs import Mathlib.Data.Fintype.BigOperators import Mathlib.Topology.Algebra.Monoid noncomputable section open Filter Finset Function open scoped Topology variable {α β γ δ : Type*} section HasProd variable [CommMonoid α] [TopologicalSpace α] variable {f g : β → α} {a b : α} {s : Finset β} @[to_additive "Constant zero function has sum `0`"]
Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
35
35
theorem hasProd_one : HasProd (fun _ ↦ 1 : β → α) 1 := by
simp [HasProd, tendsto_const_nhds]
1
2.718282
0
0.2
5
271
import Mathlib.Topology.Algebra.InfiniteSum.Defs import Mathlib.Data.Fintype.BigOperators import Mathlib.Topology.Algebra.Monoid noncomputable section open Filter Finset Function open scoped Topology variable {α β γ δ : Type*} section HasProd variable [CommMonoid α] [TopologicalSpace α] variable {f g : β → α} {a b : α} {s : Finset β} @[to_additive "Constant zero function has sum `0`"] theorem hasProd_one : HasProd (fun _ ↦ 1 : β → α) 1 := by simp [HasProd, tendsto_const_nhds] #align has_sum_zero hasSum_zero @[to_additive]
Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
39
40
theorem hasProd_empty [IsEmpty β] : HasProd f 1 := by
convert @hasProd_one α β _ _
1
2.718282
0
0.2
5
271
import Mathlib.Topology.Algebra.InfiniteSum.Defs import Mathlib.Data.Fintype.BigOperators import Mathlib.Topology.Algebra.Monoid noncomputable section open Filter Finset Function open scoped Topology variable {α β γ δ : Type*} section HasProd variable [CommMonoid α] [TopologicalSpace α] variable {f g : β → α} {a b : α} {s : Finset β} @[to_additive "Constant zero function has sum `0`"] theorem hasProd_one : HasProd (fun _ ↦ 1 : β → α) 1 := by simp [HasProd, tendsto_const_nhds] #align has_sum_zero hasSum_zero @[to_additive] theorem hasProd_empty [IsEmpty β] : HasProd f 1 := by convert @hasProd_one α β _ _ #align has_sum_empty hasSum_empty @[to_additive] theorem multipliable_one : Multipliable (fun _ ↦ 1 : β → α) := hasProd_one.multipliable #align summable_zero summable_zero @[to_additive] theorem multipliable_empty [IsEmpty β] : Multipliable f := hasProd_empty.multipliable #align summable_empty summable_empty @[to_additive] theorem multipliable_congr (hfg : ∀ b, f b = g b) : Multipliable f ↔ Multipliable g := iff_of_eq (congr_arg Multipliable <| funext hfg) #align summable_congr summable_congr @[to_additive] theorem Multipliable.congr (hf : Multipliable f) (hfg : ∀ b, f b = g b) : Multipliable g := (multipliable_congr hfg).mp hf #align summable.congr Summable.congr @[to_additive] lemma HasProd.congr_fun (hf : HasProd f a) (h : ∀ x : β, g x = f x) : HasProd g a := (funext h : g = f) ▸ hf @[to_additive] theorem HasProd.hasProd_of_prod_eq {g : γ → α} (h_eq : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b) (hf : HasProd g a) : HasProd f a := le_trans (map_atTop_finset_prod_le_of_prod_eq h_eq) hf #align has_sum.has_sum_of_sum_eq HasSum.hasSum_of_sum_eq @[to_additive] theorem hasProd_iff_hasProd {g : γ → α} (h₁ : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b) (h₂ : ∀ v : Finset β, ∃ u : Finset γ, ∀ u', u ⊆ u' → ∃ v', v ⊆ v' ∧ ∏ b ∈ v', f b = ∏ x ∈ u', g x) : HasProd f a ↔ HasProd g a := ⟨HasProd.hasProd_of_prod_eq h₂, HasProd.hasProd_of_prod_eq h₁⟩ #align has_sum_iff_has_sum hasSum_iff_hasSum @[to_additive] theorem Function.Injective.multipliable_iff {g : γ → β} (hg : Injective g) (hf : ∀ x ∉ Set.range g, f x = 1) : Multipliable (f ∘ g) ↔ Multipliable f := exists_congr fun _ ↦ hg.hasProd_iff hf #align function.injective.summable_iff Function.Injective.summable_iff @[to_additive (attr := simp)] theorem hasProd_extend_one {g : β → γ} (hg : Injective g) : HasProd (extend g f 1) a ↔ HasProd f a := by rw [← hg.hasProd_iff, extend_comp hg] exact extend_apply' _ _ @[to_additive (attr := simp)] theorem multipliable_extend_one {g : β → γ} (hg : Injective g) : Multipliable (extend g f 1) ↔ Multipliable f := exists_congr fun _ ↦ hasProd_extend_one hg @[to_additive]
Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
101
104
theorem hasProd_subtype_iff_mulIndicator {s : Set β} : HasProd (f ∘ (↑) : s → α) a ↔ HasProd (s.mulIndicator f) a := by
rw [← Set.mulIndicator_range_comp, Subtype.range_coe, hasProd_subtype_iff_of_mulSupport_subset Set.mulSupport_mulIndicator_subset]
2
7.389056
1
0.2
5
271
import Mathlib.Topology.Algebra.InfiniteSum.Defs import Mathlib.Data.Fintype.BigOperators import Mathlib.Topology.Algebra.Monoid noncomputable section open Filter Finset Function open scoped Topology variable {α β γ δ : Type*} section HasProd variable [CommMonoid α] [TopologicalSpace α] variable {f g : β → α} {a b : α} {s : Finset β} @[to_additive "Constant zero function has sum `0`"] theorem hasProd_one : HasProd (fun _ ↦ 1 : β → α) 1 := by simp [HasProd, tendsto_const_nhds] #align has_sum_zero hasSum_zero @[to_additive] theorem hasProd_empty [IsEmpty β] : HasProd f 1 := by convert @hasProd_one α β _ _ #align has_sum_empty hasSum_empty @[to_additive] theorem multipliable_one : Multipliable (fun _ ↦ 1 : β → α) := hasProd_one.multipliable #align summable_zero summable_zero @[to_additive] theorem multipliable_empty [IsEmpty β] : Multipliable f := hasProd_empty.multipliable #align summable_empty summable_empty @[to_additive] theorem multipliable_congr (hfg : ∀ b, f b = g b) : Multipliable f ↔ Multipliable g := iff_of_eq (congr_arg Multipliable <| funext hfg) #align summable_congr summable_congr @[to_additive] theorem Multipliable.congr (hf : Multipliable f) (hfg : ∀ b, f b = g b) : Multipliable g := (multipliable_congr hfg).mp hf #align summable.congr Summable.congr @[to_additive] lemma HasProd.congr_fun (hf : HasProd f a) (h : ∀ x : β, g x = f x) : HasProd g a := (funext h : g = f) ▸ hf @[to_additive] theorem HasProd.hasProd_of_prod_eq {g : γ → α} (h_eq : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b) (hf : HasProd g a) : HasProd f a := le_trans (map_atTop_finset_prod_le_of_prod_eq h_eq) hf #align has_sum.has_sum_of_sum_eq HasSum.hasSum_of_sum_eq @[to_additive] theorem hasProd_iff_hasProd {g : γ → α} (h₁ : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b) (h₂ : ∀ v : Finset β, ∃ u : Finset γ, ∀ u', u ⊆ u' → ∃ v', v ⊆ v' ∧ ∏ b ∈ v', f b = ∏ x ∈ u', g x) : HasProd f a ↔ HasProd g a := ⟨HasProd.hasProd_of_prod_eq h₂, HasProd.hasProd_of_prod_eq h₁⟩ #align has_sum_iff_has_sum hasSum_iff_hasSum @[to_additive] theorem Function.Injective.multipliable_iff {g : γ → β} (hg : Injective g) (hf : ∀ x ∉ Set.range g, f x = 1) : Multipliable (f ∘ g) ↔ Multipliable f := exists_congr fun _ ↦ hg.hasProd_iff hf #align function.injective.summable_iff Function.Injective.summable_iff @[to_additive (attr := simp)] theorem hasProd_extend_one {g : β → γ} (hg : Injective g) : HasProd (extend g f 1) a ↔ HasProd f a := by rw [← hg.hasProd_iff, extend_comp hg] exact extend_apply' _ _ @[to_additive (attr := simp)] theorem multipliable_extend_one {g : β → γ} (hg : Injective g) : Multipliable (extend g f 1) ↔ Multipliable f := exists_congr fun _ ↦ hasProd_extend_one hg @[to_additive] theorem hasProd_subtype_iff_mulIndicator {s : Set β} : HasProd (f ∘ (↑) : s → α) a ↔ HasProd (s.mulIndicator f) a := by rw [← Set.mulIndicator_range_comp, Subtype.range_coe, hasProd_subtype_iff_of_mulSupport_subset Set.mulSupport_mulIndicator_subset] #align has_sum_subtype_iff_indicator hasSum_subtype_iff_indicator @[to_additive] theorem multipliable_subtype_iff_mulIndicator {s : Set β} : Multipliable (f ∘ (↑) : s → α) ↔ Multipliable (s.mulIndicator f) := exists_congr fun _ ↦ hasProd_subtype_iff_mulIndicator #align summable_subtype_iff_indicator summable_subtype_iff_indicator @[to_additive (attr := simp)] theorem hasProd_subtype_mulSupport : HasProd (f ∘ (↑) : mulSupport f → α) a ↔ HasProd f a := hasProd_subtype_iff_of_mulSupport_subset <| Set.Subset.refl _ #align has_sum_subtype_support hasSum_subtype_support @[to_additive] protected theorem Finset.multipliable (s : Finset β) (f : β → α) : Multipliable (f ∘ (↑) : (↑s : Set β) → α) := (s.hasProd f).multipliable #align finset.summable Finset.summable @[to_additive] protected theorem Set.Finite.multipliable {s : Set β} (hs : s.Finite) (f : β → α) : Multipliable (f ∘ (↑) : s → α) := by have := hs.toFinset.multipliable f rwa [hs.coe_toFinset] at this #align set.finite.summable Set.Finite.summable @[to_additive]
Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
132
133
theorem multipliable_of_finite_mulSupport (h : (mulSupport f).Finite) : Multipliable f := by
apply multipliable_of_ne_finset_one (s := h.toFinset); simp
1
2.718282
0
0.2
5
271
import Mathlib.Topology.Algebra.InfiniteSum.Defs import Mathlib.Data.Fintype.BigOperators import Mathlib.Topology.Algebra.Monoid noncomputable section open Filter Finset Function open scoped Topology variable {α β γ δ : Type*} section tprod variable [CommMonoid α] [TopologicalSpace α] {f g : β → α} {a a₁ a₂ : α} @[to_additive]
Mathlib/Topology/Algebra/InfiniteSum/Basic.lean
387
388
theorem tprod_congr_set_coe (f : β → α) {s t : Set β} (h : s = t) : ∏' x : s, f x = ∏' x : t, f x := by
rw [h]
1
2.718282
0
0.2
5
271
import Mathlib.Order.Filter.SmallSets import Mathlib.Tactic.Monotonicity import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.NhdsSet import Mathlib.Algebra.Group.Defs #align_import topology.uniform_space.basic from "leanprover-community/mathlib"@"195fcd60ff2bfe392543bceb0ec2adcdb472db4c" open Set Filter Topology universe u v ua ub uc ud variable {α : Type ua} {β : Type ub} {γ : Type uc} {δ : Type ud} {ι : Sort*} def idRel {α : Type*} := { p : α × α | p.1 = p.2 } #align id_rel idRel @[simp] theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b := Iff.rfl #align mem_id_rel mem_idRel @[simp]
Mathlib/Topology/UniformSpace/Basic.lean
140
141
theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s := by
simp [subset_def]
1
2.718282
0
0.2
5
272
import Mathlib.Order.Filter.SmallSets import Mathlib.Tactic.Monotonicity import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.NhdsSet import Mathlib.Algebra.Group.Defs #align_import topology.uniform_space.basic from "leanprover-community/mathlib"@"195fcd60ff2bfe392543bceb0ec2adcdb472db4c" open Set Filter Topology universe u v ua ub uc ud variable {α : Type ua} {β : Type ub} {γ : Type uc} {δ : Type ud} {ι : Sort*} def idRel {α : Type*} := { p : α × α | p.1 = p.2 } #align id_rel idRel @[simp] theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b := Iff.rfl #align mem_id_rel mem_idRel @[simp] theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s := by simp [subset_def] #align id_rel_subset idRel_subset def compRel (r₁ r₂ : Set (α × α)) := { p : α × α | ∃ z : α, (p.1, z) ∈ r₁ ∧ (z, p.2) ∈ r₂ } #align comp_rel compRel @[inherit_doc] scoped[Uniformity] infixl:62 " ○ " => compRel open Uniformity @[simp] theorem mem_compRel {α : Type u} {r₁ r₂ : Set (α × α)} {x y : α} : (x, y) ∈ r₁ ○ r₂ ↔ ∃ z, (x, z) ∈ r₁ ∧ (z, y) ∈ r₂ := Iff.rfl #align mem_comp_rel mem_compRel @[simp] theorem swap_idRel : Prod.swap '' idRel = @idRel α := Set.ext fun ⟨a, b⟩ => by simpa [image_swap_eq_preimage_swap] using eq_comm #align swap_id_rel swap_idRel theorem Monotone.compRel [Preorder β] {f g : β → Set (α × α)} (hf : Monotone f) (hg : Monotone g) : Monotone fun x => f x ○ g x := fun _ _ h _ ⟨z, h₁, h₂⟩ => ⟨z, hf h h₁, hg h h₂⟩ #align monotone.comp_rel Monotone.compRel @[mono] theorem compRel_mono {f g h k : Set (α × α)} (h₁ : f ⊆ h) (h₂ : g ⊆ k) : f ○ g ⊆ h ○ k := fun _ ⟨z, h, h'⟩ => ⟨z, h₁ h, h₂ h'⟩ #align comp_rel_mono compRel_mono theorem prod_mk_mem_compRel {a b c : α} {s t : Set (α × α)} (h₁ : (a, c) ∈ s) (h₂ : (c, b) ∈ t) : (a, b) ∈ s ○ t := ⟨c, h₁, h₂⟩ #align prod_mk_mem_comp_rel prod_mk_mem_compRel @[simp] theorem id_compRel {r : Set (α × α)} : idRel ○ r = r := Set.ext fun ⟨a, b⟩ => by simp #align id_comp_rel id_compRel
Mathlib/Topology/UniformSpace/Basic.lean
183
184
theorem compRel_assoc {r s t : Set (α × α)} : r ○ s ○ t = r ○ (s ○ t) := by
ext ⟨a, b⟩; simp only [mem_compRel]; tauto
1
2.718282
0
0.2
5
272
import Mathlib.Order.Filter.SmallSets import Mathlib.Tactic.Monotonicity import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.NhdsSet import Mathlib.Algebra.Group.Defs #align_import topology.uniform_space.basic from "leanprover-community/mathlib"@"195fcd60ff2bfe392543bceb0ec2adcdb472db4c" open Set Filter Topology universe u v ua ub uc ud variable {α : Type ua} {β : Type ub} {γ : Type uc} {δ : Type ud} {ι : Sort*} def idRel {α : Type*} := { p : α × α | p.1 = p.2 } #align id_rel idRel @[simp] theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b := Iff.rfl #align mem_id_rel mem_idRel @[simp] theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s := by simp [subset_def] #align id_rel_subset idRel_subset def compRel (r₁ r₂ : Set (α × α)) := { p : α × α | ∃ z : α, (p.1, z) ∈ r₁ ∧ (z, p.2) ∈ r₂ } #align comp_rel compRel @[inherit_doc] scoped[Uniformity] infixl:62 " ○ " => compRel open Uniformity @[simp] theorem mem_compRel {α : Type u} {r₁ r₂ : Set (α × α)} {x y : α} : (x, y) ∈ r₁ ○ r₂ ↔ ∃ z, (x, z) ∈ r₁ ∧ (z, y) ∈ r₂ := Iff.rfl #align mem_comp_rel mem_compRel @[simp] theorem swap_idRel : Prod.swap '' idRel = @idRel α := Set.ext fun ⟨a, b⟩ => by simpa [image_swap_eq_preimage_swap] using eq_comm #align swap_id_rel swap_idRel theorem Monotone.compRel [Preorder β] {f g : β → Set (α × α)} (hf : Monotone f) (hg : Monotone g) : Monotone fun x => f x ○ g x := fun _ _ h _ ⟨z, h₁, h₂⟩ => ⟨z, hf h h₁, hg h h₂⟩ #align monotone.comp_rel Monotone.compRel @[mono] theorem compRel_mono {f g h k : Set (α × α)} (h₁ : f ⊆ h) (h₂ : g ⊆ k) : f ○ g ⊆ h ○ k := fun _ ⟨z, h, h'⟩ => ⟨z, h₁ h, h₂ h'⟩ #align comp_rel_mono compRel_mono theorem prod_mk_mem_compRel {a b c : α} {s t : Set (α × α)} (h₁ : (a, c) ∈ s) (h₂ : (c, b) ∈ t) : (a, b) ∈ s ○ t := ⟨c, h₁, h₂⟩ #align prod_mk_mem_comp_rel prod_mk_mem_compRel @[simp] theorem id_compRel {r : Set (α × α)} : idRel ○ r = r := Set.ext fun ⟨a, b⟩ => by simp #align id_comp_rel id_compRel theorem compRel_assoc {r s t : Set (α × α)} : r ○ s ○ t = r ○ (s ○ t) := by ext ⟨a, b⟩; simp only [mem_compRel]; tauto #align comp_rel_assoc compRel_assoc theorem left_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ t) : s ⊆ s ○ t := fun ⟨_x, y⟩ xy_in => ⟨y, xy_in, h <| rfl⟩ #align left_subset_comp_rel left_subset_compRel theorem right_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ s) : t ⊆ s ○ t := fun ⟨x, _y⟩ xy_in => ⟨x, h <| rfl, xy_in⟩ #align right_subset_comp_rel right_subset_compRel theorem subset_comp_self {s : Set (α × α)} (h : idRel ⊆ s) : s ⊆ s ○ s := left_subset_compRel h #align subset_comp_self subset_comp_self
Mathlib/Topology/UniformSpace/Basic.lean
199
202
theorem subset_iterate_compRel {s t : Set (α × α)} (h : idRel ⊆ s) (n : ℕ) : t ⊆ (s ○ ·)^[n] t := by
induction' n with n ihn generalizing t exacts [Subset.rfl, (right_subset_compRel h).trans ihn]
2
7.389056
1
0.2
5
272
import Mathlib.Order.Filter.SmallSets import Mathlib.Tactic.Monotonicity import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.NhdsSet import Mathlib.Algebra.Group.Defs #align_import topology.uniform_space.basic from "leanprover-community/mathlib"@"195fcd60ff2bfe392543bceb0ec2adcdb472db4c" open Set Filter Topology universe u v ua ub uc ud variable {α : Type ua} {β : Type ub} {γ : Type uc} {δ : Type ud} {ι : Sort*} def idRel {α : Type*} := { p : α × α | p.1 = p.2 } #align id_rel idRel @[simp] theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b := Iff.rfl #align mem_id_rel mem_idRel @[simp] theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s := by simp [subset_def] #align id_rel_subset idRel_subset def compRel (r₁ r₂ : Set (α × α)) := { p : α × α | ∃ z : α, (p.1, z) ∈ r₁ ∧ (z, p.2) ∈ r₂ } #align comp_rel compRel @[inherit_doc] scoped[Uniformity] infixl:62 " ○ " => compRel open Uniformity @[simp] theorem mem_compRel {α : Type u} {r₁ r₂ : Set (α × α)} {x y : α} : (x, y) ∈ r₁ ○ r₂ ↔ ∃ z, (x, z) ∈ r₁ ∧ (z, y) ∈ r₂ := Iff.rfl #align mem_comp_rel mem_compRel @[simp] theorem swap_idRel : Prod.swap '' idRel = @idRel α := Set.ext fun ⟨a, b⟩ => by simpa [image_swap_eq_preimage_swap] using eq_comm #align swap_id_rel swap_idRel theorem Monotone.compRel [Preorder β] {f g : β → Set (α × α)} (hf : Monotone f) (hg : Monotone g) : Monotone fun x => f x ○ g x := fun _ _ h _ ⟨z, h₁, h₂⟩ => ⟨z, hf h h₁, hg h h₂⟩ #align monotone.comp_rel Monotone.compRel @[mono] theorem compRel_mono {f g h k : Set (α × α)} (h₁ : f ⊆ h) (h₂ : g ⊆ k) : f ○ g ⊆ h ○ k := fun _ ⟨z, h, h'⟩ => ⟨z, h₁ h, h₂ h'⟩ #align comp_rel_mono compRel_mono theorem prod_mk_mem_compRel {a b c : α} {s t : Set (α × α)} (h₁ : (a, c) ∈ s) (h₂ : (c, b) ∈ t) : (a, b) ∈ s ○ t := ⟨c, h₁, h₂⟩ #align prod_mk_mem_comp_rel prod_mk_mem_compRel @[simp] theorem id_compRel {r : Set (α × α)} : idRel ○ r = r := Set.ext fun ⟨a, b⟩ => by simp #align id_comp_rel id_compRel theorem compRel_assoc {r s t : Set (α × α)} : r ○ s ○ t = r ○ (s ○ t) := by ext ⟨a, b⟩; simp only [mem_compRel]; tauto #align comp_rel_assoc compRel_assoc theorem left_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ t) : s ⊆ s ○ t := fun ⟨_x, y⟩ xy_in => ⟨y, xy_in, h <| rfl⟩ #align left_subset_comp_rel left_subset_compRel theorem right_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ s) : t ⊆ s ○ t := fun ⟨x, _y⟩ xy_in => ⟨x, h <| rfl, xy_in⟩ #align right_subset_comp_rel right_subset_compRel theorem subset_comp_self {s : Set (α × α)} (h : idRel ⊆ s) : s ⊆ s ○ s := left_subset_compRel h #align subset_comp_self subset_comp_self theorem subset_iterate_compRel {s t : Set (α × α)} (h : idRel ⊆ s) (n : ℕ) : t ⊆ (s ○ ·)^[n] t := by induction' n with n ihn generalizing t exacts [Subset.rfl, (right_subset_compRel h).trans ihn] #align subset_iterate_comp_rel subset_iterate_compRel def SymmetricRel (V : Set (α × α)) : Prop := Prod.swap ⁻¹' V = V #align symmetric_rel SymmetricRel def symmetrizeRel (V : Set (α × α)) : Set (α × α) := V ∩ Prod.swap ⁻¹' V #align symmetrize_rel symmetrizeRel
Mathlib/Topology/UniformSpace/Basic.lean
215
216
theorem symmetric_symmetrizeRel (V : Set (α × α)) : SymmetricRel (symmetrizeRel V) := by
simp [SymmetricRel, symmetrizeRel, preimage_inter, inter_comm, ← preimage_comp]
1
2.718282
0
0.2
5
272
import Mathlib.Order.Filter.SmallSets import Mathlib.Tactic.Monotonicity import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.NhdsSet import Mathlib.Algebra.Group.Defs #align_import topology.uniform_space.basic from "leanprover-community/mathlib"@"195fcd60ff2bfe392543bceb0ec2adcdb472db4c" open Set Filter Topology universe u v ua ub uc ud variable {α : Type ua} {β : Type ub} {γ : Type uc} {δ : Type ud} {ι : Sort*} def idRel {α : Type*} := { p : α × α | p.1 = p.2 } #align id_rel idRel @[simp] theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b := Iff.rfl #align mem_id_rel mem_idRel @[simp] theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s := by simp [subset_def] #align id_rel_subset idRel_subset def compRel (r₁ r₂ : Set (α × α)) := { p : α × α | ∃ z : α, (p.1, z) ∈ r₁ ∧ (z, p.2) ∈ r₂ } #align comp_rel compRel @[inherit_doc] scoped[Uniformity] infixl:62 " ○ " => compRel open Uniformity @[simp] theorem mem_compRel {α : Type u} {r₁ r₂ : Set (α × α)} {x y : α} : (x, y) ∈ r₁ ○ r₂ ↔ ∃ z, (x, z) ∈ r₁ ∧ (z, y) ∈ r₂ := Iff.rfl #align mem_comp_rel mem_compRel @[simp] theorem swap_idRel : Prod.swap '' idRel = @idRel α := Set.ext fun ⟨a, b⟩ => by simpa [image_swap_eq_preimage_swap] using eq_comm #align swap_id_rel swap_idRel theorem Monotone.compRel [Preorder β] {f g : β → Set (α × α)} (hf : Monotone f) (hg : Monotone g) : Monotone fun x => f x ○ g x := fun _ _ h _ ⟨z, h₁, h₂⟩ => ⟨z, hf h h₁, hg h h₂⟩ #align monotone.comp_rel Monotone.compRel @[mono] theorem compRel_mono {f g h k : Set (α × α)} (h₁ : f ⊆ h) (h₂ : g ⊆ k) : f ○ g ⊆ h ○ k := fun _ ⟨z, h, h'⟩ => ⟨z, h₁ h, h₂ h'⟩ #align comp_rel_mono compRel_mono theorem prod_mk_mem_compRel {a b c : α} {s t : Set (α × α)} (h₁ : (a, c) ∈ s) (h₂ : (c, b) ∈ t) : (a, b) ∈ s ○ t := ⟨c, h₁, h₂⟩ #align prod_mk_mem_comp_rel prod_mk_mem_compRel @[simp] theorem id_compRel {r : Set (α × α)} : idRel ○ r = r := Set.ext fun ⟨a, b⟩ => by simp #align id_comp_rel id_compRel theorem compRel_assoc {r s t : Set (α × α)} : r ○ s ○ t = r ○ (s ○ t) := by ext ⟨a, b⟩; simp only [mem_compRel]; tauto #align comp_rel_assoc compRel_assoc theorem left_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ t) : s ⊆ s ○ t := fun ⟨_x, y⟩ xy_in => ⟨y, xy_in, h <| rfl⟩ #align left_subset_comp_rel left_subset_compRel theorem right_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ s) : t ⊆ s ○ t := fun ⟨x, _y⟩ xy_in => ⟨x, h <| rfl, xy_in⟩ #align right_subset_comp_rel right_subset_compRel theorem subset_comp_self {s : Set (α × α)} (h : idRel ⊆ s) : s ⊆ s ○ s := left_subset_compRel h #align subset_comp_self subset_comp_self theorem subset_iterate_compRel {s t : Set (α × α)} (h : idRel ⊆ s) (n : ℕ) : t ⊆ (s ○ ·)^[n] t := by induction' n with n ihn generalizing t exacts [Subset.rfl, (right_subset_compRel h).trans ihn] #align subset_iterate_comp_rel subset_iterate_compRel def SymmetricRel (V : Set (α × α)) : Prop := Prod.swap ⁻¹' V = V #align symmetric_rel SymmetricRel def symmetrizeRel (V : Set (α × α)) : Set (α × α) := V ∩ Prod.swap ⁻¹' V #align symmetrize_rel symmetrizeRel theorem symmetric_symmetrizeRel (V : Set (α × α)) : SymmetricRel (symmetrizeRel V) := by simp [SymmetricRel, symmetrizeRel, preimage_inter, inter_comm, ← preimage_comp] #align symmetric_symmetrize_rel symmetric_symmetrizeRel theorem symmetrizeRel_subset_self (V : Set (α × α)) : symmetrizeRel V ⊆ V := sep_subset _ _ #align symmetrize_rel_subset_self symmetrizeRel_subset_self @[mono] theorem symmetrize_mono {V W : Set (α × α)} (h : V ⊆ W) : symmetrizeRel V ⊆ symmetrizeRel W := inter_subset_inter h <| preimage_mono h #align symmetrize_mono symmetrize_mono theorem SymmetricRel.mk_mem_comm {V : Set (α × α)} (hV : SymmetricRel V) {x y : α} : (x, y) ∈ V ↔ (y, x) ∈ V := Set.ext_iff.1 hV (y, x) #align symmetric_rel.mk_mem_comm SymmetricRel.mk_mem_comm theorem SymmetricRel.eq {U : Set (α × α)} (hU : SymmetricRel U) : Prod.swap ⁻¹' U = U := hU #align symmetric_rel.eq SymmetricRel.eq
Mathlib/Topology/UniformSpace/Basic.lean
237
238
theorem SymmetricRel.inter {U V : Set (α × α)} (hU : SymmetricRel U) (hV : SymmetricRel V) : SymmetricRel (U ∩ V) := by
rw [SymmetricRel, preimage_inter, hU.eq, hV.eq]
1
2.718282
0
0.2
5
272
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2]
Mathlib/Algebra/CharP/Two.lean
29
29
theorem two_eq_zero : (2 : R) = 0 := by
rw [← Nat.cast_two, CharP.cast_eq_zero]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp]
Mathlib/Algebra/CharP/Two.lean
33
33
theorem add_self_eq_zero (x : R) : x + x = 0 := by
rw [← two_smul R x, two_eq_zero, zero_smul]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp] theorem add_self_eq_zero (x : R) : x + x = 0 := by rw [← two_smul R x, two_eq_zero, zero_smul] #align char_two.add_self_eq_zero CharTwo.add_self_eq_zero set_option linter.deprecated false in @[simp]
Mathlib/Algebra/CharP/Two.lean
38
40
theorem bit0_eq_zero : (bit0 : R → R) = 0 := by
funext exact add_self_eq_zero _
2
7.389056
1
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp] theorem add_self_eq_zero (x : R) : x + x = 0 := by rw [← two_smul R x, two_eq_zero, zero_smul] #align char_two.add_self_eq_zero CharTwo.add_self_eq_zero set_option linter.deprecated false in @[simp] theorem bit0_eq_zero : (bit0 : R → R) = 0 := by funext exact add_self_eq_zero _ #align char_two.bit0_eq_zero CharTwo.bit0_eq_zero set_option linter.deprecated false in
Mathlib/Algebra/CharP/Two.lean
44
44
theorem bit0_apply_eq_zero (x : R) : (bit0 x : R) = 0 := by
simp
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp] theorem add_self_eq_zero (x : R) : x + x = 0 := by rw [← two_smul R x, two_eq_zero, zero_smul] #align char_two.add_self_eq_zero CharTwo.add_self_eq_zero set_option linter.deprecated false in @[simp] theorem bit0_eq_zero : (bit0 : R → R) = 0 := by funext exact add_self_eq_zero _ #align char_two.bit0_eq_zero CharTwo.bit0_eq_zero set_option linter.deprecated false in theorem bit0_apply_eq_zero (x : R) : (bit0 x : R) = 0 := by simp #align char_two.bit0_apply_eq_zero CharTwo.bit0_apply_eq_zero set_option linter.deprecated false in @[simp]
Mathlib/Algebra/CharP/Two.lean
49
51
theorem bit1_eq_one : (bit1 : R → R) = 1 := by
funext simp [bit1]
2
7.389056
1
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section Semiring variable [Semiring R] [CharP R 2] theorem two_eq_zero : (2 : R) = 0 := by rw [← Nat.cast_two, CharP.cast_eq_zero] #align char_two.two_eq_zero CharTwo.two_eq_zero @[simp] theorem add_self_eq_zero (x : R) : x + x = 0 := by rw [← two_smul R x, two_eq_zero, zero_smul] #align char_two.add_self_eq_zero CharTwo.add_self_eq_zero set_option linter.deprecated false in @[simp] theorem bit0_eq_zero : (bit0 : R → R) = 0 := by funext exact add_self_eq_zero _ #align char_two.bit0_eq_zero CharTwo.bit0_eq_zero set_option linter.deprecated false in theorem bit0_apply_eq_zero (x : R) : (bit0 x : R) = 0 := by simp #align char_two.bit0_apply_eq_zero CharTwo.bit0_apply_eq_zero set_option linter.deprecated false in @[simp] theorem bit1_eq_one : (bit1 : R → R) = 1 := by funext simp [bit1] #align char_two.bit1_eq_one CharTwo.bit1_eq_one set_option linter.deprecated false in
Mathlib/Algebra/CharP/Two.lean
55
55
theorem bit1_apply_eq_one (x : R) : (bit1 x : R) = 1 := by
simp
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section CommSemiring variable [CommSemiring R] [CharP R 2] theorem add_sq (x y : R) : (x + y) ^ 2 = x ^ 2 + y ^ 2 := add_pow_char _ _ _ #align char_two.add_sq CharTwo.add_sq
Mathlib/Algebra/CharP/Two.lean
91
92
theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y := by
rw [← pow_two, ← pow_two, ← pow_two, add_sq]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section CommSemiring variable [CommSemiring R] [CharP R 2] theorem add_sq (x y : R) : (x + y) ^ 2 = x ^ 2 + y ^ 2 := add_pow_char _ _ _ #align char_two.add_sq CharTwo.add_sq theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y := by rw [← pow_two, ← pow_two, ← pow_two, add_sq] #align char_two.add_mul_self CharTwo.add_mul_self theorem list_sum_sq (l : List R) : l.sum ^ 2 = (l.map (· ^ 2)).sum := list_sum_pow_char _ _ #align char_two.list_sum_sq CharTwo.list_sum_sq
Mathlib/Algebra/CharP/Two.lean
99
100
theorem list_sum_mul_self (l : List R) : l.sum * l.sum = (List.map (fun x => x * x) l).sum := by
simp_rw [← pow_two, list_sum_sq]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section CommSemiring variable [CommSemiring R] [CharP R 2] theorem add_sq (x y : R) : (x + y) ^ 2 = x ^ 2 + y ^ 2 := add_pow_char _ _ _ #align char_two.add_sq CharTwo.add_sq theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y := by rw [← pow_two, ← pow_two, ← pow_two, add_sq] #align char_two.add_mul_self CharTwo.add_mul_self theorem list_sum_sq (l : List R) : l.sum ^ 2 = (l.map (· ^ 2)).sum := list_sum_pow_char _ _ #align char_two.list_sum_sq CharTwo.list_sum_sq theorem list_sum_mul_self (l : List R) : l.sum * l.sum = (List.map (fun x => x * x) l).sum := by simp_rw [← pow_two, list_sum_sq] #align char_two.list_sum_mul_self CharTwo.list_sum_mul_self theorem multiset_sum_sq (l : Multiset R) : l.sum ^ 2 = (l.map (· ^ 2)).sum := multiset_sum_pow_char _ _ #align char_two.multiset_sum_sq CharTwo.multiset_sum_sq
Mathlib/Algebra/CharP/Two.lean
107
108
theorem multiset_sum_mul_self (l : Multiset R) : l.sum * l.sum = (Multiset.map (fun x => x * x) l).sum := by
simp_rw [← pow_two, multiset_sum_sq]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.CharP.ExpChar import Mathlib.GroupTheory.OrderOfElement #align_import algebra.char_p.two from "leanprover-community/mathlib"@"7f1ba1a333d66eed531ecb4092493cd1b6715450" variable {R ι : Type*} namespace CharTwo section CommSemiring variable [CommSemiring R] [CharP R 2] theorem add_sq (x y : R) : (x + y) ^ 2 = x ^ 2 + y ^ 2 := add_pow_char _ _ _ #align char_two.add_sq CharTwo.add_sq theorem add_mul_self (x y : R) : (x + y) * (x + y) = x * x + y * y := by rw [← pow_two, ← pow_two, ← pow_two, add_sq] #align char_two.add_mul_self CharTwo.add_mul_self theorem list_sum_sq (l : List R) : l.sum ^ 2 = (l.map (· ^ 2)).sum := list_sum_pow_char _ _ #align char_two.list_sum_sq CharTwo.list_sum_sq theorem list_sum_mul_self (l : List R) : l.sum * l.sum = (List.map (fun x => x * x) l).sum := by simp_rw [← pow_two, list_sum_sq] #align char_two.list_sum_mul_self CharTwo.list_sum_mul_self theorem multiset_sum_sq (l : Multiset R) : l.sum ^ 2 = (l.map (· ^ 2)).sum := multiset_sum_pow_char _ _ #align char_two.multiset_sum_sq CharTwo.multiset_sum_sq theorem multiset_sum_mul_self (l : Multiset R) : l.sum * l.sum = (Multiset.map (fun x => x * x) l).sum := by simp_rw [← pow_two, multiset_sum_sq] #align char_two.multiset_sum_mul_self CharTwo.multiset_sum_mul_self theorem sum_sq (s : Finset ι) (f : ι → R) : (∑ i ∈ s, f i) ^ 2 = ∑ i ∈ s, f i ^ 2 := sum_pow_char _ _ _ #align char_two.sum_sq CharTwo.sum_sq
Mathlib/Algebra/CharP/Two.lean
115
116
theorem sum_mul_self (s : Finset ι) (f : ι → R) : ((∑ i ∈ s, f i) * ∑ i ∈ s, f i) = ∑ i ∈ s, f i * f i := by
simp_rw [← pow_two, sum_sq]
1
2.718282
0
0.2
10
273
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.UniversalEnveloping import Mathlib.GroupTheory.GroupAction.Ring #align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4" universe u v w noncomputable section variable (R : Type u) (X : Type v) [CommRing R] local notation "lib" => FreeNonUnitalNonAssocAlgebra local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of namespace FreeLieAlgebra inductive Rel : lib R X → lib R X → Prop | lie_self (a : lib R X) : Rel (a * a) 0 | leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c)) | smul (t : R) {a b : lib R X} : Rel a b → Rel (t • a) (t • b) | add_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a + c) (b + c) | mul_left (a : lib R X) {b c : lib R X} : Rel b c → Rel (a * b) (a * c) | mul_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a * c) (b * c) #align free_lie_algebra.rel FreeLieAlgebra.Rel variable {R X}
Mathlib/Algebra/Lie/Free.lean
87
88
theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by
rw [add_comm _ b, add_comm _ c]; exact h.add_right _
1
2.718282
0
0.2
5
274
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.UniversalEnveloping import Mathlib.GroupTheory.GroupAction.Ring #align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4" universe u v w noncomputable section variable (R : Type u) (X : Type v) [CommRing R] local notation "lib" => FreeNonUnitalNonAssocAlgebra local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of namespace FreeLieAlgebra inductive Rel : lib R X → lib R X → Prop | lie_self (a : lib R X) : Rel (a * a) 0 | leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c)) | smul (t : R) {a b : lib R X} : Rel a b → Rel (t • a) (t • b) | add_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a + c) (b + c) | mul_left (a : lib R X) {b c : lib R X} : Rel b c → Rel (a * b) (a * c) | mul_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a * c) (b * c) #align free_lie_algebra.rel FreeLieAlgebra.Rel variable {R X} theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by rw [add_comm _ b, add_comm _ c]; exact h.add_right _ #align free_lie_algebra.rel.add_left FreeLieAlgebra.Rel.addLeft
Mathlib/Algebra/Lie/Free.lean
91
92
theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b) := by
simpa only [neg_one_smul] using h.smul (-1)
1
2.718282
0
0.2
5
274
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.UniversalEnveloping import Mathlib.GroupTheory.GroupAction.Ring #align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4" universe u v w noncomputable section variable (R : Type u) (X : Type v) [CommRing R] local notation "lib" => FreeNonUnitalNonAssocAlgebra local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of namespace FreeLieAlgebra inductive Rel : lib R X → lib R X → Prop | lie_self (a : lib R X) : Rel (a * a) 0 | leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c)) | smul (t : R) {a b : lib R X} : Rel a b → Rel (t • a) (t • b) | add_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a + c) (b + c) | mul_left (a : lib R X) {b c : lib R X} : Rel b c → Rel (a * b) (a * c) | mul_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a * c) (b * c) #align free_lie_algebra.rel FreeLieAlgebra.Rel variable {R X} theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by rw [add_comm _ b, add_comm _ c]; exact h.add_right _ #align free_lie_algebra.rel.add_left FreeLieAlgebra.Rel.addLeft theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b) := by simpa only [neg_one_smul] using h.smul (-1) #align free_lie_algebra.rel.neg FreeLieAlgebra.Rel.neg
Mathlib/Algebra/Lie/Free.lean
95
96
theorem Rel.subLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a - b) (a - c) := by
simpa only [sub_eq_add_neg] using h.neg.addLeft a
1
2.718282
0
0.2
5
274
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.UniversalEnveloping import Mathlib.GroupTheory.GroupAction.Ring #align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4" universe u v w noncomputable section variable (R : Type u) (X : Type v) [CommRing R] local notation "lib" => FreeNonUnitalNonAssocAlgebra local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of namespace FreeLieAlgebra inductive Rel : lib R X → lib R X → Prop | lie_self (a : lib R X) : Rel (a * a) 0 | leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c)) | smul (t : R) {a b : lib R X} : Rel a b → Rel (t • a) (t • b) | add_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a + c) (b + c) | mul_left (a : lib R X) {b c : lib R X} : Rel b c → Rel (a * b) (a * c) | mul_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a * c) (b * c) #align free_lie_algebra.rel FreeLieAlgebra.Rel variable {R X} theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by rw [add_comm _ b, add_comm _ c]; exact h.add_right _ #align free_lie_algebra.rel.add_left FreeLieAlgebra.Rel.addLeft theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b) := by simpa only [neg_one_smul] using h.smul (-1) #align free_lie_algebra.rel.neg FreeLieAlgebra.Rel.neg theorem Rel.subLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a - b) (a - c) := by simpa only [sub_eq_add_neg] using h.neg.addLeft a #align free_lie_algebra.rel.sub_left FreeLieAlgebra.Rel.subLeft
Mathlib/Algebra/Lie/Free.lean
99
100
theorem Rel.subRight {a b : lib R X} (c : lib R X) (h : Rel R X a b) : Rel R X (a - c) (b - c) := by
simpa only [sub_eq_add_neg] using h.add_right (-c)
1
2.718282
0
0.2
5
274
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra import Mathlib.Algebra.Lie.UniversalEnveloping import Mathlib.GroupTheory.GroupAction.Ring #align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4" universe u v w noncomputable section variable (R : Type u) (X : Type v) [CommRing R] local notation "lib" => FreeNonUnitalNonAssocAlgebra local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of namespace FreeLieAlgebra inductive Rel : lib R X → lib R X → Prop | lie_self (a : lib R X) : Rel (a * a) 0 | leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c)) | smul (t : R) {a b : lib R X} : Rel a b → Rel (t • a) (t • b) | add_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a + c) (b + c) | mul_left (a : lib R X) {b c : lib R X} : Rel b c → Rel (a * b) (a * c) | mul_right {a b : lib R X} (c : lib R X) : Rel a b → Rel (a * c) (b * c) #align free_lie_algebra.rel FreeLieAlgebra.Rel variable {R X} theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by rw [add_comm _ b, add_comm _ c]; exact h.add_right _ #align free_lie_algebra.rel.add_left FreeLieAlgebra.Rel.addLeft theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b) := by simpa only [neg_one_smul] using h.smul (-1) #align free_lie_algebra.rel.neg FreeLieAlgebra.Rel.neg theorem Rel.subLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a - b) (a - c) := by simpa only [sub_eq_add_neg] using h.neg.addLeft a #align free_lie_algebra.rel.sub_left FreeLieAlgebra.Rel.subLeft theorem Rel.subRight {a b : lib R X} (c : lib R X) (h : Rel R X a b) : Rel R X (a - c) (b - c) := by simpa only [sub_eq_add_neg] using h.add_right (-c) #align free_lie_algebra.rel.sub_right FreeLieAlgebra.Rel.subRight
Mathlib/Algebra/Lie/Free.lean
103
106
theorem Rel.smulOfTower {S : Type*} [Monoid S] [DistribMulAction S R] [IsScalarTower S R R] (t : S) (a b : lib R X) (h : Rel R X a b) : Rel R X (t • a) (t • b) := by
rw [← smul_one_smul R t a, ← smul_one_smul R t b] exact h.smul _
2
7.389056
1
0.2
5
274
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {α : Type u} {β : Type v} {δ : Type w} instance [Inhabited α] : Inhabited (Stream' α) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' α) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' α) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp]
Mathlib/Data/Stream/Init.lean
65
66
theorem drop_drop (n m : Nat) (s : Stream' α) : drop n (drop m s) = drop (n + m) s := by
ext; simp [Nat.add_assoc]
1
2.718282
0
0.2
5
275
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {α : Type u} {β : Type v} {δ : Type w} instance [Inhabited α] : Inhabited (Stream' α) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' α) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' α) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp] theorem drop_drop (n m : Nat) (s : Stream' α) : drop n (drop m s) = drop (n + m) s := by ext; simp [Nat.add_assoc] #align stream.drop_drop Stream'.drop_drop @[simp] theorem get_tail {s : Stream' α} : s.tail.get n = s.get (n + 1) := rfl @[simp] theorem tail_drop' {s : Stream' α} : tail (drop i s) = s.drop (i+1) := by ext; simp [Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] @[simp] theorem drop_tail' {s : Stream' α} : drop i (tail s) = s.drop (i+1) := rfl
Mathlib/Data/Stream/Init.lean
76
76
theorem tail_drop (n : Nat) (s : Stream' α) : tail (drop n s) = drop n (tail s) := by
simp
1
2.718282
0
0.2
5
275
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {α : Type u} {β : Type v} {δ : Type w} instance [Inhabited α] : Inhabited (Stream' α) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' α) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' α) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp] theorem drop_drop (n m : Nat) (s : Stream' α) : drop n (drop m s) = drop (n + m) s := by ext; simp [Nat.add_assoc] #align stream.drop_drop Stream'.drop_drop @[simp] theorem get_tail {s : Stream' α} : s.tail.get n = s.get (n + 1) := rfl @[simp] theorem tail_drop' {s : Stream' α} : tail (drop i s) = s.drop (i+1) := by ext; simp [Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] @[simp] theorem drop_tail' {s : Stream' α} : drop i (tail s) = s.drop (i+1) := rfl theorem tail_drop (n : Nat) (s : Stream' α) : tail (drop n s) = drop n (tail s) := by simp #align stream.tail_drop Stream'.tail_drop theorem get_succ (n : Nat) (s : Stream' α) : get s (succ n) = get (tail s) n := rfl #align stream.nth_succ Stream'.get_succ @[simp] theorem get_succ_cons (n : Nat) (s : Stream' α) (x : α) : get (x::s) n.succ = get s n := rfl #align stream.nth_succ_cons Stream'.get_succ_cons @[simp] theorem drop_zero {s : Stream' α} : s.drop 0 = s := rfl theorem drop_succ (n : Nat) (s : Stream' α) : drop (succ n) s = drop n (tail s) := rfl #align stream.drop_succ Stream'.drop_succ
Mathlib/Data/Stream/Init.lean
94
94
theorem head_drop (a : Stream' α) (n : ℕ) : (a.drop n).head = a.get n := by
simp
1
2.718282
0
0.2
5
275
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {α : Type u} {β : Type v} {δ : Type w} instance [Inhabited α] : Inhabited (Stream' α) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' α) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' α) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp] theorem drop_drop (n m : Nat) (s : Stream' α) : drop n (drop m s) = drop (n + m) s := by ext; simp [Nat.add_assoc] #align stream.drop_drop Stream'.drop_drop @[simp] theorem get_tail {s : Stream' α} : s.tail.get n = s.get (n + 1) := rfl @[simp] theorem tail_drop' {s : Stream' α} : tail (drop i s) = s.drop (i+1) := by ext; simp [Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] @[simp] theorem drop_tail' {s : Stream' α} : drop i (tail s) = s.drop (i+1) := rfl theorem tail_drop (n : Nat) (s : Stream' α) : tail (drop n s) = drop n (tail s) := by simp #align stream.tail_drop Stream'.tail_drop theorem get_succ (n : Nat) (s : Stream' α) : get s (succ n) = get (tail s) n := rfl #align stream.nth_succ Stream'.get_succ @[simp] theorem get_succ_cons (n : Nat) (s : Stream' α) (x : α) : get (x::s) n.succ = get s n := rfl #align stream.nth_succ_cons Stream'.get_succ_cons @[simp] theorem drop_zero {s : Stream' α} : s.drop 0 = s := rfl theorem drop_succ (n : Nat) (s : Stream' α) : drop (succ n) s = drop n (tail s) := rfl #align stream.drop_succ Stream'.drop_succ theorem head_drop (a : Stream' α) (n : ℕ) : (a.drop n).head = a.get n := by simp #align stream.head_drop Stream'.head_drop theorem cons_injective2 : Function.Injective2 (cons : α → Stream' α → Stream' α) := fun x y s t h => ⟨by rw [← get_zero_cons x s, h, get_zero_cons], Stream'.ext fun n => by rw [← get_succ_cons n _ x, h, get_succ_cons]⟩ #align stream.cons_injective2 Stream'.cons_injective2 theorem cons_injective_left (s : Stream' α) : Function.Injective fun x => cons x s := cons_injective2.left _ #align stream.cons_injective_left Stream'.cons_injective_left theorem cons_injective_right (x : α) : Function.Injective (cons x) := cons_injective2.right _ #align stream.cons_injective_right Stream'.cons_injective_right theorem all_def (p : α → Prop) (s : Stream' α) : All p s = ∀ n, p (get s n) := rfl #align stream.all_def Stream'.all_def theorem any_def (p : α → Prop) (s : Stream' α) : Any p s = ∃ n, p (get s n) := rfl #align stream.any_def Stream'.any_def @[simp] theorem mem_cons (a : α) (s : Stream' α) : a ∈ a::s := Exists.intro 0 rfl #align stream.mem_cons Stream'.mem_cons theorem mem_cons_of_mem {a : α} {s : Stream' α} (b : α) : a ∈ s → a ∈ b::s := fun ⟨n, h⟩ => Exists.intro (succ n) (by rw [get_succ, tail_cons, h]) #align stream.mem_cons_of_mem Stream'.mem_cons_of_mem theorem eq_or_mem_of_mem_cons {a b : α} {s : Stream' α} : (a ∈ b::s) → a = b ∨ a ∈ s := fun ⟨n, h⟩ => by cases' n with n' · left exact h · right rw [get_succ, tail_cons] at h exact ⟨n', h⟩ #align stream.eq_or_mem_of_mem_cons Stream'.eq_or_mem_of_mem_cons theorem mem_of_get_eq {n : Nat} {s : Stream' α} {a : α} : a = get s n → a ∈ s := fun h => Exists.intro n h #align stream.mem_of_nth_eq Stream'.mem_of_get_eq section Map variable (f : α → β) theorem drop_map (n : Nat) (s : Stream' α) : drop n (map f s) = map f (drop n s) := Stream'.ext fun _ => rfl #align stream.drop_map Stream'.drop_map @[simp] theorem get_map (n : Nat) (s : Stream' α) : get (map f s) n = f (get s n) := rfl #align stream.nth_map Stream'.get_map theorem tail_map (s : Stream' α) : tail (map f s) = map f (tail s) := rfl #align stream.tail_map Stream'.tail_map @[simp] theorem head_map (s : Stream' α) : head (map f s) = f (head s) := rfl #align stream.head_map Stream'.head_map
Mathlib/Data/Stream/Init.lean
162
163
theorem map_eq (s : Stream' α) : map f s = f (head s)::map f (tail s) := by
rw [← Stream'.eta (map f s), tail_map, head_map]
1
2.718282
0
0.2
5
275
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {α : Type u} {β : Type v} {δ : Type w} instance [Inhabited α] : Inhabited (Stream' α) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' α) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' α) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp] theorem drop_drop (n m : Nat) (s : Stream' α) : drop n (drop m s) = drop (n + m) s := by ext; simp [Nat.add_assoc] #align stream.drop_drop Stream'.drop_drop @[simp] theorem get_tail {s : Stream' α} : s.tail.get n = s.get (n + 1) := rfl @[simp] theorem tail_drop' {s : Stream' α} : tail (drop i s) = s.drop (i+1) := by ext; simp [Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] @[simp] theorem drop_tail' {s : Stream' α} : drop i (tail s) = s.drop (i+1) := rfl theorem tail_drop (n : Nat) (s : Stream' α) : tail (drop n s) = drop n (tail s) := by simp #align stream.tail_drop Stream'.tail_drop theorem get_succ (n : Nat) (s : Stream' α) : get s (succ n) = get (tail s) n := rfl #align stream.nth_succ Stream'.get_succ @[simp] theorem get_succ_cons (n : Nat) (s : Stream' α) (x : α) : get (x::s) n.succ = get s n := rfl #align stream.nth_succ_cons Stream'.get_succ_cons @[simp] theorem drop_zero {s : Stream' α} : s.drop 0 = s := rfl theorem drop_succ (n : Nat) (s : Stream' α) : drop (succ n) s = drop n (tail s) := rfl #align stream.drop_succ Stream'.drop_succ theorem head_drop (a : Stream' α) (n : ℕ) : (a.drop n).head = a.get n := by simp #align stream.head_drop Stream'.head_drop theorem cons_injective2 : Function.Injective2 (cons : α → Stream' α → Stream' α) := fun x y s t h => ⟨by rw [← get_zero_cons x s, h, get_zero_cons], Stream'.ext fun n => by rw [← get_succ_cons n _ x, h, get_succ_cons]⟩ #align stream.cons_injective2 Stream'.cons_injective2 theorem cons_injective_left (s : Stream' α) : Function.Injective fun x => cons x s := cons_injective2.left _ #align stream.cons_injective_left Stream'.cons_injective_left theorem cons_injective_right (x : α) : Function.Injective (cons x) := cons_injective2.right _ #align stream.cons_injective_right Stream'.cons_injective_right theorem all_def (p : α → Prop) (s : Stream' α) : All p s = ∀ n, p (get s n) := rfl #align stream.all_def Stream'.all_def theorem any_def (p : α → Prop) (s : Stream' α) : Any p s = ∃ n, p (get s n) := rfl #align stream.any_def Stream'.any_def @[simp] theorem mem_cons (a : α) (s : Stream' α) : a ∈ a::s := Exists.intro 0 rfl #align stream.mem_cons Stream'.mem_cons theorem mem_cons_of_mem {a : α} {s : Stream' α} (b : α) : a ∈ s → a ∈ b::s := fun ⟨n, h⟩ => Exists.intro (succ n) (by rw [get_succ, tail_cons, h]) #align stream.mem_cons_of_mem Stream'.mem_cons_of_mem theorem eq_or_mem_of_mem_cons {a b : α} {s : Stream' α} : (a ∈ b::s) → a = b ∨ a ∈ s := fun ⟨n, h⟩ => by cases' n with n' · left exact h · right rw [get_succ, tail_cons] at h exact ⟨n', h⟩ #align stream.eq_or_mem_of_mem_cons Stream'.eq_or_mem_of_mem_cons theorem mem_of_get_eq {n : Nat} {s : Stream' α} {a : α} : a = get s n → a ∈ s := fun h => Exists.intro n h #align stream.mem_of_nth_eq Stream'.mem_of_get_eq @[simp] theorem mem_const (a : α) : a ∈ const a := Exists.intro 0 rfl #align stream.mem_const Stream'.mem_const
Mathlib/Data/Stream/Init.lean
240
242
theorem const_eq (a : α) : const a = a::const a := by
apply Stream'.ext; intro n cases n <;> rfl
2
7.389056
1
0.2
5
275
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x
Mathlib/Dynamics/BirkhoffSum/Average.lean
44
45
theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 0 x = 0 := by
simp [birkhoffAverage]
1
2.718282
0
0.2
5
276
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 0 x = 0 := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_zero' (f : α → α) (g : α → M) : birkhoffAverage R f g 0 = 0 := funext <| birkhoffAverage_zero _ _ _
Mathlib/Dynamics/BirkhoffSum/Average.lean
50
51
theorem birkhoffAverage_one (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 1 x = g x := by
simp [birkhoffAverage]
1
2.718282
0
0.2
5
276
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 0 x = 0 := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_zero' (f : α → α) (g : α → M) : birkhoffAverage R f g 0 = 0 := funext <| birkhoffAverage_zero _ _ _ theorem birkhoffAverage_one (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 1 x = g x := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_one' (f : α → α) (g : α → M) : birkhoffAverage R f g 1 = g := funext <| birkhoffAverage_one R f g
Mathlib/Dynamics/BirkhoffSum/Average.lean
57
61
theorem map_birkhoffAverage (S : Type*) {F N : Type*} [DivisionSemiring S] [AddCommMonoid N] [Module S N] [FunLike F M N] [AddMonoidHomClass F M N] (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) : g' (birkhoffAverage R f g n x) = birkhoffAverage S f (g' ∘ g) n x := by
simp only [birkhoffAverage, map_inv_natCast_smul g' R S, map_birkhoffSum]
1
2.718282
0
0.2
5
276
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 0 x = 0 := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_zero' (f : α → α) (g : α → M) : birkhoffAverage R f g 0 = 0 := funext <| birkhoffAverage_zero _ _ _ theorem birkhoffAverage_one (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 1 x = g x := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_one' (f : α → α) (g : α → M) : birkhoffAverage R f g 1 = g := funext <| birkhoffAverage_one R f g theorem map_birkhoffAverage (S : Type*) {F N : Type*} [DivisionSemiring S] [AddCommMonoid N] [Module S N] [FunLike F M N] [AddMonoidHomClass F M N] (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) : g' (birkhoffAverage R f g n x) = birkhoffAverage S f (g' ∘ g) n x := by simp only [birkhoffAverage, map_inv_natCast_smul g' R S, map_birkhoffSum] theorem birkhoffAverage_congr_ring (S : Type*) [DivisionSemiring S] [Module S M] (f : α → α) (g : α → M) (n : ℕ) (x : α) : birkhoffAverage R f g n x = birkhoffAverage S f g n x := map_birkhoffAverage R S (AddMonoidHom.id M) f g n x
Mathlib/Dynamics/BirkhoffSum/Average.lean
68
70
theorem birkhoffAverage_congr_ring' (S : Type*) [DivisionSemiring S] [Module S M] : birkhoffAverage (α := α) (M := M) R = birkhoffAverage S := by
ext; apply birkhoffAverage_congr_ring
1
2.718282
0
0.2
5
276
import Mathlib.Dynamics.BirkhoffSum.Basic import Mathlib.Algebra.Module.Basic open Finset section birkhoffAverage variable (R : Type*) {α M : Type*} [DivisionSemiring R] [AddCommMonoid M] [Module R M] def birkhoffAverage (f : α → α) (g : α → M) (n : ℕ) (x : α) : M := (n : R)⁻¹ • birkhoffSum f g n x theorem birkhoffAverage_zero (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 0 x = 0 := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_zero' (f : α → α) (g : α → M) : birkhoffAverage R f g 0 = 0 := funext <| birkhoffAverage_zero _ _ _ theorem birkhoffAverage_one (f : α → α) (g : α → M) (x : α) : birkhoffAverage R f g 1 x = g x := by simp [birkhoffAverage] @[simp] theorem birkhoffAverage_one' (f : α → α) (g : α → M) : birkhoffAverage R f g 1 = g := funext <| birkhoffAverage_one R f g theorem map_birkhoffAverage (S : Type*) {F N : Type*} [DivisionSemiring S] [AddCommMonoid N] [Module S N] [FunLike F M N] [AddMonoidHomClass F M N] (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) : g' (birkhoffAverage R f g n x) = birkhoffAverage S f (g' ∘ g) n x := by simp only [birkhoffAverage, map_inv_natCast_smul g' R S, map_birkhoffSum] theorem birkhoffAverage_congr_ring (S : Type*) [DivisionSemiring S] [Module S M] (f : α → α) (g : α → M) (n : ℕ) (x : α) : birkhoffAverage R f g n x = birkhoffAverage S f g n x := map_birkhoffAverage R S (AddMonoidHom.id M) f g n x theorem birkhoffAverage_congr_ring' (S : Type*) [DivisionSemiring S] [Module S M] : birkhoffAverage (α := α) (M := M) R = birkhoffAverage S := by ext; apply birkhoffAverage_congr_ring
Mathlib/Dynamics/BirkhoffSum/Average.lean
72
75
theorem Function.IsFixedPt.birkhoffAverage_eq [CharZero R] {f : α → α} {x : α} (h : IsFixedPt f x) (g : α → M) {n : ℕ} (hn : n ≠ 0) : birkhoffAverage R f g n x = g x := by
rw [birkhoffAverage, h.birkhoffSum_eq, nsmul_eq_smul_cast R, inv_smul_smul₀] rwa [Nat.cast_ne_zero]
2
7.389056
1
0.2
5
276
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp]
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
46
47
theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by
rw [rank, LinearMap.range_zero, rank_bot]
1
2.718282
0
0.2
5
277
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V'']
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
52
55
theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by
refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range
3
20.085537
1
0.2
5
277
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
58
60
theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by
rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _
1
2.718282
0
0.2
5
277
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _ #align linear_map.lift_rank_comp_le_right LinearMap.lift_rank_comp_le_right theorem lift_rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ min (Cardinal.lift.{v'} (rank f)) (Cardinal.lift.{v''} (rank g)) := le_min (Cardinal.lift_le.mpr <| rank_comp_le_left _ _) (lift_rank_comp_le_right _ _) #align linear_map.lift_rank_comp_le LinearMap.lift_rank_comp_le variable [AddCommGroup V'₁] [Module K V'₁]
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
72
73
theorem rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g := by
simpa only [Cardinal.lift_id] using lift_rank_comp_le_right g f
1
2.718282
0
0.2
5
277
import Mathlib.LinearAlgebra.Dimension.DivisionRing import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition noncomputable section universe u v v' v'' variable {K : Type u} {V V₁ : Type v} {V' V'₁ : Type v'} {V'' : Type v''} open Cardinal Basis Submodule Function Set namespace LinearMap section Ring variable [Ring K] [AddCommGroup V] [Module K V] [AddCommGroup V₁] [Module K V₁] variable [AddCommGroup V'] [Module K V'] abbrev rank (f : V →ₗ[K] V') : Cardinal := Module.rank K (LinearMap.range f) #align linear_map.rank LinearMap.rank theorem rank_le_range (f : V →ₗ[K] V') : rank f ≤ Module.rank K V' := rank_submodule_le _ #align linear_map.rank_le_range LinearMap.rank_le_range theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V := rank_range_le _ #align linear_map.rank_le_domain LinearMap.rank_le_domain @[simp] theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0 := by rw [rank, LinearMap.range_zero, rank_bot] #align linear_map.rank_zero LinearMap.rank_zero variable [AddCommGroup V''] [Module K V''] theorem rank_comp_le_left (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : rank (f.comp g) ≤ rank f := by refine rank_le_of_submodule _ _ ?_ rw [LinearMap.range_comp] exact LinearMap.map_le_range #align linear_map.rank_comp_le_left LinearMap.rank_comp_le_left theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g) := by rw [rank, rank, LinearMap.range_comp]; exact lift_rank_map_le _ _ #align linear_map.lift_rank_comp_le_right LinearMap.lift_rank_comp_le_right theorem lift_rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') : Cardinal.lift.{v'} (rank (f.comp g)) ≤ min (Cardinal.lift.{v'} (rank f)) (Cardinal.lift.{v''} (rank g)) := le_min (Cardinal.lift_le.mpr <| rank_comp_le_left _ _) (lift_rank_comp_le_right _ _) #align linear_map.lift_rank_comp_le LinearMap.lift_rank_comp_le variable [AddCommGroup V'₁] [Module K V'₁] theorem rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g := by simpa only [Cardinal.lift_id] using lift_rank_comp_le_right g f #align linear_map.rank_comp_le_right LinearMap.rank_comp_le_right
Mathlib/LinearAlgebra/Dimension/LinearMap.lean
79
81
theorem rank_comp_le (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ min (rank f) (rank g) := by
simpa only [Cardinal.lift_id] using lift_rank_comp_le g f
1
2.718282
0
0.2
5
277
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] section genericPoint def IsGenericPoint (x : α) (S : Set α) : Prop := closure ({x} : Set α) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : α} {S : Set α} : IsGenericPoint x S ↔ closure ({x} : Set α) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : α} {S : Set α} (h : IsGenericPoint x S) : closure ({x} : Set α) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : α} {S U Z : Set α}
Mathlib/Topology/Sober.lean
53
54
theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by
simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff]
1
2.718282
0
0.2
5
278
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] section genericPoint def IsGenericPoint (x : α) (S : Set α) : Prop := closure ({x} : Set α) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : α} {S : Set α} : IsGenericPoint x S ↔ closure ({x} : Set α) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : α} {S : Set α} (h : IsGenericPoint x S) : closure ({x} : Set α) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : α} {S U Z : Set α} theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff] #align is_generic_point_iff_specializes isGenericPoint_iff_specializes namespace IsGenericPoint theorem specializes_iff_mem (h : IsGenericPoint x S) : x ⤳ y ↔ y ∈ S := isGenericPoint_iff_specializes.1 h y #align is_generic_point.specializes_iff_mem IsGenericPoint.specializes_iff_mem protected theorem specializes (h : IsGenericPoint x S) (h' : y ∈ S) : x ⤳ y := h.specializes_iff_mem.2 h' #align is_generic_point.specializes IsGenericPoint.specializes protected theorem mem (h : IsGenericPoint x S) : x ∈ S := h.specializes_iff_mem.1 specializes_rfl #align is_generic_point.mem IsGenericPoint.mem protected theorem isClosed (h : IsGenericPoint x S) : IsClosed S := h.def ▸ isClosed_closure #align is_generic_point.is_closed IsGenericPoint.isClosed protected theorem isIrreducible (h : IsGenericPoint x S) : IsIrreducible S := h.def ▸ isIrreducible_singleton.closure #align is_generic_point.is_irreducible IsGenericPoint.isIrreducible protected theorem inseparable (h : IsGenericPoint x S) (h' : IsGenericPoint y S) : Inseparable x y := (h.specializes h'.mem).antisymm (h'.specializes h.mem) protected theorem eq [T0Space α] (h : IsGenericPoint x S) (h' : IsGenericPoint y S) : x = y := (h.inseparable h').eq #align is_generic_point.eq IsGenericPoint.eq theorem mem_open_set_iff (h : IsGenericPoint x S) (hU : IsOpen U) : x ∈ U ↔ (S ∩ U).Nonempty := ⟨fun h' => ⟨x, h.mem, h'⟩, fun ⟨_y, hyS, hyU⟩ => (h.specializes hyS).mem_open hU hyU⟩ #align is_generic_point.mem_open_set_iff IsGenericPoint.mem_open_set_iff
Mathlib/Topology/Sober.lean
92
93
theorem disjoint_iff (h : IsGenericPoint x S) (hU : IsOpen U) : Disjoint S U ↔ x ∉ U := by
rw [h.mem_open_set_iff hU, ← not_disjoint_iff_nonempty_inter, Classical.not_not]
1
2.718282
0
0.2
5
278
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] section genericPoint def IsGenericPoint (x : α) (S : Set α) : Prop := closure ({x} : Set α) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : α} {S : Set α} : IsGenericPoint x S ↔ closure ({x} : Set α) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : α} {S : Set α} (h : IsGenericPoint x S) : closure ({x} : Set α) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : α} {S U Z : Set α} theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff] #align is_generic_point_iff_specializes isGenericPoint_iff_specializes namespace IsGenericPoint theorem specializes_iff_mem (h : IsGenericPoint x S) : x ⤳ y ↔ y ∈ S := isGenericPoint_iff_specializes.1 h y #align is_generic_point.specializes_iff_mem IsGenericPoint.specializes_iff_mem protected theorem specializes (h : IsGenericPoint x S) (h' : y ∈ S) : x ⤳ y := h.specializes_iff_mem.2 h' #align is_generic_point.specializes IsGenericPoint.specializes protected theorem mem (h : IsGenericPoint x S) : x ∈ S := h.specializes_iff_mem.1 specializes_rfl #align is_generic_point.mem IsGenericPoint.mem protected theorem isClosed (h : IsGenericPoint x S) : IsClosed S := h.def ▸ isClosed_closure #align is_generic_point.is_closed IsGenericPoint.isClosed protected theorem isIrreducible (h : IsGenericPoint x S) : IsIrreducible S := h.def ▸ isIrreducible_singleton.closure #align is_generic_point.is_irreducible IsGenericPoint.isIrreducible protected theorem inseparable (h : IsGenericPoint x S) (h' : IsGenericPoint y S) : Inseparable x y := (h.specializes h'.mem).antisymm (h'.specializes h.mem) protected theorem eq [T0Space α] (h : IsGenericPoint x S) (h' : IsGenericPoint y S) : x = y := (h.inseparable h').eq #align is_generic_point.eq IsGenericPoint.eq theorem mem_open_set_iff (h : IsGenericPoint x S) (hU : IsOpen U) : x ∈ U ↔ (S ∩ U).Nonempty := ⟨fun h' => ⟨x, h.mem, h'⟩, fun ⟨_y, hyS, hyU⟩ => (h.specializes hyS).mem_open hU hyU⟩ #align is_generic_point.mem_open_set_iff IsGenericPoint.mem_open_set_iff theorem disjoint_iff (h : IsGenericPoint x S) (hU : IsOpen U) : Disjoint S U ↔ x ∉ U := by rw [h.mem_open_set_iff hU, ← not_disjoint_iff_nonempty_inter, Classical.not_not] #align is_generic_point.disjoint_iff IsGenericPoint.disjoint_iff
Mathlib/Topology/Sober.lean
96
97
theorem mem_closed_set_iff (h : IsGenericPoint x S) (hZ : IsClosed Z) : x ∈ Z ↔ S ⊆ Z := by
rw [← h.def, hZ.closure_subset_iff, singleton_subset_iff]
1
2.718282
0
0.2
5
278
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] section genericPoint def IsGenericPoint (x : α) (S : Set α) : Prop := closure ({x} : Set α) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : α} {S : Set α} : IsGenericPoint x S ↔ closure ({x} : Set α) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : α} {S : Set α} (h : IsGenericPoint x S) : closure ({x} : Set α) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : α} {S U Z : Set α} theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff] #align is_generic_point_iff_specializes isGenericPoint_iff_specializes
Mathlib/Topology/Sober.lean
107
111
theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x ∈ S) : IsGenericPoint x S ↔ ∀ Z : Set α, IsClosed Z → x ∈ Z → S ⊆ Z := by
have : closure {x} ⊆ S := closure_minimal (singleton_subset_iff.2 hxS) hS simp_rw [IsGenericPoint, subset_antisymm_iff, this, true_and_iff, closure, subset_sInter_iff, mem_setOf_eq, and_imp, singleton_subset_iff]
3
20.085537
1
0.2
5
278
import Mathlib.Topology.Separation #align_import topology.sober from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] section genericPoint def IsGenericPoint (x : α) (S : Set α) : Prop := closure ({x} : Set α) = S #align is_generic_point IsGenericPoint theorem isGenericPoint_def {x : α} {S : Set α} : IsGenericPoint x S ↔ closure ({x} : Set α) = S := Iff.rfl #align is_generic_point_def isGenericPoint_def theorem IsGenericPoint.def {x : α} {S : Set α} (h : IsGenericPoint x S) : closure ({x} : Set α) = S := h #align is_generic_point.def IsGenericPoint.def theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α)) := refl _ #align is_generic_point_closure isGenericPoint_closure variable {x y : α} {S U Z : Set α} theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff] #align is_generic_point_iff_specializes isGenericPoint_iff_specializes section Sober @[mk_iff] class QuasiSober (α : Type*) [TopologicalSpace α] : Prop where sober : ∀ {S : Set α}, IsIrreducible S → IsClosed S → ∃ x, IsGenericPoint x S #align quasi_sober QuasiSober noncomputable def IsIrreducible.genericPoint [QuasiSober α] {S : Set α} (hS : IsIrreducible S) : α := (QuasiSober.sober hS.closure isClosed_closure).choose #align is_irreducible.generic_point IsIrreducible.genericPoint theorem IsIrreducible.genericPoint_spec [QuasiSober α] {S : Set α} (hS : IsIrreducible S) : IsGenericPoint hS.genericPoint (closure S) := (QuasiSober.sober hS.closure isClosed_closure).choose_spec #align is_irreducible.generic_point_spec IsIrreducible.genericPoint_spec @[simp] theorem IsIrreducible.genericPoint_closure_eq [QuasiSober α] {S : Set α} (hS : IsIrreducible S) : closure ({hS.genericPoint} : Set α) = closure S := hS.genericPoint_spec #align is_irreducible.generic_point_closure_eq IsIrreducible.genericPoint_closure_eq variable (α) noncomputable def genericPoint [QuasiSober α] [IrreducibleSpace α] : α := (IrreducibleSpace.isIrreducible_univ α).genericPoint #align generic_point genericPoint
Mathlib/Topology/Sober.lean
148
150
theorem genericPoint_spec [QuasiSober α] [IrreducibleSpace α] : IsGenericPoint (genericPoint α) ⊤ := by
simpa using (IrreducibleSpace.isIrreducible_univ α).genericPoint_spec
1
2.718282
0
0.2
5
278
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp]
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
52
52
theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by
simp [map]
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
60
60
theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by
simp
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
70
70
theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by
simp [map, Function.comp]
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp]
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
87
88
theorem map_const : p.map (Function.const α b) = pure b := by
simp only [map, Function.comp, bind_const, Function.const]
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp] theorem map_const : p.map (Function.const α b) = pure b := by simp only [map, Function.comp, bind_const, Function.const] #align pmf.map_const PMF.map_const section Measure variable (s : Set β) @[simp]
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
96
97
theorem toOuterMeasure_map_apply : (p.map f).toOuterMeasure s = p.toOuterMeasure (f ⁻¹' s) := by
simp [map, Set.indicator, toOuterMeasure_apply p (f ⁻¹' s)]
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp] theorem map_const : p.map (Function.const α b) = pure b := by simp only [map, Function.comp, bind_const, Function.const] #align pmf.map_const PMF.map_const section Measure variable (s : Set β) @[simp] theorem toOuterMeasure_map_apply : (p.map f).toOuterMeasure s = p.toOuterMeasure (f ⁻¹' s) := by simp [map, Set.indicator, toOuterMeasure_apply p (f ⁻¹' s)] #align pmf.to_outer_measure_map_apply PMF.toOuterMeasure_map_apply @[simp]
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
101
105
theorem toMeasure_map_apply [MeasurableSpace α] [MeasurableSpace β] (hf : Measurable f) (hs : MeasurableSet s) : (p.map f).toMeasure s = p.toMeasure (f ⁻¹' s) := by
rw [toMeasure_apply_eq_toOuterMeasure_apply _ s hs, toMeasure_apply_eq_toOuterMeasure_apply _ (f ⁻¹' s) (measurableSet_preimage hf hs)] exact toOuterMeasure_map_apply f p s
3
20.085537
1
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp] theorem map_const : p.map (Function.const α b) = pure b := by simp only [map, Function.comp, bind_const, Function.const] #align pmf.map_const PMF.map_const section Seq def seq (q : PMF (α → β)) (p : PMF α) : PMF β := q.bind fun m => p.bind fun a => pure (m a) #align pmf.seq PMF.seq variable (q : PMF (α → β)) (p : PMF α) (b : β) theorem monad_seq_eq_seq {α β : Type u} (q : PMF (α → β)) (p : PMF α) : q <*> p = q.seq p := rfl #align pmf.monad_seq_eq_seq PMF.monad_seq_eq_seq @[simp]
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
125
128
theorem seq_apply : (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0 := by
simp only [seq, mul_boole, bind_apply, pure_apply] refine tsum_congr fun f => ENNReal.tsum_mul_left.symm.trans (tsum_congr fun a => ?_) simpa only [mul_zero] using mul_ite (b = f a) (q f) (p a) 0
3
20.085537
1
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp] theorem map_const : p.map (Function.const α b) = pure b := by simp only [map, Function.comp, bind_const, Function.const] #align pmf.map_const PMF.map_const section Seq def seq (q : PMF (α → β)) (p : PMF α) : PMF β := q.bind fun m => p.bind fun a => pure (m a) #align pmf.seq PMF.seq variable (q : PMF (α → β)) (p : PMF α) (b : β) theorem monad_seq_eq_seq {α β : Type u} (q : PMF (α → β)) (p : PMF α) : q <*> p = q.seq p := rfl #align pmf.monad_seq_eq_seq PMF.monad_seq_eq_seq @[simp] theorem seq_apply : (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0 := by simp only [seq, mul_boole, bind_apply, pure_apply] refine tsum_congr fun f => ENNReal.tsum_mul_left.symm.trans (tsum_congr fun a => ?_) simpa only [mul_zero] using mul_ite (b = f a) (q f) (p a) 0 #align pmf.seq_apply PMF.seq_apply @[simp] theorem support_seq : (seq q p).support = ⋃ f ∈ q.support, f '' p.support := Set.ext fun b => by simp [-mem_support_iff, seq, @eq_comm β b] #align pmf.support_seq PMF.support_seq
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
136
136
theorem mem_support_seq_iff : b ∈ (seq q p).support ↔ ∃ f ∈ q.support, b ∈ f '' p.support := by
simp
1
2.718282
0
0.2
10
279
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : α → β) (p : PMF α) : PMF β := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : α → β) (p : PMF α) (b : β) theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm β b] #align pmf.support_map PMF.support_map theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by simp #align pmf.mem_support_map_iff PMF.mem_support_map_iff theorem bind_pure_comp : bind p (pure ∘ f) = map f p := rfl #align pmf.bind_pure_comp PMF.bind_pure_comp theorem map_id : map id p = p := bind_pure _ #align pmf.map_id PMF.map_id theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by simp [map, Function.comp] #align pmf.map_comp PMF.map_comp theorem pure_map (a : α) : (pure a).map f = pure (f a) := pure_bind _ _ #align pmf.pure_map PMF.pure_map theorem map_bind (q : α → PMF β) (f : β → γ) : (p.bind q).map f = p.bind fun a => (q a).map f := bind_bind _ _ _ #align pmf.map_bind PMF.map_bind @[simp] theorem bind_map (p : PMF α) (f : α → β) (q : β → PMF γ) : (p.map f).bind q = p.bind (q ∘ f) := (bind_bind _ _ _).trans (congr_arg _ (funext fun _ => pure_bind _ _)) #align pmf.bind_map PMF.bind_map @[simp] theorem map_const : p.map (Function.const α b) = pure b := by simp only [map, Function.comp, bind_const, Function.const] #align pmf.map_const PMF.map_const instance : LawfulFunctor PMF where map_const := rfl id_map := bind_pure comp_map _ _ _ := (map_comp _ _ _).symm instance : LawfulMonad PMF := LawfulMonad.mk' (bind_pure_comp := fun f x => rfl) (id_map := id_map) (pure_bind := pure_bind) (bind_assoc := bind_bind) section OfFinset def ofFinset (f : α → ℝ≥0∞) (s : Finset α) (h : ∑ a ∈ s, f a = 1) (h' : ∀ (a) (_ : a ∉ s), f a = 0) : PMF α := ⟨f, h ▸ hasSum_sum_of_ne_finset_zero h'⟩ #align pmf.of_finset PMF.ofFinset variable {f : α → ℝ≥0∞} {s : Finset α} (h : ∑ a ∈ s, f a = 1) (h' : ∀ (a) (_ : a ∉ s), f a = 0) @[simp] theorem ofFinset_apply (a : α) : ofFinset f s h h' a = f a := rfl #align pmf.of_finset_apply PMF.ofFinset_apply @[simp] theorem support_ofFinset : (ofFinset f s h h').support = ↑s ∩ Function.support f := Set.ext fun a => by simpa [mem_support_iff] using mt (h' a) #align pmf.support_of_finset PMF.support_ofFinset
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
172
173
theorem mem_support_ofFinset_iff (a : α) : a ∈ (ofFinset f s h h').support ↔ a ∈ s ∧ f a ≠ 0 := by
simp
1
2.718282
0
0.2
10
279