Download lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 4.87 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean
-
curl -L -o Triangular.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean
4.87 kB
Lean 4 · 30
declarations statementsfull
@[ext] structure Triangular (R F : Type*) where body · 3 lines
top : R
bottom : R
off : Fdef coordinates : Triangular R F ≃ (R × R) × F where body · 4 lines
toFun x := ((x.top, x.bottom), x.off)
invFun x := ⟨x.1.1, x.1.2, x.2⟩
left_inv _ := rfl
right_inv _ := rflinstance [AddCommGroup R] [AddCommGroup F] : AddCommGroup (Triangular R F) := body · 1 line
coordinates.addCommGroup
def coordinateAddEquiv [AddCommGroup R] [AddCommGroup F] :
Triangular R F ≃+ (R × R) × F where body · 2 lines
toEquiv := coordinates
map_add' _ _ := rflinstance : One (Triangular R F) := ⟨⟨1, 1, 0⟩⟩ instance : Mul (Triangular R F) := body · 2 lines
⟨fun x y => ⟨x.top * y.top, x.bottom * y.bottom,
x.bottom • y.off + MulOpposite.op y.top • x.off⟩⟩@[simp] theorem top_zero : (0 : Triangular R F).top = 0 := rfl @[simp] theorem bottom_zero : (0 : Triangular R F).bottom = 0 := rfl @[simp] theorem off_zero : (0 : Triangular R F).off = 0 := rfl @[simp] theorem top_one : (1 : Triangular R F).top = 1 := rfl @[simp] theorem bottom_one : (1 : Triangular R F).bottom = 1 := rfl @[simp] theorem off_one : (1 : Triangular R F).off = 0 := rfl @[simp] theorem top_add (x y : Triangular R F) : (x + y).top = x.top + y.top := rfl @[simp] theorem bottom_add (x y : Triangular R F) :
(x + y).bottom = x.bottom + y.bottom := rfl @[simp] theorem off_add (x y : Triangular R F) : (x + y).off = x.off + y.off := rfl @[simp] theorem top_mul (x y : Triangular R F) : (x * y).top = x.top * y.top := rfl @[simp] theorem bottom_mul (x y : Triangular R F) :
(x * y).bottom = x.bottom * y.bottom := rfl @[simp] theorem off_mul (x y : Triangular R F) :
(x * y).off = x.bottom • y.off + MulOpposite.op y.top • x.off := rfl instance : Ring (Triangular R F) where body · 14 lines
__ := (inferInstance : AddCommGroup (Triangular R F))
mul_assoc x y z := by
ext
· exact mul_assoc ..
· exact mul_assoc ..
· simp only [off_mul, bottom_mul, top_mul, mul_smul, smul_add, MulOpposite.op_mul]
rw [← smul_comm x.bottom (MulOpposite.op z.top) y.off]
exact (add_assoc ..).symm
one_mul x := by ext <;> simp
mul_one x := by ext <;> simp
left_distrib x y z := by ext <;> simp [mul_add, smul_add, add_smul, add_add_add_comm]
right_distrib x y z := by ext <;> simp [add_mul, smul_add, add_smul, add_add_add_comm]
zero_mul x := by ext <;> simp
mul_zero x := by ext <;> simpdef diagonal : Triangular R F →+* R × R where body · 5 lines
toFun x := (x.top, x.bottom)
map_one' := rfl
map_mul' _ _ := rfl
map_zero' := rfl
map_add' _ _ := rfltheorem diagonal_surjective : Function.Surjective (diagonal (R := R) (F := F)) := by proof · 2 lines
intro x
exact ⟨⟨x.1, x.2, 0⟩, rfl⟩def offDiagonal (f : F) : Triangular R F := ⟨0, 0, f⟩ @[simp] theorem offDiagonal_mul_offDiagonal (f g : F) :
offDiagonal (R := R) f * offDiagonal g = 0 := by proof · 1 line
ext <;> simp [offDiagonal]
instance : Module k (Triangular R F) := coordinateAddEquiv.module k @[simp] theorem top_smul (c : k) (x : Triangular R F) : (c • x).top = c • x.top := rfl @[simp] theorem bottom_smul (c : k) (x : Triangular R F) :
(c • x).bottom = c • x.bottom := rfl @[simp] theorem off_smul (c : k) (x : Triangular R F) : (c • x).off = c • x.off := rfl instance : Algebra k (Triangular R F) := Algebra.ofModule body · 15 lines
(by
intro c x y
ext
· exact smul_mul_assoc c x.top y.top
· exact smul_mul_assoc c x.bottom y.bottom
· simp only [off_mul, off_smul, bottom_smul, smul_assoc, smul_add]
rw [← smul_comm c (MulOpposite.op y.top) x.off])
(by
intro c x y
ext
· exact mul_smul_comm c x.top y.top
· exact mul_smul_comm c x.bottom y.bottom
· simp only [off_mul, off_smul, top_smul, MulOpposite.op_smul,
smul_assoc, smul_add]
rw [← smul_comm c x.bottom y.off])def coordinateLinearEquiv : Triangular R F ≃ₗ[k] (R × R) × F := body · 1 line
(coordinateAddEquiv (R := R) (F := F)).linearEquiv kinstance [Module.Finite k R] [Module.Finite k F] : Module.Finite k (Triangular R F) := body · 1 line
Module.Finite.equiv (coordinateLinearEquiv (R := R) (F := F) k).symmOutline
- structure
Triangular12 - def
coordinates21 - instance
27 - def
coordinateAddEquiv30 - instance
38 - instance
40 - theorem
top_zero48 - theorem
bottom_zero49 - theorem
off_zero50 - theorem
top_one51 - theorem
bottom_one52 - theorem
off_one53 - theorem
top_add54 - theorem
bottom_add55 - theorem
off_add57 - theorem
top_mul60 - theorem
bottom_mul61 - theorem
off_mul63 - instance
68 - def
diagonal84 - theorem
diagonal_surjective91 - def
offDiagonal95 - theorem
offDiagonal_mul_offDiagonal97 - instance
105 - theorem
top_smul107 - theorem
bottom_smul108 - theorem
off_smul110 - instance
115 - def
coordinateLinearEquiv132 - instance
135