Skip to content

Commit ab1b6d9

Browse files
committed
add test
1 parent 890c4e9 commit ab1b6d9

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

tests/lean/run/simpNumbers.lean

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
namespace Test
3+
4+
class CategoryStruct (obj : Type) where
5+
Hom : obj → obj → Type
6+
id : ∀ X : obj, Hom X X
7+
comp : ∀ {X Y Z : obj}, (Hom X Y) → (Hom Y Z) → (Hom X Z)
8+
9+
variable (ι : Type) (V : Type) [CategoryStruct V]
10+
11+
notation (priority := high) "𝟙" => CategoryStruct.id
12+
infixr:10 (priority := high) "" => CategoryStruct.Hom
13+
14+
structure Functor (C : Type) [CategoryStruct C] (D : Type) [CategoryStruct D] where
15+
obj : C → D
16+
map : ∀ {X Y : C}, (X ⟶ Y) → (obj X ⟶ obj Y)
17+
map_id : ∀ X : C, map (𝟙 X) = 𝟙 (obj X)
18+
19+
20+
structure HomologicalComplex where
21+
X : ι → V
22+
23+
@[ext]
24+
structure Hom (A B : HomologicalComplex ι V) where
25+
f : ∀ i, A.X i ⟶ B.X i
26+
27+
def id (A : HomologicalComplex ι V) : Hom ι V A A where f _ := 𝟙 _
28+
29+
30+
instance : CategoryStruct (HomologicalComplex ι V) where
31+
Hom A B := Test.Hom ι V A B
32+
id _ := { f := fun _ => 𝟙 _ }
33+
comp f g := { f := fun i => CategoryStruct.comp (f.f i) (g.f i) }
34+
35+
@[simp] theorem ha {A : HomologicalComplex ι V} {i} : Test.Hom.f (𝟙 A) i = 𝟙 _ := rfl
36+
37+
@[ext]
38+
theorem hom_ext {C D : HomologicalComplex ι V} (f g : C ⟶ D)
39+
(h : ∀ i, f.f i = g.f i) : f = g := by
40+
apply Hom.ext
41+
funext
42+
apply h
43+
44+
variable [OfNat V 0] [DecidableEq ι] [∀ a b : V, Zero (a ⟶ b)]
45+
46+
/--
47+
warning: declaration uses 'sorry'
48+
---
49+
warning: declaration uses 'sorry'
50+
-/
51+
#guard_msgs in
52+
noncomputable def single'' (j : ι) : Functor V (HomologicalComplex ι V) where
53+
obj A :=
54+
{ X := fun i => if i = j then A else 0 }
55+
map f := { f := fun i => if h : i = j then sorry else 0 }
56+
map_id A := by
57+
ext i
58+
dsimp [Functor.map_id]
59+
by_cases h : ¬i = j
60+
· rw [if_neg h]
61+
sorry
62+
· sorry

0 commit comments

Comments
 (0)