fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
keys_erase_toFinset (a : α) (s : AList β) : keys ⟦s.erase a⟧ = (keys ⟦s⟧).erase a := by simp [Finset.erase, keys, AList.erase, keys_kerase] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
keys_erase_toFinset
null
keys_erase (a : α) (s : Finmap β) : (erase a s).keys = s.keys.erase a := induction_on s fun s => by simp @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
keys_erase
null
mem_erase {a a' : α} {s : Finmap β} : a' ∈ erase a s ↔ a' ≠ a ∧ a' ∈ s := induction_on s fun s => by simp
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_erase
null
notMem_erase_self {a : α} {s : Finmap β} : a ∉ erase a s := by rw [mem_erase, not_and_or, not_not] left rfl @[deprecated (since := "2025-05-23")] alias not_mem_erase_self := notMem_erase_self @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
notMem_erase_self
null
lookup_erase (a) (s : Finmap β) : lookup a (erase a s) = none := induction_on s <| AList.lookup_erase a @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_erase
null
lookup_erase_ne {a a'} {s : Finmap β} (h : a ≠ a') : lookup a (erase a' s) = lookup a s := induction_on s fun _ => AList.lookup_erase_ne h
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_erase_ne
null
erase_erase {a a' : α} {s : Finmap β} : erase a (erase a' s) = erase a' (erase a s) := induction_on s fun s => ext (by simp only [AList.erase_erase, erase_toFinmap]) /-! ### sdiff -/
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
erase_erase
null
sdiff (s s' : Finmap β) : Finmap β := s'.foldl (fun s x _ => s.erase x) (fun _ _ _ _ _ => erase_erase) s
def
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
sdiff
`sdiff s s'` consists of all key-value pairs from `s` and `s'` where the keys are in `s` or `s'` but not both.
insert (a : α) (b : β a) (s : Finmap β) : Finmap β := (liftOn s fun t => AList.toFinmap (AList.insert a b t)) fun _ _ p => toFinmap_eq.2 <| perm_insert p @[simp]
def
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert
Insert a key-value pair into a finite map, replacing any existing pair with the same key.
insert_toFinmap (a : α) (b : β a) (s : AList β) : insert a b (AList.toFinmap s) = AList.toFinmap (s.insert a b) := by simp [insert]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert_toFinmap
null
entries_insert_of_notMem {a : α} {b : β a} {s : Finmap β} : a ∉ s → (insert a b s).entries = ⟨a, b⟩ ::ₘ s.entries := induction_on s fun s h => by simp [AList.entries_insert_of_notMem (mt mem_toFinmap.1 h), -entries_insert] @[deprecated (since := "2025-05-23")] alias entries_insert_of_not_mem := entries_insert_of_notMem @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
entries_insert_of_notMem
null
mem_insert {a a' : α} {b' : β a'} {s : Finmap β} : a ∈ insert a' b' s ↔ a = a' ∨ a ∈ s := induction_on s AList.mem_insert @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_insert
null
lookup_insert {a} {b : β a} (s : Finmap β) : lookup a (insert a b s) = some b := induction_on s fun s => by simp only [insert_toFinmap, lookup_toFinmap, AList.lookup_insert] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_insert
null
lookup_insert_of_ne {a a'} {b : β a} (s : Finmap β) (h : a' ≠ a) : lookup a' (insert a b s) = lookup a' s := induction_on s fun s => by simp only [insert_toFinmap, lookup_toFinmap, lookup_insert_ne h] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_insert_of_ne
null
insert_insert {a} {b b' : β a} (s : Finmap β) : (s.insert a b).insert a b' = s.insert a b' := induction_on s fun s => by simp only [insert_toFinmap, AList.insert_insert]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert_insert
null
insert_insert_of_ne {a a'} {b : β a} {b' : β a'} (s : Finmap β) (h : a ≠ a') : (s.insert a b).insert a' b' = (s.insert a' b').insert a b := induction_on s fun s => by simp only [insert_toFinmap, AList.toFinmap_eq, AList.insert_insert_of_ne _ h]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert_insert_of_ne
null
toFinmap_cons (a : α) (b : β a) (xs : List (Sigma β)) : List.toFinmap (⟨a, b⟩ :: xs) = insert a b xs.toFinmap := rfl
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
toFinmap_cons
null
mem_list_toFinmap (a : α) (xs : List (Sigma β)) : a ∈ xs.toFinmap ↔ ∃ b : β a, Sigma.mk a b ∈ xs := by induction xs with | nil => simp only [toFinmap_nil, notMem_empty, not_mem_nil, exists_false] | cons x xs => obtain ⟨fst_i, snd_i⟩ := x simp only [toFinmap_cons, *, exists_or, mem_cons, mem_insert, exists_and_left, Sigma.mk.inj_iff] refine (or_congr_left <| and_iff_left_of_imp ?_).symm rintro rfl simp only [exists_eq, heq_iff_eq] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_list_toFinmap
null
insert_singleton_eq {a : α} {b b' : β a} : insert a b (singleton a b') = singleton a b := by simp only [singleton, Finmap.insert_toFinmap, AList.insert_singleton_eq] /-! ### extract -/
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert_singleton_eq
null
extract (a : α) (s : Finmap β) : Option (β a) × Finmap β := (liftOn s fun t => Prod.map id AList.toFinmap (AList.extract a t)) fun s₁ s₂ p => by simp [perm_lookup p, toFinmap_eq, perm_erase p] @[simp]
def
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
extract
Erase a key from the map, and return the corresponding value, if found.
extract_eq_lookup_erase (a : α) (s : Finmap β) : extract a s = (lookup a s, erase a s) := induction_on s fun s => by simp [extract] /-! ### union -/
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
extract_eq_lookup_erase
null
union (s₁ s₂ : Finmap β) : Finmap β := (liftOn₂ s₁ s₂ fun s₁ s₂ => (AList.toFinmap (s₁ ∪ s₂))) fun _ _ _ _ p₁₃ p₂₄ => toFinmap_eq.mpr <| perm_union p₁₃ p₂₄
def
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union
`s₁ ∪ s₂` is the key-based union of two finite maps. It is left-biased: if there exists an `a ∈ s₁`, `lookup a (s₁ ∪ s₂) = lookup a s₁`.
@[simp] mem_union {a} {s₁ s₂ : Finmap β} : a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂ := induction_on₂ s₁ s₂ fun _ _ => AList.mem_union @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_union
null
union_toFinmap (s₁ s₂ : AList β) : (toFinmap s₁) ∪ (toFinmap s₂) = toFinmap (s₁ ∪ s₂) := by simp [(· ∪ ·), union]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union_toFinmap
null
keys_union {s₁ s₂ : Finmap β} : (s₁ ∪ s₂).keys = s₁.keys ∪ s₂.keys := induction_on₂ s₁ s₂ fun s₁ s₂ => Finset.ext <| by simp [keys] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
keys_union
null
lookup_union_left {a} {s₁ s₂ : Finmap β} : a ∈ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₁ := induction_on₂ s₁ s₂ fun _ _ => AList.lookup_union_left @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_union_left
null
lookup_union_right {a} {s₁ s₂ : Finmap β} : a ∉ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₂ := induction_on₂ s₁ s₂ fun _ _ => AList.lookup_union_right
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_union_right
null
lookup_union_left_of_not_in {a} {s₁ s₂ : Finmap β} (h : a ∉ s₂) : lookup a (s₁ ∪ s₂) = lookup a s₁ := by by_cases h' : a ∈ s₁ · rw [lookup_union_left h'] · rw [lookup_union_right h', lookup_eq_none.mpr h, lookup_eq_none.mpr h']
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
lookup_union_left_of_not_in
null
@[simp] mem_lookup_union' {a} {b : β a} {s₁ s₂ : Finmap β} : lookup a (s₁ ∪ s₂) = some b ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂ := induction_on₂ s₁ s₂ fun _ _ => AList.mem_lookup_union
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_lookup_union'
`simp`-normal form of `mem_lookup_union`
mem_lookup_union {a} {b : β a} {s₁ s₂ : Finmap β} : b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂ := induction_on₂ s₁ s₂ fun _ _ => AList.mem_lookup_union
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_lookup_union
null
mem_lookup_union_middle {a} {b : β a} {s₁ s₂ s₃ : Finmap β} : b ∈ lookup a (s₁ ∪ s₃) → a ∉ s₂ → b ∈ lookup a (s₁ ∪ s₂ ∪ s₃) := induction_on₃ s₁ s₂ s₃ fun _ _ _ => AList.mem_lookup_union_middle
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
mem_lookup_union_middle
null
insert_union {a} {b : β a} {s₁ s₂ : Finmap β} : insert a b (s₁ ∪ s₂) = insert a b s₁ ∪ s₂ := induction_on₂ s₁ s₂ fun a₁ a₂ => by simp [AList.insert_union]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
insert_union
null
union_assoc {s₁ s₂ s₃ : Finmap β} : s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃) := induction_on₃ s₁ s₂ s₃ fun s₁ s₂ s₃ => by simp only [AList.toFinmap_eq, union_toFinmap, AList.union_assoc] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union_assoc
null
empty_union {s₁ : Finmap β} : ∅ ∪ s₁ = s₁ := induction_on s₁ fun s₁ => by rw [← empty_toFinmap] simp [-empty_toFinmap, union_toFinmap] @[simp]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
empty_union
null
union_empty {s₁ : Finmap β} : s₁ ∪ ∅ = s₁ := induction_on s₁ fun s₁ => by rw [← empty_toFinmap] simp [-empty_toFinmap, union_toFinmap]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union_empty
null
erase_union_singleton (a : α) (b : β a) (s : Finmap β) (h : s.lookup a = some b) : s.erase a ∪ singleton a b = s := ext_lookup fun x => by by_cases h' : x = a · subst a rw [lookup_union_right notMem_erase_self, lookup_singleton_eq, h] · have : x ∉ singleton a b := by rwa [mem_singleton] rw [lookup_union_left_of_not_in this, lookup_erase_ne h']
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
erase_union_singleton
null
Disjoint (s₁ s₂ : Finmap β) : Prop := ∀ x ∈ s₁, x ∉ s₂
def
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
Disjoint
`Disjoint s₁ s₂` holds if `s₁` and `s₂` have no keys in common.
disjoint_empty (x : Finmap β) : Disjoint ∅ x := nofun @[symm]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
disjoint_empty
null
Disjoint.symm (x y : Finmap β) (h : Disjoint x y) : Disjoint y x := fun p hy hx => h p hx hy
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
Disjoint.symm
null
Disjoint.symm_iff (x y : Finmap β) : Disjoint x y ↔ Disjoint y x := ⟨Disjoint.symm x y, Disjoint.symm y x⟩
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
Disjoint.symm_iff
null
disjoint_union_left (x y z : Finmap β) : Disjoint (x ∪ y) z ↔ Disjoint x z ∧ Disjoint y z := by simp [Disjoint, Finmap.mem_union, or_imp, forall_and]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
disjoint_union_left
null
disjoint_union_right (x y z : Finmap β) : Disjoint x (y ∪ z) ↔ Disjoint x y ∧ Disjoint x z := by rw [Disjoint.symm_iff, disjoint_union_left, Disjoint.symm_iff _ x, Disjoint.symm_iff _ x]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
disjoint_union_right
null
union_comm_of_disjoint {s₁ s₂ : Finmap β} : Disjoint s₁ s₂ → s₁ ∪ s₂ = s₂ ∪ s₁ := induction_on₂ s₁ s₂ fun s₁ s₂ => by intro h simp only [AList.toFinmap_eq, union_toFinmap, AList.union_comm_of_disjoint h]
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union_comm_of_disjoint
null
union_cancel {s₁ s₂ s₃ : Finmap β} (h : Disjoint s₁ s₃) (h' : Disjoint s₂ s₃) : s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂ := ⟨fun h'' => by apply ext_lookup intro x have : (s₁ ∪ s₃).lookup x = (s₂ ∪ s₃).lookup x := h'' ▸ rfl by_cases hs₁ : x ∈ s₁ · rwa [lookup_union_left hs₁, lookup_union_left_of_not_in (h _ hs₁)] at this · by_cases hs₂ : x ∈ s₂ · rwa [lookup_union_left_of_not_in (h' _ hs₂), lookup_union_left hs₂] at this · rw [lookup_eq_none.mpr hs₁, lookup_eq_none.mpr hs₂], fun h => h ▸ rfl⟩
theorem
Data
[ "Mathlib.Data.List.AList", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Part" ]
Mathlib/Data/Finmap.lean
union_cancel
null
HolorIndex (ds : List ℕ) : Type := { is : List ℕ // Forall₂ (· < ·) is ds }
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
HolorIndex
`HolorIndex ds` is the type of valid index tuples used to identify an entry of a holor of dimensions `ds`.
take : ∀ {ds₁ : List ℕ}, HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₁ | ds, is => ⟨List.take (length ds) is.1, forall₂_take_append is.1 ds ds₂ is.2⟩
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
take
Take the first elements of a `HolorIndex`.
drop : ∀ {ds₁ : List ℕ}, HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₂ | ds, is => ⟨List.drop (length ds) is.1, forall₂_drop_append is.1 ds ds₂ is.2⟩
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
drop
Drop the first elements of a `HolorIndex`.
cast_type (is : List ℕ) (eq : ds₁ = ds₂) (h : Forall₂ (· < ·) is ds₁) : (cast (congr_arg HolorIndex eq) ⟨is, h⟩).val = is := by subst eq; rfl
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cast_type
null
assocRight : HolorIndex (ds₁ ++ ds₂ ++ ds₃) → HolorIndex (ds₁ ++ (ds₂ ++ ds₃)) := cast (congr_arg HolorIndex (append_assoc ds₁ ds₂ ds₃))
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
assocRight
Right associator for `HolorIndex`
assocLeft : HolorIndex (ds₁ ++ (ds₂ ++ ds₃)) → HolorIndex (ds₁ ++ ds₂ ++ ds₃) := cast (congr_arg HolorIndex (append_assoc ds₁ ds₂ ds₃).symm)
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
assocLeft
Left associator for `HolorIndex`
take_take : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.take = t.take.take | ⟨is, h⟩ => Subtype.eq <| by simp [assocRight, take, cast_type, List.take_take, Nat.le_add_right]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
take_take
null
drop_take : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.drop.take = t.take.drop | ⟨is, h⟩ => Subtype.eq (by simp [assocRight, take, drop, cast_type, List.drop_take])
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
drop_take
null
drop_drop : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.drop.drop = t.drop | ⟨is, h⟩ => Subtype.eq (by simp [assocRight, drop, cast_type, List.drop_drop])
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
drop_drop
null
Holor (α : Type u) (ds : List ℕ) := HolorIndex ds → α
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
Holor
Holor (indexed collections of tensor coefficients)
mul [Mul α] (x : Holor α ds₁) (y : Holor α ds₂) : Holor α (ds₁ ++ ds₂) := fun t => x t.take * y t.drop local infixl:70 " ⊗ " => mul
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul
The tensor product of two holors.
cast_type (eq : ds₁ = ds₂) (a : Holor α ds₁) : cast (congr_arg (Holor α) eq) a = fun t => a (cast (congr_arg HolorIndex eq.symm) t) := by subst eq; rfl
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cast_type
null
assocRight : Holor α (ds₁ ++ ds₂ ++ ds₃) → Holor α (ds₁ ++ (ds₂ ++ ds₃)) := cast (congr_arg (Holor α) (append_assoc ds₁ ds₂ ds₃))
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
assocRight
Right associator for `Holor`
assocLeft : Holor α (ds₁ ++ (ds₂ ++ ds₃)) → Holor α (ds₁ ++ ds₂ ++ ds₃) := cast (congr_arg (Holor α) (append_assoc ds₁ ds₂ ds₃).symm)
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
assocLeft
Left associator for `Holor`
mul_assoc0 [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) : x ⊗ y ⊗ z = (x ⊗ (y ⊗ z)).assocLeft := funext fun t : HolorIndex (ds₁ ++ ds₂ ++ ds₃) => by rw [assocLeft] unfold mul rw [mul_assoc, ← HolorIndex.take_take, ← HolorIndex.drop_take, ← HolorIndex.drop_drop, cast_type] · rfl rw [append_assoc]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul_assoc0
null
mul_assoc [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) : mul (mul x y) z ≍ mul x (mul y z) := by simp [cast_heq, mul_assoc0, assocLeft]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul_assoc
null
mul_left_distrib [Distrib α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₂) : x ⊗ (y + z) = x ⊗ y + x ⊗ z := funext fun t => left_distrib (x t.take) (y t.drop) (z t.drop)
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul_left_distrib
null
mul_right_distrib [Distrib α] (x : Holor α ds₁) (y : Holor α ds₁) (z : Holor α ds₂) : (x + y) ⊗ z = x ⊗ z + y ⊗ z := funext fun t => add_mul (x t.take) (y t.take) (z t.drop) @[simp] nonrec theorem zero_mul {α : Type} [MulZeroClass α] (x : Holor α ds₂) : (0 : Holor α ds₁) ⊗ x = 0 := funext fun t => zero_mul (x (HolorIndex.drop t)) @[simp] nonrec theorem mul_zero {α : Type} [MulZeroClass α] (x : Holor α ds₁) : x ⊗ (0 : Holor α ds₂) = 0 := funext fun t => mul_zero (x (HolorIndex.take t))
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul_right_distrib
null
mul_scalar_mul [Mul α] (x : Holor α []) (y : Holor α ds) : x ⊗ y = x ⟨[], Forall₂.nil⟩ • y := by simp +unfoldPartialApp [mul, SMul.smul, HolorIndex.take, HolorIndex.drop, HSMul.hSMul]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
mul_scalar_mul
null
slice (x : Holor α (d :: ds)) (i : ℕ) (h : i < d) : Holor α ds := fun is : HolorIndex ds => x ⟨i :: is.1, Forall₂.cons h is.2⟩
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice
A slice is a subholor consisting of all entries with initial index i.
unitVec [Monoid α] [AddMonoid α] (d : ℕ) (j : ℕ) : Holor α [d] := fun ti => if ti.1 = [j] then 1 else 0
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
unitVec
The 1-dimensional "unit" holor with 1 in the `j`th position.
holor_index_cons_decomp (p : HolorIndex (d :: ds) → Prop) : ∀ t : HolorIndex (d :: ds), (∀ i is, ∀ h : t.1 = i :: is, p ⟨i :: is, by rw [← h]; exact t.2⟩) → p t | ⟨[], hforall₂⟩, _ => absurd (forall₂_nil_left_iff.1 hforall₂) (cons_ne_nil d ds) | ⟨i :: is, _⟩, hp => hp i is rfl
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
holor_index_cons_decomp
null
slice_eq (x : Holor α (d :: ds)) (y : Holor α (d :: ds)) (h : slice x = slice y) : x = y := funext fun t : HolorIndex (d :: ds) => holor_index_cons_decomp (fun t => x t = y t) t fun i is hiis => have hiisdds : Forall₂ (· < ·) (i :: is) (d :: ds) := by rw [← hiis]; exact t.2 have hid : i < d := (forall₂_cons.1 hiisdds).1 have hisds : Forall₂ (· < ·) is ds := (forall₂_cons.1 hiisdds).2 calc x ⟨i :: is, _⟩ = slice x i hid ⟨is, hisds⟩ := congr_arg x (Subtype.eq rfl) _ = slice y i hid ⟨is, hisds⟩ := by rw [h] _ = y ⟨i :: is, _⟩ := congr_arg y (Subtype.eq rfl)
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice_eq
Two holors are equal if all their slices are equal.
slice_unitVec_mul [Semiring α] {i : ℕ} {j : ℕ} (hid : i < d) (x : Holor α ds) : slice (unitVec d j ⊗ x) i hid = if i = j then x else 0 := funext fun t : HolorIndex ds => if h : i = j then by simp [slice, mul, HolorIndex.take, unitVec, HolorIndex.drop, h] else by simp [slice, mul, HolorIndex.take, unitVec, HolorIndex.drop, h]; rfl
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice_unitVec_mul
null
slice_add [Add α] (i : ℕ) (hid : i < d) (x : Holor α (d :: ds)) (y : Holor α (d :: ds)) : slice x i hid + slice y i hid = slice (x + y) i hid := funext fun t => by simp [slice, (· + ·), Add.add]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice_add
null
slice_zero [Zero α] (i : ℕ) (hid : i < d) : slice (0 : Holor α (d :: ds)) i hid = 0 := rfl
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice_zero
null
slice_sum [AddCommMonoid α] {β : Type} (i : ℕ) (hid : i < d) (s : Finset β) (f : β → Holor α (d :: ds)) : (∑ x ∈ s, slice (f x) i hid) = slice (∑ x ∈ s, f x) i hid := by letI := Classical.decEq β refine Finset.induction_on s ?_ ?_ · simp [slice_zero] · intro _ _ h_not_in ih rw [Finset.sum_insert h_not_in, ih, slice_add, Finset.sum_insert h_not_in]
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
slice_sum
null
@[simp] sum_unitVec_mul_slice [Semiring α] (x : Holor α (d :: ds)) : (∑ i ∈ (Finset.range d).attach, unitVec d i ⊗ slice x i (Nat.succ_le_of_lt (Finset.mem_range.1 i.prop))) = x := by apply slice_eq _ _ _ ext i hid rw [← slice_sum] simp only [slice_unitVec_mul hid] rw [Finset.sum_eq_single (Subtype.mk i <| Finset.mem_range.2 hid)] · simp · intro (b : { x // x ∈ Finset.range d }) (_ : b ∈ (Finset.range d).attach) (hbi : b ≠ ⟨i, _⟩) have hbi' : i ≠ b := by simpa only [Ne, Subtype.ext_iff, Subtype.coe_mk] using hbi.symm simp [hbi'] · intro (hid' : Subtype.mk i _ ∉ Finset.attach (Finset.range d)) exfalso exact absurd (Finset.mem_attach _ _) hid'
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
sum_unitVec_mul_slice
The original holor can be recovered from its slices by multiplying with unit vectors and summing up.
CPRankMax1 [Mul α] : ∀ {ds}, Holor α ds → Prop | nil (x : Holor α []) : CPRankMax1 x | cons {d} {ds} (x : Holor α [d]) (y : Holor α ds) : CPRankMax1 y → CPRankMax1 (x ⊗ y)
inductive
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
CPRankMax1
`CPRankMax1 x` means `x` has CP rank at most 1, that is, it is the tensor product of 1-dimensional holors.
CPRankMax [Mul α] [AddMonoid α] : ℕ → ∀ {ds}, Holor α ds → Prop | zero {ds} : CPRankMax 0 (0 : Holor α ds) | succ (n) {ds} (x : Holor α ds) (y : Holor α ds) : CPRankMax1 x → CPRankMax n y → CPRankMax (n + 1) (x + y)
inductive
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
CPRankMax
`CPRankMax N x` means `x` has CP rank at most `N`, that is, it can be written as the sum of N holors of rank at most 1.
cprankMax_nil [Mul α] [AddMonoid α] (x : Holor α nil) : CPRankMax 1 x := by have h := CPRankMax.succ 0 x 0 (CPRankMax1.nil x) CPRankMax.zero rwa [add_zero x, zero_add] at h
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_nil
null
cprankMax_1 [Mul α] [AddMonoid α] {x : Holor α ds} (h : CPRankMax1 x) : CPRankMax 1 x := by have h' := CPRankMax.succ 0 x 0 h CPRankMax.zero rwa [zero_add, add_zero] at h'
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_1
null
cprankMax_add [Mul α] [AddMonoid α] : ∀ {m : ℕ} {n : ℕ} {x : Holor α ds} {y : Holor α ds}, CPRankMax m x → CPRankMax n y → CPRankMax (m + n) (x + y) | 0, n, x, y, hx, hy => by match hx with | CPRankMax.zero => simp only [zero_add, hy] | m + 1, n, _, y, CPRankMax.succ _ x₁ x₂ hx₁ hx₂, hy => by suffices CPRankMax (m + n + 1) (x₁ + (x₂ + y)) by simpa only [add_comm, add_assoc, add_left_comm] using this apply CPRankMax.succ · assumption · exact cprankMax_add hx₂ hy
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_add
null
cprankMax_mul [NonUnitalNonAssocSemiring α] : ∀ (n : ℕ) (x : Holor α [d]) (y : Holor α ds), CPRankMax n y → CPRankMax n (x ⊗ y) | 0, x, _, CPRankMax.zero => by simp [mul_zero x, CPRankMax.zero] | n + 1, x, _, CPRankMax.succ _ y₁ y₂ hy₁ hy₂ => by rw [mul_left_distrib] rw [Nat.add_comm] apply cprankMax_add · exact cprankMax_1 (CPRankMax1.cons _ _ hy₁) · exact cprankMax_mul _ x y₂ hy₂
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_mul
null
cprankMax_sum [NonUnitalNonAssocSemiring α] {β} {n : ℕ} (s : Finset β) (f : β → Holor α ds) : (∀ x ∈ s, CPRankMax n (f x)) → CPRankMax (s.card * n) (∑ x ∈ s, f x) := letI := Classical.decEq β Finset.induction_on s (by simp [CPRankMax.zero]) (by intro x s (h_x_notin_s : x ∉ s) ih h_cprank simp only [Finset.sum_insert h_x_notin_s, Finset.card_insert_of_notMem h_x_notin_s] rw [Nat.right_distrib] simp only [Nat.one_mul, Nat.add_comm] have ih' : CPRankMax (Finset.card s * n) (∑ x ∈ s, f x) := by apply ih intro (x : β) (h_x_in_s : x ∈ s) simp only [h_cprank, Finset.mem_insert_of_mem, h_x_in_s] exact cprankMax_add (h_cprank x (Finset.mem_insert_self x s)) ih')
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_sum
null
cprankMax_upper_bound [Semiring α] : ∀ {ds}, ∀ x : Holor α ds, CPRankMax ds.prod x | [], x => cprankMax_nil x | d :: ds, x => by have h_summands : ∀ i : { x // x ∈ Finset.range d }, CPRankMax ds.prod (unitVec d i.1 ⊗ slice x i.1 (mem_range.1 i.2)) := fun i => cprankMax_mul _ _ _ (cprankMax_upper_bound (slice x i.1 (mem_range.1 i.2))) have h_dds_prod : (List.cons d ds).prod = Finset.card (Finset.range d) * prod ds := by simp [Finset.card_range] have : CPRankMax (Finset.card (Finset.attach (Finset.range d)) * prod ds) (∑ i ∈ Finset.attach (Finset.range d), unitVec d i.val ⊗ slice x i.val (mem_range.1 i.2)) := cprankMax_sum (Finset.range d).attach _ fun i _ => h_summands i have h_cprankMax_sum : CPRankMax (Finset.card (Finset.range d) * prod ds) (∑ i ∈ Finset.attach (Finset.range d), unitVec d i.val ⊗ slice x i.val (mem_range.1 i.2)) := by rwa [Finset.card_attach] at this rw [← sum_unitVec_mul_slice x] rw [h_dds_prod] exact h_cprankMax_sum
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprankMax_upper_bound
null
noncomputable cprank [Ring α] (x : Holor α ds) : Nat := @Nat.find (fun n => CPRankMax n x) (Classical.decPred _) ⟨ds.prod, cprankMax_upper_bound x⟩
def
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprank
The CP rank of a holor `x`: the smallest N such that `x` can be written as the sum of N holors of rank at most 1.
cprank_upper_bound [Ring α] : ∀ {ds}, ∀ x : Holor α ds, cprank x ≤ ds.prod := fun {ds} x => letI := Classical.decPred fun n : ℕ => CPRankMax n x Nat.find_min' ⟨ds.prod, show (fun n => CPRankMax n x) ds.prod from cprankMax_upper_bound x⟩ (cprankMax_upper_bound x)
theorem
Data
[ "Mathlib.Data.Nat.Find", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Data/Holor.lean
cprank_upper_bound
null
Ineq : Type | eq | le | lt deriving DecidableEq, Inhabited, Repr
inductive
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
Ineq
The three-element type `Ineq` is used to represent the strength of a comparison between terms.
max : Ineq → Ineq → Ineq | lt, _ => lt | _, lt => lt | le, _ => le | _, le => le | eq, eq => eq
def
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
max
`max R1 R2` computes the strength of the sum of two inequalities. If `t1 R1 0` and `t2 R2 0`, then `t1 + t2 (max R1 R2) 0`.
cmp : Ineq → Ineq → Ordering | eq, eq => Ordering.eq | eq, _ => Ordering.lt | le, le => Ordering.eq | le, lt => Ordering.lt | lt, lt => Ordering.eq | _, _ => Ordering.gt
def
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
cmp
`Ineq` is ordered `eq < le < lt`.
toString : Ineq → String | eq => "=" | le => "≤" | lt => "<"
def
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
toString
Prints an `Ineq` as the corresponding infix symbol.
ineq? (e : Expr) : MetaM (Ineq × Expr × Expr × Expr) := do let e ← whnfR (← instantiateMVars e) match e.eq? with | some p => return (Ineq.eq, p) | none => match e.le? with | some p => return (Ineq.le, p) | none => match e.lt? with | some p => return (Ineq.lt, p) | none => throwError "Not a comparison: {e}"
def
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
ineq
Given an expression `e`, parse it as a `=`, `≤` or `<`, and return this relation (as a `Linarith.Ineq`) together with the type in which the (in)equality occurs and the two sides of the (in)equality. This function is more naturally in the `Option` monad, but it is convenient to put in `MetaM` for compositionality.
ineqOrNotIneq? (e : Expr) : MetaM (Bool × Ineq × Expr × Expr × Expr) := do try return (true, ← e.ineq?) catch _ => let some e' := e.not? | throwError "Not a comparison: {e}" return (false, ← e'.ineq?)
def
Data
[ "Mathlib.Lean.Expr.Basic" ]
Mathlib/Data/Ineq.lean
ineqOrNotIneq
Given an expression `e`, parse it as a `=`, `≤` or `<`, or the negation of such, and return this relation (as a `Linarith.Ineq`) together with the type in which the (in)equality occurs, the two sides of the (in)equality, and a Boolean flag indicating the presence or absence of the `¬`. This function is more naturally in the `Option` monad, but it is convenient to put in `MetaM` for compositionality.
Opposite where /-- The canonical map `α → αᵒᵖ`. -/ op :: /-- The canonical map `αᵒᵖ → α`. -/ unop : α attribute [pp_nodot] Opposite.unop
structure
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
Opposite
The type of objects of the opposite of `α`; used to define the opposite category. Now that Lean 4 supports definitional eta equality for records, both `unop (op X) = X` and `op (unop X) = X` are definitional equalities.
@[app_unexpander Opposite.op] protected Opposite.unexpander_op : Lean.PrettyPrinter.Unexpander | s => pure s @[inherit_doc] notation:max -- Use a high right binding power (like that of postfix ⁻¹) so that, for example, α "ᵒᵖ" => Opposite α
def
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
Opposite.unexpander_op
Make sure that `Opposite.op a` is pretty-printed as `op a` instead of `{ unop := a }` or `⟨a⟩`.
op_injective : Function.Injective (op : α → αᵒᵖ) := fun _ _ => congr_arg Opposite.unop
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
op_injective
null
unop_injective : Function.Injective (unop : αᵒᵖ → α) := fun ⟨_⟩⟨_⟩ => by simp @[simp]
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
unop_injective
null
op_unop (x : αᵒᵖ) : op (unop x) = x := rfl
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
op_unop
null
unop_op (x : α) : unop (op x) = x := rfl
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
unop_op
null
op_inj_iff (x y : α) : op x = op y ↔ x = y := op_injective.eq_iff @[simp]
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
op_inj_iff
null
unop_inj_iff (x y : αᵒᵖ) : unop x = unop y ↔ x = y := unop_injective.eq_iff
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
unop_inj_iff
null
equivToOpposite : α ≃ αᵒᵖ where toFun := op invFun := unop left_inv := unop_op right_inv := op_unop
def
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
equivToOpposite
The type-level equivalence between a type and its opposite.
op_surjective : Function.Surjective (op : α → αᵒᵖ) := equivToOpposite.surjective
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
op_surjective
null
unop_surjective : Function.Surjective (unop : αᵒᵖ → α) := equivToOpposite.symm.surjective @[simp]
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
unop_surjective
null
equivToOpposite_coe : (equivToOpposite : α → αᵒᵖ) = op := rfl @[simp]
theorem
Data
[ "Mathlib.Logic.Equiv.Defs", "Mathlib.Logic.Small.Defs" ]
Mathlib/Data/Opposite.lean
equivToOpposite_coe
null