file
stringlengths 21
79
| dependencies
sequencelengths 1
16
| definitions
listlengths 1
625
| theorem_idx
int64 0
574
| theorem
stringlengths 3
121
| theorem_loc
sequencelengths 2
2
| tactic_idx
int64 0
155
| tactic_len
int64 1
156
| tactic
stringlengths 3
5.76k
| state_before
stringlengths 7
13.6k
| state_after
stringlengths 7
13.6k
|
---|---|---|---|---|---|---|---|---|---|---|
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 0 | 6 | rw [← sUnion_pair] | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
⊢ (x ∪ y).IsTransitive | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
⊢ (⋃₀ {x, y}).IsTransitive |
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 1 | 6 | apply IsTransitive.sUnion' fun z => _ | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
⊢ (⋃₀ {x, y}).IsTransitive | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
⊢ ∀ z ∈ {x, y}, z.IsTransitive |
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 2 | 6 | intro | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
⊢ ∀ z ∈ {x, y}, z.IsTransitive | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
z✝ : ZFSet
⊢ z✝ ∈ {x, y} → z✝.IsTransitive |
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 3 | 6 | rw [mem_pair] | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
z✝ : ZFSet
⊢ z✝ ∈ {x, y} → z✝.IsTransitive | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
z✝ : ZFSet
⊢ z✝ = x ∨ z✝ = y → z✝.IsTransitive |
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 4 | 6 | rintro (rfl | rfl) | x y z : ZFSet
hx : x.IsTransitive
hy : y.IsTransitive
z✝ : ZFSet
⊢ z✝ = x ∨ z✝ = y → z✝.IsTransitive | case inl
y z : ZFSet
hy : y.IsTransitive
z✝ : ZFSet
hx : z✝.IsTransitive
⊢ z✝.IsTransitive
case inr
x z : ZFSet
hx : x.IsTransitive
z✝ : ZFSet
hy : z✝.IsTransitive
⊢ z✝.IsTransitive |
Mathlib/SetTheory/ZFC/Ordinal.lean | [
[
"Mathlib.SetTheory.ZFC.Basic",
"Mathlib/SetTheory/ZFC/Basic.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def IsTransitive (x : ZFSet) : Prop :=\n ∀ y ∈ x, y ⊆ x",
"end": [
41,
17
],
"full_name": "ZFSet.IsTransitive",
"kind": "commanddeclaration",
"start": [
39,
1
]
},
{
"code": "@[simp]\ntheorem empty_isTransitive : IsTransitive ∅",
"end": [
45,
85
],
"full_name": "ZFSet.empty_isTransitive",
"kind": "commanddeclaration",
"start": [
44,
1
]
},
{
"code": "theorem IsTransitive.subset_of_mem (h : x.IsTransitive) : y ∈ x → y ⊆ x",
"end": [
49,
6
],
"full_name": "ZFSet.IsTransitive.subset_of_mem",
"kind": "commanddeclaration",
"start": [
48,
1
]
},
{
"code": "theorem isTransitive_iff_mem_trans : z.IsTransitive ↔ ∀ {x y : ZFSet}, x ∈ y → y ∈ z → x ∈ z",
"end": [
53,
73
],
"full_name": "ZFSet.isTransitive_iff_mem_trans",
"kind": "commanddeclaration",
"start": [
52,
1
]
},
{
"code": "protected theorem IsTransitive.inter (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∩ y).IsTransitive",
"end": [
62,
53
],
"full_name": "ZFSet.IsTransitive.inter",
"kind": "commanddeclaration",
"start": [
59,
1
]
},
{
"code": "protected theorem IsTransitive.sUnion (h : x.IsTransitive) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
68,
50
],
"full_name": "ZFSet.IsTransitive.sUnion",
"kind": "commanddeclaration",
"start": [
65,
1
]
},
{
"code": "theorem IsTransitive.sUnion' (H : ∀ y ∈ x, IsTransitive y) :\n (⋃₀ x : ZFSet).IsTransitive",
"end": [
74,
57
],
"full_name": "ZFSet.IsTransitive.sUnion'",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :\n (x ∪ y).IsTransitive",
"end": [
84,
14
],
"full_name": "ZFSet.IsTransitive.union",
"kind": "commanddeclaration",
"start": [
77,
1
]
},
{
"code": "protected theorem IsTransitive.powerset (h : x.IsTransitive) : (powerset x).IsTransitive",
"end": [
90,
32
],
"full_name": "ZFSet.IsTransitive.powerset",
"kind": "commanddeclaration",
"start": [
87,
1
]
},
{
"code": "theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x",
"end": [
96,
79
],
"full_name": "ZFSet.isTransitive_iff_sUnion_subset",
"kind": "commanddeclaration",
"start": [
93,
1
]
},
{
"code": "theorem isTransitive_iff_subset_powerset : x.IsTransitive ↔ x ⊆ powerset x",
"end": [
103,
100
],
"full_name": "ZFSet.isTransitive_iff_subset_powerset",
"kind": "commanddeclaration",
"start": [
102,
1
]
}
] | 6 | ZFSet.IsTransitive.union | [
[
78,
29
],
[
84,
14
]
] | 5 | 6 | assumption' | case inl
y z : ZFSet
hy : y.IsTransitive
z✝ : ZFSet
hx : z✝.IsTransitive
⊢ z✝.IsTransitive
case inr
x z : ZFSet
hx : x.IsTransitive
z✝ : ZFSet
hy : z✝.IsTransitive
⊢ z✝.IsTransitive | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 0 | Surreal.Multiplication.P3_comm | [
[
96,
52
],
[
98,
34
]
] | 0 | 2 | rw [P3, P3, add_comm] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ ⟦x₂ * y₁⟧ + ⟦x₁ * y₂⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ ↔ ⟦y₁ * x₂⟧ + ⟦y₂ * x₁⟧ < ⟦y₁ * x₁⟧ + ⟦y₂ * x₂⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 0 | Surreal.Multiplication.P3_comm | [
[
96,
52
],
[
98,
34
]
] | 1 | 2 | congr! 2 <;> rw [quot_mul_comm] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ ⟦x₂ * y₁⟧ + ⟦x₁ * y₂⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ ↔ ⟦y₁ * x₂⟧ + ⟦y₂ * x₁⟧ < ⟦y₁ * x₁⟧ + ⟦y₂ * x₂⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 1 | Surreal.Multiplication.P3.trans | [
[
100,
80
],
[
103,
44
]
] | 0 | 3 | rw [P3] at h₁ h₂ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : P3 x₁ x₂ y₁ y₂
h₂ : P3 x₂ x₃ y₁ y₂
⊢ P3 x₁ x₃ y₁ y₂ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧
h₂ : ⟦x₂ * y₂⟧ + ⟦x₃ * y₁⟧ < ⟦x₂ * y₁⟧ + ⟦x₃ * y₂⟧
⊢ P3 x₁ x₃ y₁ y₂ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 1 | Surreal.Multiplication.P3.trans | [
[
100,
80
],
[
103,
44
]
] | 1 | 3 | rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧
h₂ : ⟦x₂ * y₂⟧ + ⟦x₃ * y₁⟧ < ⟦x₂ * y₁⟧ + ⟦x₃ * y₂⟧
⊢ P3 x₁ x₃ y₁ y₂ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧
h₂ : ⟦x₂ * y₂⟧ + ⟦x₃ * y₁⟧ < ⟦x₂ * y₁⟧ + ⟦x₃ * y₂⟧
⊢ ⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧ + (⟦x₁ * y₂⟧ + ⟦x₃ * y₁⟧) < ⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧ + (⟦x₁ * y₁⟧ + ⟦x₃ * y₂⟧) |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 1 | Surreal.Multiplication.P3.trans | [
[
100,
80
],
[
103,
44
]
] | 2 | 3 | convert add_lt_add h₁ h₂ using 1 <;> abel | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧
h₂ : ⟦x₂ * y₂⟧ + ⟦x₃ * y₁⟧ < ⟦x₂ * y₁⟧ + ⟦x₃ * y₂⟧
⊢ ⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧ + (⟦x₁ * y₂⟧ + ⟦x₃ * y₁⟧) < ⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧ + (⟦x₁ * y₁⟧ + ⟦x₃ * y₂⟧) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 2 | Surreal.Multiplication.P3_neg | [
[
105,
57
],
[
108,
10
]
] | 0 | 3 | simp_rw [P3, quot_neg_mul] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ ↔ -⟦x₂ * y₂⟧ + -⟦x₁ * y₁⟧ < -⟦x₂ * y₁⟧ + -⟦x₁ * y₂⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 2 | Surreal.Multiplication.P3_neg | [
[
105,
57
],
[
108,
10
]
] | 1 | 3 | rw [← _root_.neg_lt_neg_iff] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ ↔ -⟦x₂ * y₂⟧ + -⟦x₁ * y₁⟧ < -⟦x₂ * y₁⟧ + -⟦x₁ * y₂⟧ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ -(⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧) < -(⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧) ↔ -⟦x₂ * y₂⟧ + -⟦x₁ * y₁⟧ < -⟦x₂ * y₁⟧ + -⟦x₁ * y₂⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 2 | Surreal.Multiplication.P3_neg | [
[
105,
57
],
[
108,
10
]
] | 2 | 3 | abel_nf | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ -(⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧) < -(⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧) ↔ -⟦x₂ * y₂⟧ + -⟦x₁ * y₁⟧ < -⟦x₂ * y₁⟧ + -⟦x₁ * y₂⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 0 | 8 | rw [P2, P2] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ ↔ -x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 1 | 8 | constructor | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ ↔ -x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧ | case mp
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧) → -x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧
case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (-x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 2 | 8 | · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]
exact (· ·) | case mp
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧) → -x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧
case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (-x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ | case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (-x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 3 | 8 | · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]
exact (· ·) | case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (-x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 4 | 8 | rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm] | case mp
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧) → -x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧ | case mp
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₂ ≈ x₁ → ⟦x₂ * y⟧ = ⟦x₁ * y⟧) → x₂ ≈ x₁ → ⟦x₂ * y⟧ = ⟦x₁ * y⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 5 | 8 | exact (· ·) | case mp
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₂ ≈ x₁ → ⟦x₂ * y⟧ = ⟦x₁ * y⟧) → x₂ ≈ x₁ → ⟦x₂ * y⟧ = ⟦x₁ * y⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 6 | 8 | rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm] | case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (-x₂ ≈ -x₁ → ⟦-x₂ * y⟧ = ⟦-x₁ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ | case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 3 | Surreal.Multiplication.P2_neg_left | [
[
110,
54
],
[
116,
16
]
] | 7 | 8 | exact (· ·) | case mpr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ (x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧) → x₁ ≈ x₂ → ⟦x₁ * y⟧ = ⟦x₂ * y⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 4 | Surreal.Multiplication.P2_neg_right | [
[
118,
52
],
[
119,
51
]
] | 0 | 1 | rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 5 | Surreal.Multiplication.P4_neg_left | [
[
121,
54
],
[
122,
62
]
] | 0 | 1 | simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 6 | Surreal.Multiplication.P4_neg_right | [
[
124,
52
],
[
125,
33
]
] | 0 | 1 | rw [P4, P4, neg_neg, and_comm] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 7 | Surreal.Multiplication.P24_neg_left | [
[
127,
57
],
[
127,
99
]
] | 0 | 1 | rw [P24, P24, P2_neg_left, P4_neg_left] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 8 | Surreal.Multiplication.P24_neg_right | [
[
128,
55
],
[
128,
99
]
] | 0 | 1 | rw [P24, P24, P2_neg_right, P4_neg_right] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
⊢ P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 9 | Surreal.Multiplication.mulOption_lt_iff_P1 | [
[
134,
79
],
[
136,
53
]
] | 0 | 2 | dsimp only [P1, mulOption, quot_sub, quot_add] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ ↔ P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
⊢ ⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft k⟧ - ⟦x.moveLeft i * y.moveLeft k⟧ <
-(⟦x.moveLeft j * -y⟧ + ⟦x * (-y).moveLeft l⟧ - ⟦x.moveLeft j * (-y).moveLeft l⟧) ↔
⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft k⟧ - ⟦x.moveLeft i * y.moveLeft k⟧ <
⟦x.moveLeft j * y⟧ + ⟦x * -(-y).moveLeft l⟧ - ⟦x.moveLeft j * -(-y).moveLeft l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 9 | Surreal.Multiplication.mulOption_lt_iff_P1 | [
[
134,
79
],
[
136,
53
]
] | 1 | 2 | simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
⊢ ⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft k⟧ - ⟦x.moveLeft i * y.moveLeft k⟧ <
-(⟦x.moveLeft j * -y⟧ + ⟦x * (-y).moveLeft l⟧ - ⟦x.moveLeft j * (-y).moveLeft l⟧) ↔
⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft k⟧ - ⟦x.moveLeft i * y.moveLeft k⟧ <
⟦x.moveLeft j * y⟧ + ⟦x * -(-y).moveLeft l⟧ - ⟦x.moveLeft j * -(-y).moveLeft l⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 10 | Surreal.Multiplication.mulOption_lt_mul_iff_P3 | [
[
139,
86
],
[
141,
27
]
] | 0 | 2 | dsimp only [mulOption, quot_sub, quot_add] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i : x.LeftMoves
j : y.LeftMoves
⊢ ⟦x.mulOption y i j⟧ < ⟦x * y⟧ ↔ P3 (x.moveLeft i) x (y.moveLeft j) y | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i : x.LeftMoves
j : y.LeftMoves
⊢ ⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft j⟧ - ⟦x.moveLeft i * y.moveLeft j⟧ < ⟦x * y⟧ ↔
P3 (x.moveLeft i) x (y.moveLeft j) y |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 10 | Surreal.Multiplication.mulOption_lt_mul_iff_P3 | [
[
139,
86
],
[
141,
27
]
] | 1 | 2 | exact sub_lt_iff_lt_add' | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
i : x.LeftMoves
j : y.LeftMoves
⊢ ⟦x.moveLeft i * y⟧ + ⟦x * y.moveLeft j⟧ - ⟦x.moveLeft i * y.moveLeft j⟧ < ⟦x * y⟧ ↔
P3 (x.moveLeft i) x (y.moveLeft j) y | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 11 | Surreal.Multiplication.P1_of_eq | [
[
144,
29
],
[
146,
56
]
] | 0 | 2 | rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
he : x₁ ≈ x₃
h₁ : P2 x₁ x₃ y₁
h₃ : P2 x₁ x₃ y₃
h3 : P3 x₁ x₂ y₂ y₃
⊢ P1 x₁ x₂ x₃ y₁ y₂ y₃ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
he : x₁ ≈ x₃
h₁ : P2 x₁ x₃ y₁
h₃ : P2 x₁ x₃ y₃
h3 : P3 x₁ x₂ y₂ y₃
⊢ ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ + ⟦x₁ * y₃⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₃⟧ + ⟦x₁ * y₂⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 11 | Surreal.Multiplication.P1_of_eq | [
[
144,
29
],
[
146,
56
]
] | 1 | 2 | convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
he : x₁ ≈ x₃
h₁ : P2 x₁ x₃ y₁
h₃ : P2 x₁ x₃ y₃
h3 : P3 x₁ x₂ y₂ y₃
⊢ ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ + ⟦x₁ * y₃⟧ < ⟦x₁ * y₁⟧ + ⟦x₂ * y₃⟧ + ⟦x₁ * y₂⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 12 | Surreal.Multiplication.P1_of_lt | [
[
148,
86
],
[
150,
44
]
] | 0 | 2 | rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : P3 x₃ x₂ y₂ y₃
h₂ : P3 x₁ x₃ y₂ y₁
⊢ P1 x₁ x₂ x₃ y₁ y₂ y₃ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : P3 x₃ x₂ y₂ y₃
h₂ : P3 x₁ x₃ y₂ y₁
⊢ ⟦x₃ * y₂⟧ + (⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ + ⟦x₃ * y₃⟧) < ⟦x₃ * y₂⟧ + (⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ + ⟦x₁ * y₂⟧) |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 12 | Surreal.Multiplication.P1_of_lt | [
[
148,
86
],
[
150,
44
]
] | 1 | 2 | convert add_lt_add h₁ h₂ using 1 <;> abel | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
h₁ : P3 x₃ x₂ y₂ y₃
h₂ : P3 x₁ x₃ y₂ y₁
⊢ ⟦x₃ * y₂⟧ + (⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ + ⟦x₃ * y₃⟧) < ⟦x₃ * y₂⟧ + (⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ + ⟦x₁ * y₂⟧) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 13 | Surreal.Multiplication.Args.numeric_P1 | [
[
165,
80
],
[
166,
39
]
] | 0 | 1 | simp [Args.Numeric, Args.toMultiset] | x✝ x₁ x₂ x₃ x' y✝ y₁ y₂ y₃ y' : PGame
x y : PGame
⊢ (P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 14 | Surreal.Multiplication.Args.numeric_P24 | [
[
169,
73
],
[
170,
39
]
] | 0 | 1 | simp [Args.Numeric, Args.toMultiset] | x x₁✝ x₂✝ x₃ x' y✝ y₁ y₂ y₃ y' : PGame
x₁ x₂ y : PGame
⊢ (P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 22 | Surreal.Multiplication.ih1 | [
[
220,
24
],
[
223,
64
]
] | 0 | 5 | rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
⊢ IH1 x y | case inl
x x₁✝ x₂✝ x₃ x' y₁ y₂ y₃ y'✝ x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y') → P124 a
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y')
case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y) |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 22 | Surreal.Multiplication.ih1 | [
[
220,
24
],
[
223,
64
]
] | 1 | 5 | on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy) | case inl
x x₁✝ x₂✝ x₃ x' y₁ y₂ y₃ y'✝ x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y') → P124 a
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y')
case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y) | case inl
x x₁✝ x₂✝ x₃ x' y₁ y₂ y₃ y'✝ x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y') → P124 a
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y')
case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ TransGen (CutExpand IsOption) (Args.P24 x₁ x₂ y').toMultiset {x, y'} |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 22 | Surreal.Multiplication.ih1 | [
[
220,
24
],
[
223,
64
]
] | 2 | 5 | all_goals exact TransGen.single (cutExpand_double_left h₁ h₂) | case inl
x x₁✝ x₂✝ x₃ x' y₁ y₂ y₃ y'✝ x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y') → P124 a
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y')
case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ TransGen (CutExpand IsOption) (Args.P24 x₁ x₂ y').toMultiset {x, y'} | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 22 | Surreal.Multiplication.ih1 | [
[
220,
24
],
[
223,
64
]
] | 3 | 5 | refine TransGen.tail ?_ (cutExpand_pair_right hy) | case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ ArgsRel (Args.P24 x₁ x₂ y') (Args.P1 x y) | case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ TransGen (CutExpand IsOption) (Args.P24 x₁ x₂ y').toMultiset {x, y'} |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 22 | Surreal.Multiplication.ih1 | [
[
220,
24
],
[
223,
64
]
] | 4 | 5 | exact TransGen.single (cutExpand_double_left h₁ h₂) | case inr
x x₁✝ x₂✝ x₃ x' y y₁ y₂ y₃ y'✝ : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
x₁ x₂ y' : PGame
h₁ : x₁.IsOption x
h₂ : x₂.IsOption x
hy : y'.IsOption y
⊢ TransGen (CutExpand IsOption) (Args.P24 x₁ x₂ y').toMultiset {x, y'} | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 0 | 9 | obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | case inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i < x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 1 | 9 | · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h | case inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i < x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 2 | 9 | · have ml := @IsOption.moveLeft
exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1
(ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l) | case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧
case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 3 | 9 | · rw [mulOption_neg_neg, lt_neg]
exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h | case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 4 | 9 | exact mulOption_lt_of_lt hy ihxy ihyx i j k l h | case inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i < x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 5 | 9 | have ml := @IsOption.moveLeft | case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
ml : ∀ {x : PGame} (i : x.LeftMoves), (x.moveLeft i).IsOption x
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 6 | 9 | exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1
(ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l) | case inr.inl
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft i ≈ x.moveLeft j
ml : ∀ {x : PGame} (i : x.LeftMoves), (x.moveLeft i).IsOption x
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 7 | 9 | rw [mulOption_neg_neg, lt_neg] | case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ | case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption (-y) j l⟧ < -⟦x.mulOption (- -y) i (toLeftMovesNeg (toRightMovesNeg k))⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 27 | Surreal.Multiplication.mulOption_lt | [
[
247,
90
],
[
254,
87
]
] | 8 | 9 | exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h | case inr.inr
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
i j : x.LeftMoves
k : y.LeftMoves
l : (-y).LeftMoves
h : x.moveLeft j < x.moveLeft i
⊢ ⟦x.mulOption (-y) j l⟧ < -⟦x.mulOption (- -y) i (toLeftMovesNeg (toRightMovesNeg k))⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 0 | 29 | have ihxy := ih1 ih | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
⊢ (x * y).Numeric | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
⊢ (x * y).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 1 | 29 | have ihyx := ih1_swap ih | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
⊢ (x * y).Numeric | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
⊢ (x * y).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 2 | 29 | have ihxyn := ih1_neg_left (ih1_neg_right ihxy) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
⊢ (x * y).Numeric | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
⊢ (x * y).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 3 | 29 | have ihyxn := ih1_neg_left (ih1_neg_right ihyx) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
⊢ (x * y).Numeric | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ (x * y).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 4 | 29 | refine numeric_def.mpr ⟨?_, ?_, ?_⟩ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ (x * y).Numeric | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves) (j : (x * y).RightMoves), (x * y).moveLeft i < (x * y).moveRight j
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves), ((x * y).moveLeft i).Numeric
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (j : (x * y).RightMoves), ((x * y).moveRight j).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 5 | 29 | · simp_rw [lt_iff_game_lt]
intro i
rw [rightMoves_mul_iff]
constructor <;> (intro j l; revert i; rw [leftMoves_mul_iff (_ > ·)]; constructor <;> intro i k)
· apply mulOption_lt hx hy ihxy ihyx
· simp_rw [← mulOption_symm (-y), mulOption_neg_neg x]
apply mulOption_lt hy.neg hx.neg ihyxn ihxyn
· simp only [← mulOption_symm y]
apply mulOption_lt hy hx ihyx ihxy
· rw [mulOption_neg_neg y]
apply mulOption_lt hx.neg hy.neg ihxyn ihyxn | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves) (j : (x * y).RightMoves), (x * y).moveLeft i < (x * y).moveRight j
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves), ((x * y).moveLeft i).Numeric
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (j : (x * y).RightMoves), ((x * y).moveRight j).Numeric | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves), ((x * y).moveLeft i).Numeric
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (j : (x * y).RightMoves), ((x * y).moveRight j).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 6 | 29 | all_goals
cases x; cases y
rintro (⟨i,j⟩|⟨i,j⟩) <;>
refine ((numeric_option_mul ih ?_).add <| numeric_mul_option ih ?_).sub
(numeric_option_mul_option ih ?_ ?_) <;>
solve_by_elim [IsOption.mk_left, IsOption.mk_right] | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves), ((x * y).moveLeft i).Numeric
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (j : (x * y).RightMoves), ((x * y).moveRight j).Numeric | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 7 | 29 | simp_rw [lt_iff_game_lt] | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves) (j : (x * y).RightMoves), (x * y).moveLeft i < (x * y).moveRight j | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves) (j : (x * y).RightMoves), ⟦(x * y).moveLeft i⟧ < ⟦(x * y).moveRight j⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 8 | 29 | intro i | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (i : (x * y).LeftMoves) (j : (x * y).RightMoves), ⟦(x * y).moveLeft i⟧ < ⟦(x * y).moveRight j⟧ | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
⊢ ∀ (j : (x * y).RightMoves), ⟦(x * y).moveLeft i⟧ < ⟦(x * y).moveRight j⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 9 | 29 | rw [rightMoves_mul_iff] | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
⊢ ∀ (j : (x * y).RightMoves), ⟦(x * y).moveLeft i⟧ < ⟦(x * y).moveRight j⟧ | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
⊢ (∀ (i_1 : x.LeftMoves) (j : (-y).LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦x.mulOption (-y) i_1 j⟧) ∧
∀ (i_1 : (-x).LeftMoves) (j : y.LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y i_1 j⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 10 | 29 | constructor <;> (intro j l; revert i; rw [leftMoves_mul_iff (_ > ·)]; constructor <;> intro i k) | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
⊢ (∀ (i_1 : x.LeftMoves) (j : (-y).LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦x.mulOption (-y) i_1 j⟧) ∧
∀ (i_1 : (-x).LeftMoves) (j : y.LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y i_1 j⟧ | case refine_1.left.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦(-x).mulOption (-y) i k⟧
case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 11 | 29 | · apply mulOption_lt hx hy ihxy ihyx | case refine_1.left.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦(-x).mulOption (-y) i k⟧
case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦(-x).mulOption (-y) i k⟧
case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 12 | 29 | · simp_rw [← mulOption_symm (-y), mulOption_neg_neg x]
apply mulOption_lt hy.neg hx.neg ihyxn ihxyn | case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦(-x).mulOption (-y) i k⟧
case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 13 | 29 | · simp only [← mulOption_symm y]
apply mulOption_lt hy hx ihyx ihxy | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 14 | 29 | · rw [mulOption_neg_neg y]
apply mulOption_lt hx.neg hy.neg ihxyn ihyxn | case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 15 | 29 | intro j l | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
⊢ ∀ (i_1 : (-x).LeftMoves) (j : y.LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y i_1 j⟧ | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
j : (-x).LeftMoves
l : y.LeftMoves
⊢ ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 16 | 29 | revert i | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
i : (x * y).LeftMoves
j : (-x).LeftMoves
l : y.LeftMoves
⊢ ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y j l⟧ | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
⊢ ∀ (i : (x * y).LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y j l⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 17 | 29 | rw [leftMoves_mul_iff (_ > ·)] | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
⊢ ∀ (i : (x * y).LeftMoves), ⟦(x * y).moveLeft i⟧ < -⟦(-x).mulOption y j l⟧ | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
⊢ (∀ (i : x.LeftMoves) (j_1 : y.LeftMoves), -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i j_1⟧) ∧
∀ (i : (-x).LeftMoves) (j_1 : (-y).LeftMoves), -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i j_1⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 18 | 29 | constructor <;> intro i k | case refine_1.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
⊢ (∀ (i : x.LeftMoves) (j_1 : y.LeftMoves), -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i j_1⟧) ∧
∀ (i : (-x).LeftMoves) (j_1 : (-y).LeftMoves), -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i j_1⟧ | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧
case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 19 | 29 | apply mulOption_lt hx hy ihxy ihyx | case refine_1.left.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦x.mulOption y i k⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 20 | 29 | simp_rw [← mulOption_symm (-y), mulOption_neg_neg x] | case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦x.mulOption (-y) j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-y).mulOption (- -x) l (toLeftMovesNeg (toRightMovesNeg j))⟧ > ⟦(-y).mulOption (-x) k i⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 21 | 29 | apply mulOption_lt hy.neg hx.neg ihyxn ihxyn | case refine_1.left.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : x.LeftMoves
l : (-y).LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-y).mulOption (- -x) l (toLeftMovesNeg (toRightMovesNeg j))⟧ > ⟦(-y).mulOption (-x) k i⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 22 | 29 | simp only [← mulOption_symm y] | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦x.mulOption y i k⟧ | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦y.mulOption (-x) l j⟧ > ⟦y.mulOption x k i⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 23 | 29 | apply mulOption_lt hy hx ihyx ihxy | case refine_1.right.left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : x.LeftMoves
k : y.LeftMoves
⊢ -⟦y.mulOption (-x) l j⟧ > ⟦y.mulOption x k i⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 24 | 29 | rw [mulOption_neg_neg y] | case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption y j l⟧ > ⟦(-x).mulOption (-y) i k⟧ | case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption (- -y) j (toLeftMovesNeg (toRightMovesNeg l))⟧ > ⟦(-x).mulOption (-y) i k⟧ |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 25 | 29 | apply mulOption_lt hx.neg hy.neg ihxyn ihyxn | case refine_1.right.right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
j : (-x).LeftMoves
l : y.LeftMoves
i : (-x).LeftMoves
k : (-y).LeftMoves
⊢ -⟦(-x).mulOption (- -y) j (toLeftMovesNeg (toRightMovesNeg l))⟧ > ⟦(-x).mulOption (-y) i k⟧ | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 26 | 29 | cases x | case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ihxy : IH1 x y
ihyx : IH1 y x
ihxyn : IH1 (-x) (-y)
ihyxn : IH1 (-y) (-x)
⊢ ∀ (j : (x * y).RightMoves), ((x * y).moveRight j).Numeric | case refine_3.mk
x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
hy : y.Numeric
α✝ β✝ : Type u
a✝¹ : α✝ → PGame
a✝ : β✝ → PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 (PGame.mk α✝ β✝ a✝¹ a✝) y) → P124 a
hx : (PGame.mk α✝ β✝ a✝¹ a✝).Numeric
ihxy : IH1 (PGame.mk α✝ β✝ a✝¹ a✝) y
ihyx : IH1 y (PGame.mk α✝ β✝ a✝¹ a✝)
ihxyn : IH1 (-PGame.mk α✝ β✝ a✝¹ a✝) (-y)
ihyxn : IH1 (-y) (-PGame.mk α✝ β✝ a✝¹ a✝)
⊢ ∀ (j : (PGame.mk α✝ β✝ a✝¹ a✝ * y).RightMoves), ((PGame.mk α✝ β✝ a✝¹ a✝ * y).moveRight j).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 27 | 29 | cases y | case refine_3.mk
x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
hy : y.Numeric
α✝ β✝ : Type u
a✝¹ : α✝ → PGame
a✝ : β✝ → PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 (PGame.mk α✝ β✝ a✝¹ a✝) y) → P124 a
hx : (PGame.mk α✝ β✝ a✝¹ a✝).Numeric
ihxy : IH1 (PGame.mk α✝ β✝ a✝¹ a✝) y
ihyx : IH1 y (PGame.mk α✝ β✝ a✝¹ a✝)
ihxyn : IH1 (-PGame.mk α✝ β✝ a✝¹ a✝) (-y)
ihyxn : IH1 (-y) (-PGame.mk α✝ β✝ a✝¹ a✝)
⊢ ∀ (j : (PGame.mk α✝ β✝ a✝¹ a✝ * y).RightMoves), ((PGame.mk α✝ β✝ a✝¹ a✝ * y).moveRight j).Numeric | case refine_3.mk.mk
x₁ x₂ x₃ x' y₁ y₂ y₃ y' : PGame
α✝¹ β✝¹ : Type u
a✝³ : α✝¹ → PGame
a✝² : β✝¹ → PGame
hx : (PGame.mk α✝¹ β✝¹ a✝³ a✝²).Numeric
α✝ β✝ : Type u
a✝¹ : α✝ → PGame
a✝ : β✝ → PGame
hy : (PGame.mk α✝ β✝ a✝¹ a✝).Numeric
ih : ∀ (a : Args), ArgsRel a (Args.P1 (PGame.mk α✝¹ β✝¹ a✝³ a✝²) (PGame.mk α✝ β✝ a✝¹ a✝)) → P124 a
ihxy : IH1 (PGame.mk α✝¹ β✝¹ a✝³ a✝²) (PGame.mk α✝ β✝ a✝¹ a✝)
ihyx : IH1 (PGame.mk α✝ β✝ a✝¹ a✝) (PGame.mk α✝¹ β✝¹ a✝³ a✝²)
ihxyn : IH1 (-PGame.mk α✝¹ β✝¹ a✝³ a✝²) (-PGame.mk α✝ β✝ a✝¹ a✝)
ihyxn : IH1 (-PGame.mk α✝ β✝ a✝¹ a✝) (-PGame.mk α✝¹ β✝¹ a✝³ a✝²)
⊢ ∀ (j : (PGame.mk α✝¹ β✝¹ a✝³ a✝² * PGame.mk α✝ β✝ a✝¹ a✝).RightMoves),
((PGame.mk α✝¹ β✝¹ a✝³ a✝² * PGame.mk α✝ β✝ a✝¹ a✝).moveRight j).Numeric |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 28 | Surreal.Multiplication.P1_of_ih | [
[
259,
39
],
[
281,
56
]
] | 28 | 29 | rintro (⟨i,j⟩|⟨i,j⟩) <;>
refine ((numeric_option_mul ih ?_).add <| numeric_mul_option ih ?_).sub
(numeric_option_mul_option ih ?_ ?_) <;>
solve_by_elim [IsOption.mk_left, IsOption.mk_right] | case refine_3.mk.mk
x₁ x₂ x₃ x' y₁ y₂ y₃ y' : PGame
α✝¹ β✝¹ : Type u
a✝³ : α✝¹ → PGame
a✝² : β✝¹ → PGame
hx : (PGame.mk α✝¹ β✝¹ a✝³ a✝²).Numeric
α✝ β✝ : Type u
a✝¹ : α✝ → PGame
a✝ : β✝ → PGame
hy : (PGame.mk α✝ β✝ a✝¹ a✝).Numeric
ih : ∀ (a : Args), ArgsRel a (Args.P1 (PGame.mk α✝¹ β✝¹ a✝³ a✝²) (PGame.mk α✝ β✝ a✝¹ a✝)) → P124 a
ihxy : IH1 (PGame.mk α✝¹ β✝¹ a✝³ a✝²) (PGame.mk α✝ β✝ a✝¹ a✝)
ihyx : IH1 (PGame.mk α✝ β✝ a✝¹ a✝) (PGame.mk α✝¹ β✝¹ a✝³ a✝²)
ihxyn : IH1 (-PGame.mk α✝¹ β✝¹ a✝³ a✝²) (-PGame.mk α✝ β✝ a✝¹ a✝)
ihyxn : IH1 (-PGame.mk α✝ β✝ a✝¹ a✝) (-PGame.mk α✝¹ β✝¹ a✝³ a✝²)
⊢ ∀ (j : (PGame.mk α✝¹ β✝¹ a✝³ a✝² * PGame.mk α✝ β✝ a✝¹ a✝).RightMoves),
((PGame.mk α✝¹ β✝¹ a✝³ a✝² * PGame.mk α✝ β✝ a✝¹ a✝).moveRight j).Numeric | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 0 | 8 | rw [IH24] | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ IH24 x₁ x₂ y | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ ∀ ⦃z : PGame⦄, (z.IsOption x₁ → P24 z x₂ y) ∧ (z.IsOption x₂ → P24 x₁ z y) ∧ (z.IsOption y → P24 x₁ x₂ z) |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 1 | 8 | refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>
refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ ∀ ⦃z : PGame⦄, (z.IsOption x₁ → P24 z x₂ y) ∧ (z.IsOption x₂ → P24 x₁ z y) ∧ (z.IsOption y → P24 x₁ x₂ z) | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₁
⊢ CutExpand IsOption (Args.P24 z x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 2 | 8 | · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h) | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₁
⊢ CutExpand IsOption (Args.P24 z x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 3 | 8 | · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h) | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset | case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 4 | 8 | · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h) | case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 5 | 8 | exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h) | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₁
⊢ CutExpand IsOption (Args.P24 z x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 6 | 8 | exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h) | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z y).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 29 | Surreal.Multiplication.ih₁₂ | [
[
295,
30
],
[
301,
63
]
] | 7 | 8 | exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h) | case refine_3
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z : PGame
h : z.IsOption y
⊢ CutExpand IsOption (Args.P24 x₁ x₂ z).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 0 | 8 | refine fun z w h ↦ ⟨?_, ?_⟩ | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ IH4 x₁ x₂ y | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
⊢ z.IsOption x₁ → P2 z x₂ w
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
⊢ z.IsOption x₂ → P2 x₁ z w |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 1 | 8 | all_goals
intro h'
apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|
(cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1
try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'
try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h' | case refine_1
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
⊢ z.IsOption x₁ → P2 z x₂ w
case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
⊢ z.IsOption x₂ → P2 x₁ z w | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 2 | 8 | intro h' | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
⊢ z.IsOption x₂ → P2 x₁ z w | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₂
⊢ P2 x₁ z w |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 3 | 8 | apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|
(cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1 | case refine_2
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₂
⊢ P2 x₁ z w | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z w).toMultiset ({x₁} + {x₂, w}) |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 4 | 8 | try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h' | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₁
⊢ CutExpand IsOption (Args.P24 z x₂ w).toMultiset ({x₁} + {x₂, w}) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 5 | 8 | try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h' | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z w).toMultiset ({x₁} + {x₂, w}) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 6 | 8 | exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h' | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₁
⊢ CutExpand IsOption (Args.P24 z x₂ w).toMultiset ({x₁} + {x₂, w}) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 31 | Surreal.Multiplication.ih4 | [
[
309,
28
],
[
316,
69
]
] | 7 | 8 | exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h' | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
z w : PGame
h : w.IsOption y
h' : z.IsOption x₂
⊢ CutExpand IsOption (Args.P24 x₁ z w).toMultiset ({x₁} + {x₂, w}) | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 32 | Surreal.Multiplication.numeric_of_ih | [
[
318,
62
],
[
321,
57
]
] | 0 | 5 | constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_) | x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ (x₁ * y).Numeric ∧ (x₂ * y).Numeric | case left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₁ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 32 | Surreal.Multiplication.numeric_of_ih | [
[
318,
62
],
[
321,
57
]
] | 1 | 5 | · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero | case left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₁ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset
case right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset | case right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 32 | Surreal.Multiplication.numeric_of_ih | [
[
318,
62
],
[
321,
57
]
] | 2 | 5 | · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero | case right
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₂ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Mathlib/SetTheory/Surreal/Multiplication.lean | [
[
"Mathlib.SetTheory.Surreal.Basic",
"Mathlib/SetTheory/Surreal/Basic.lean"
],
[
"Mathlib.Logic.Hydra",
"Mathlib/Logic/Hydra.lean"
],
[
"Init",
".lake/packages/lean4/src/lean/Init.lean"
]
] | [
{
"code": "def P1 (x₁ x₂ x₃ y₁ y₂ y₃ : PGame) :=\n ⟦x₁ * y₁⟧ + ⟦x₂ * y₂⟧ - ⟦x₁ * y₂⟧ < ⟦x₃ * y₁⟧ + ⟦x₂ * y₃⟧ - (⟦x₃ * y₃⟧ : Game)",
"end": [
74,
81
],
"full_name": "Surreal.Multiplication.P1",
"kind": "commanddeclaration",
"start": [
71,
1
]
},
{
"code": "def P2 (x₁ x₂ y : PGame) := x₁ ≈ x₂ → ⟦x₁ * y⟧ = (⟦x₂ * y⟧ : Game)",
"end": [
77,
67
],
"full_name": "Surreal.Multiplication.P2",
"kind": "commanddeclaration",
"start": [
76,
1
]
},
{
"code": "def P3 (x₁ x₂ y₁ y₂ : PGame) := ⟦x₁ * y₂⟧ + ⟦x₂ * y₁⟧ < ⟦x₁ * y₁⟧ + (⟦x₂ * y₂⟧ : Game)",
"end": [
80,
87
],
"full_name": "Surreal.Multiplication.P3",
"kind": "commanddeclaration",
"start": [
79,
1
]
},
{
"code": "def P4 (x₁ x₂ y : PGame) :=\n x₁ < x₂ → (∀ i, P3 x₁ x₂ (y.moveLeft i) y) ∧ ∀ j, P3 x₁ x₂ ((-y).moveLeft j) (-y)",
"end": [
87,
84
],
"full_name": "Surreal.Multiplication.P4",
"kind": "commanddeclaration",
"start": [
82,
1
]
},
{
"code": "def P24 (x₁ x₂ y : PGame) : Prop := P2 x₁ x₂ y ∧ P4 x₁ x₂ y",
"end": [
90,
60
],
"full_name": "Surreal.Multiplication.P24",
"kind": "commanddeclaration",
"start": [
89,
1
]
},
{
"code": "lemma P3_comm : P3 x₁ x₂ y₁ y₂ ↔ P3 y₁ y₂ x₁ x₂ := by\n rw [P3, P3, add_comm]\n congr! 2 <;> rw [quot_mul_comm]",
"end": [
98,
34
],
"full_name": "Surreal.Multiplication.P3_comm",
"kind": "lemma",
"start": [
96,
1
]
},
{
"code": "lemma P3.trans (h₁ : P3 x₁ x₂ y₁ y₂) (h₂ : P3 x₂ x₃ y₁ y₂) : P3 x₁ x₃ y₁ y₂ := by\n rw [P3] at h₁ h₂\n rw [P3, ← add_lt_add_iff_left (⟦x₂ * y₁⟧ + ⟦x₂ * y₂⟧)]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
103,
44
],
"full_name": "Surreal.Multiplication.P3.trans",
"kind": "lemma",
"start": [
100,
1
]
},
{
"code": "lemma P3_neg : P3 x₁ x₂ y₁ y₂ ↔ P3 (-x₂) (-x₁) y₁ y₂ := by\n simp_rw [P3, quot_neg_mul]\n rw [← _root_.neg_lt_neg_iff]\n abel_nf",
"end": [
108,
10
],
"full_name": "Surreal.Multiplication.P3_neg",
"kind": "lemma",
"start": [
105,
1
]
},
{
"code": "lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y := by\n rw [P2, P2]\n constructor\n · rw [quot_neg_mul, quot_neg_mul, eq_comm, neg_inj, neg_equiv_neg_iff, PGame.equiv_comm]\n exact (· ·)\n · rw [PGame.equiv_comm, neg_equiv_neg_iff, quot_neg_mul, quot_neg_mul, neg_inj, eq_comm]\n exact (· ·)",
"end": [
116,
16
],
"full_name": "Surreal.Multiplication.P2_neg_left",
"kind": "lemma",
"start": [
110,
1
]
},
{
"code": "lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y) := by\n rw [P2, P2, quot_mul_neg, quot_mul_neg, neg_inj]",
"end": [
119,
51
],
"full_name": "Surreal.Multiplication.P2_neg_right",
"kind": "lemma",
"start": [
118,
1
]
},
{
"code": "lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y := by\n simp_rw [P4, PGame.neg_lt_neg_iff, moveLeft_neg', ← P3_neg]",
"end": [
122,
62
],
"full_name": "Surreal.Multiplication.P4_neg_left",
"kind": "lemma",
"start": [
121,
1
]
},
{
"code": "lemma P4_neg_right : P4 x₁ x₂ y ↔ P4 x₁ x₂ (-y) := by\n rw [P4, P4, neg_neg, and_comm]",
"end": [
125,
33
],
"full_name": "Surreal.Multiplication.P4_neg_right",
"kind": "lemma",
"start": [
124,
1
]
},
{
"code": "lemma P24_neg_left : P24 x₁ x₂ y ↔ P24 (-x₂) (-x₁) y := by rw [P24, P24, P2_neg_left, P4_neg_left]",
"end": [
127,
99
],
"full_name": "Surreal.Multiplication.P24_neg_left",
"kind": "lemma",
"start": [
127,
1
]
},
{
"code": "lemma P24_neg_right : P24 x₁ x₂ y ↔ P24 x₁ x₂ (-y) := by rw [P24, P24, P2_neg_right, P4_neg_right]",
"end": [
128,
99
],
"full_name": "Surreal.Multiplication.P24_neg_right",
"kind": "lemma",
"start": [
128,
1
]
},
{
"code": "lemma mulOption_lt_iff_P1 {i j k l} :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔\n P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l) := by\n dsimp only [P1, mulOption, quot_sub, quot_add]\n simp_rw [neg_sub', neg_add, quot_mul_neg, neg_neg]",
"end": [
136,
53
],
"full_name": "Surreal.Multiplication.mulOption_lt_iff_P1",
"kind": "lemma",
"start": [
132,
1
]
},
{
"code": "lemma mulOption_lt_mul_iff_P3 {i j} :\n ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y := by\n dsimp only [mulOption, quot_sub, quot_add]\n exact sub_lt_iff_lt_add'",
"end": [
141,
27
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_iff_P3",
"kind": "lemma",
"start": [
138,
1
]
},
{
"code": "lemma P1_of_eq (he : x₁ ≈ x₃) (h₁ : P2 x₁ x₃ y₁) (h₃ : P2 x₁ x₃ y₃) (h3 : P3 x₁ x₂ y₂ y₃) :\n P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, ← h₁ he, ← h₃ he, sub_lt_sub_iff]\n convert add_lt_add_left h3 ⟦x₁ * y₁⟧ using 1 <;> abel",
"end": [
146,
56
],
"full_name": "Surreal.Multiplication.P1_of_eq",
"kind": "lemma",
"start": [
143,
1
]
},
{
"code": "lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃ := by\n rw [P1, sub_lt_sub_iff, ← add_lt_add_iff_left ⟦x₃ * y₂⟧]\n convert add_lt_add h₁ h₂ using 1 <;> abel",
"end": [
150,
44
],
"full_name": "Surreal.Multiplication.P1_of_lt",
"kind": "lemma",
"start": [
148,
1
]
},
{
"code": "inductive Args : Type (u+1)\n | P1 (x y : PGame.{u}) : Args\n | P24 (x₁ x₂ y : PGame.{u}) : Args",
"end": [
155,
37
],
"full_name": "Surreal.Multiplication.Args",
"kind": "commanddeclaration",
"start": [
152,
1
]
},
{
"code": "def Args.toMultiset : Args → Multiset PGame\n | (Args.P1 x y) => {x, y}\n | (Args.P24 x₁ x₂ y) => {x₁, x₂, y}",
"end": [
160,
38
],
"full_name": "Surreal.Multiplication.Args.toMultiset",
"kind": "commanddeclaration",
"start": [
157,
1
]
},
{
"code": "def Args.Numeric (a : Args) := ∀ x ∈ a.toMultiset, SetTheory.PGame.Numeric x",
"end": [
163,
77
],
"full_name": "Surreal.Multiplication.Args.Numeric",
"kind": "commanddeclaration",
"start": [
162,
1
]
},
{
"code": "lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
166,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P1",
"kind": "lemma",
"start": [
165,
1
]
},
{
"code": "lemma Args.numeric_P24 {x₁ x₂ y} :\n (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric := by\n simp [Args.Numeric, Args.toMultiset]",
"end": [
170,
39
],
"full_name": "Surreal.Multiplication.Args.numeric_P24",
"kind": "lemma",
"start": [
168,
1
]
},
{
"code": "def ArgsRel := InvImage (TransGen <| CutExpand IsOption) Args.toMultiset",
"end": [
177,
73
],
"full_name": "Surreal.Multiplication.ArgsRel",
"kind": "commanddeclaration",
"start": [
174,
1
]
},
{
"code": "theorem argsRel_wf : WellFounded ArgsRel",
"end": [
180,
89
],
"full_name": "Surreal.Multiplication.argsRel_wf",
"kind": "commanddeclaration",
"start": [
179,
1
]
},
{
"code": "def P124 : Args → Prop\n | (Args.P1 x y) => Numeric (x * y)\n | (Args.P24 x₁ x₂ y) => P24 x₁ x₂ y",
"end": [
185,
38
],
"full_name": "Surreal.Multiplication.P124",
"kind": "commanddeclaration",
"start": [
182,
1
]
},
{
"code": "lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric :=\n TransGen.closed' <| @cutExpand_closed _ IsOption ⟨wf_isOption.isIrrefl.1⟩ _ Numeric.isOption",
"end": [
189,
95
],
"full_name": "Surreal.Multiplication.ArgsRel.numeric_closed",
"kind": "lemma",
"start": [
187,
1
]
},
{
"code": "def IH1 (x y : PGame) : Prop :=\n ∀ ⦃x₁ x₂ y'⦄, IsOption x₁ x → IsOption x₂ x → (y' = y ∨ IsOption y' y) → P24 x₁ x₂ y'",
"end": [
193,
88
],
"full_name": "Surreal.Multiplication.IH1",
"kind": "commanddeclaration",
"start": [
191,
1
]
},
{
"code": "lemma ih1_neg_left : IH1 x y → IH1 (-x) y :=\n fun h x₁ x₂ y' h₁ h₂ hy ↦ by\n rw [isOption_neg] at h₁ h₂\n exact P24_neg_left.2 (h h₂ h₁ hy)",
"end": [
200,
38
],
"full_name": "Surreal.Multiplication.ih1_neg_left",
"kind": "lemma",
"start": [
197,
1
]
},
{
"code": "lemma ih1_neg_right : IH1 x y → IH1 x (-y) :=\n fun h x₁ x₂ y' ↦ by\n rw [← neg_eq_iff_eq_neg, isOption_neg, P24_neg_right]\n apply h",
"end": [
205,
12
],
"full_name": "Surreal.Multiplication.ih1_neg_right",
"kind": "lemma",
"start": [
202,
1
]
},
{
"code": "lemma numeric_option_mul (h : IsOption x' x) : (x' * y).Numeric :=\n ih (Args.P1 x' y) (TransGen.single <| cutExpand_pair_left h)",
"end": [
212,
63
],
"full_name": "Surreal.Multiplication.numeric_option_mul",
"kind": "lemma",
"start": [
211,
1
]
},
{
"code": "lemma numeric_mul_option (h : IsOption y' y) : (x * y').Numeric :=\n ih (Args.P1 x y') (TransGen.single <| cutExpand_pair_right h)",
"end": [
215,
64
],
"full_name": "Surreal.Multiplication.numeric_mul_option",
"kind": "lemma",
"start": [
214,
1
]
},
{
"code": "lemma numeric_option_mul_option (hx : IsOption x' x) (hy : IsOption y' y) : (x' * y').Numeric :=\n ih (Args.P1 x' y') ((TransGen.single <| cutExpand_pair_right hy).tail <| cutExpand_pair_left hx)",
"end": [
218,
99
],
"full_name": "Surreal.Multiplication.numeric_option_mul_option",
"kind": "lemma",
"start": [
217,
1
]
},
{
"code": "lemma ih1 : IH1 x y := by\n rintro x₁ x₂ y' h₁ h₂ (rfl|hy) <;> apply ih (Args.P24 _ _ _)\n on_goal 2 => refine TransGen.tail ?_ (cutExpand_pair_right hy)\n all_goals exact TransGen.single (cutExpand_double_left h₁ h₂)",
"end": [
223,
64
],
"full_name": "Surreal.Multiplication.ih1",
"kind": "lemma",
"start": [
220,
1
]
},
{
"code": "lemma ih1_swap : IH1 y x := ih1 <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih ⊢\n exact ih",
"end": [
227,
11
],
"full_name": "Surreal.Multiplication.ih1_swap",
"kind": "lemma",
"start": [
225,
1
]
},
{
"code": "lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :\n P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l) :=\n P3_comm.2 <| ((ihyx (IsOption.moveLeft k) (isOption_neg.1 <| .moveLeft l) <| Or.inl rfl).2\n (by rw [← moveRight_neg_symm]; apply hy.left_lt_right)).1 i",
"end": [
232,
64
],
"full_name": "Surreal.Multiplication.P3_of_ih",
"kind": "lemma",
"start": [
229,
1
]
},
{
"code": "lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y :=\n ihxy (IsOption.moveLeft i) (IsOption.moveLeft j) (Or.inl rfl)",
"end": [
235,
64
],
"full_name": "Surreal.Multiplication.P24_of_ih",
"kind": "lemma",
"start": [
234,
1
]
},
{
"code": "lemma mulOption_lt_of_lt (i j k l) (h : x.moveLeft i < x.moveLeft j) :\n (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ :=\n mulOption_lt_iff_P1.2 <| P1_of_lt (P3_of_ih hy ihyx j k l) <| ((P24_of_ih ihxy i j).2 h).1 k",
"end": [
245,
95
],
"full_name": "Surreal.Multiplication.mulOption_lt_of_lt",
"kind": "lemma",
"start": [
243,
1
]
},
{
"code": "lemma mulOption_lt (i j k l) : (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ := by\n obtain (h|h|h) := lt_or_equiv_or_gt (hx.moveLeft i) (hx.moveLeft j)\n · exact mulOption_lt_of_lt hy ihxy ihyx i j k l h\n · have ml := @IsOption.moveLeft\n exact mulOption_lt_iff_P1.2 (P1_of_eq h (P24_of_ih ihxy i j).1\n (ihxy (ml i) (ml j) <| Or.inr <| isOption_neg.1 <| ml l).1 <| P3_of_ih hy ihyx i k l)\n · rw [mulOption_neg_neg, lt_neg]\n exact mulOption_lt_of_lt hy.neg (ih1_neg_right ihxy) (ih1_neg_left ihyx) j i l _ h",
"end": [
254,
87
],
"full_name": "Surreal.Multiplication.mulOption_lt",
"kind": "lemma",
"start": [
247,
1
]
},
{
"code": "theorem P1_of_ih : (x * y).Numeric",
"end": [
281,
56
],
"full_name": "Surreal.Multiplication.P1_of_ih",
"kind": "commanddeclaration",
"start": [
258,
1
]
},
{
"code": "def IH24 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z⦄, (IsOption z x₁ → P24 z x₂ y) ∧ (IsOption z x₂ → P24 x₁ z y) ∧ (IsOption z y → P24 x₁ x₂ z)",
"end": [
285,
100
],
"full_name": "Surreal.Multiplication.IH24",
"kind": "commanddeclaration",
"start": [
283,
1
]
},
{
"code": "def IH4 (x₁ x₂ y : PGame) : Prop :=\n ∀ ⦃z w⦄, IsOption w y → (IsOption z x₁ → P2 z x₂ w) ∧ (IsOption z x₂ → P2 x₁ z w)",
"end": [
289,
84
],
"full_name": "Surreal.Multiplication.IH4",
"kind": "commanddeclaration",
"start": [
287,
1
]
},
{
"code": "lemma ih₁₂ : IH24 x₁ x₂ y := by\n rw [IH24]\n refine fun z ↦ ⟨?_, ?_, ?_⟩ <;>\n refine fun h ↦ ih' (Args.P24 _ _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_left h)\n · exact (cutExpand_add_left {x₁}).2 (cutExpand_pair_right h)",
"end": [
301,
63
],
"full_name": "Surreal.Multiplication.ih₁₂",
"kind": "lemma",
"start": [
295,
1
]
},
{
"code": "lemma ih₂₁ : IH24 x₂ x₁ y := ih₁₂ <| by\n simp_rw [ArgsRel, InvImage, Args.toMultiset, Multiset.pair_comm] at ih' ⊢\n suffices {x₁, y, x₂} = {x₂, y, x₁} by rwa [← this]\n dsimp only [Multiset.insert_eq_cons, ← Multiset.singleton_add] at ih' ⊢\n abel",
"end": [
307,
7
],
"full_name": "Surreal.Multiplication.ih₂₁",
"kind": "lemma",
"start": [
303,
1
]
},
{
"code": "lemma ih4 : IH4 x₁ x₂ y := by\n refine fun z w h ↦ ⟨?_, ?_⟩\n all_goals\n intro h'\n apply (ih' (Args.P24 _ _ _) <| (TransGen.single _).tail <|\n (cutExpand_add_left {x₁}).2 <| cutExpand_pair_right h).1\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_left h'\n try exact (cutExpand_add_right {w}).2 <| cutExpand_pair_right h'",
"end": [
316,
69
],
"full_name": "Surreal.Multiplication.ih4",
"kind": "lemma",
"start": [
309,
1
]
},
{
"code": "lemma numeric_of_ih : (x₁ * y).Numeric ∧ (x₂ * y).Numeric := by\n constructor <;> refine ih' (Args.P1 _ _) (TransGen.single ?_)\n · exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero\n · exact (cutExpand_add_right {x₂, y}).2 cutExpand_zero",
"end": [
321,
57
],
"full_name": "Surreal.Multiplication.numeric_of_ih",
"kind": "lemma",
"start": [
318,
1
]
},
{
"code": "lemma ih24_neg : IH24 x₁ x₂ y → IH24 (-x₂) (-x₁) y ∧ IH24 x₁ x₂ (-y) := by\n simp_rw [IH24, ← P24_neg_right, isOption_neg]\n refine fun h ↦ ⟨fun z ↦ ⟨?_, ?_, ?_⟩,\n fun z ↦ ⟨(@h z).1, (@h z).2.1, P24_neg_right.2 ∘ (@h <| -z).2.2⟩⟩\n all_goals\n rw [P24_neg_left]\n simp only [neg_neg]\n first | exact (@h <| -z).2.1 | exact (@h <| -z).1 | exact (@h z).2.2",
"end": [
331,
73
],
"full_name": "Surreal.Multiplication.ih24_neg",
"kind": "lemma",
"start": [
323,
1
]
},
{
"code": "lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y) := by\n simp_rw [IH4, isOption_neg]\n refine fun h ↦ ⟨fun z w h' ↦ ?_, fun z w h' ↦ ?_⟩\n · convert (h h').symm using 2 <;> rw [P2_neg_left, neg_neg]\n · convert h h' using 2 <;> rw [P2_neg_right]",
"end": [
338,
47
],
"full_name": "Surreal.Multiplication.ih4_neg",
"kind": "lemma",
"start": [
333,
1
]
},
{
"code": "lemma mulOption_lt_mul_of_equiv (hn : x₁.Numeric) (h : IH24 x₁ x₂ y) (he : x₁ ≈ x₂) (i j) :\n ⟦mulOption x₁ y i j⟧ < (⟦x₂ * y⟧ : Game) := by\n convert sub_lt_iff_lt_add'.2 ((((@h _).1 <| IsOption.moveLeft i).2 _).1 j) using 1\n · rw [← ((@h _).2.2 <| IsOption.moveLeft j).1 he]\n rfl\n · rw [← lt_congr_right he]\n apply hn.moveLeft_lt",
"end": [
346,
25
],
"full_name": "Surreal.Multiplication.mulOption_lt_mul_of_equiv",
"kind": "lemma",
"start": [
340,
1
]
},
{
"code": "theorem mul_right_le_of_equiv (h₁ : x₁.Numeric) (h₂ : x₂.Numeric)\n (h₁₂ : IH24 x₁ x₂ y) (h₂₁ : IH24 x₂ x₁ y) (he : x₁ ≈ x₂) : x₁ * y ≤ x₂ * y",
"end": [
362,
73
],
"full_name": "Surreal.Multiplication.mul_right_le_of_equiv",
"kind": "commanddeclaration",
"start": [
348,
1
]
},
{
"code": "def MulOptionsLTMul (x y : PGame) : Prop := ∀ ⦃i j⦄, ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game)",
"end": [
365,
92
],
"full_name": "Surreal.Multiplication.MulOptionsLTMul",
"kind": "commanddeclaration",
"start": [
364,
1
]
},
{
"code": "lemma mulOptionsLTMul_of_numeric (hn : (x * y).Numeric) :\n (MulOptionsLTMul x y ∧ MulOptionsLTMul (-x) (-y)) ∧\n (MulOptionsLTMul x (-y) ∧ MulOptionsLTMul (-x) y) := by\n constructor\n · have h := hn.moveLeft_lt\n simp_rw [lt_iff_game_lt] at h\n convert (leftMoves_mul_iff <| GT.gt _).1 h\n rw [← quot_neg_mul_neg]\n rfl\n · have h := hn.lt_moveRight\n simp_rw [lt_iff_game_lt, rightMoves_mul_iff] at h\n refine h.imp ?_ ?_ <;> refine forall₂_imp fun a b ↦ ?_\n all_goals\n rw [lt_neg]\n first | rw [quot_mul_neg] | rw [quot_neg_mul]\n exact id",
"end": [
386,
15
],
"full_name": "Surreal.Multiplication.mulOptionsLTMul_of_numeric",
"kind": "lemma",
"start": [
367,
1
]
},
{
"code": "def IH3 (x₁ x' x₂ y₁ y₂ : PGame) : Prop :=\n P2 x₁ x' y₁ ∧ P2 x₁ x' y₂ ∧ P3 x' x₂ y₁ y₂ ∧ (x₁ < x' → P3 x₁ x' y₁ y₂)",
"end": [
395,
76
],
"full_name": "Surreal.Multiplication.IH3",
"kind": "commanddeclaration",
"start": [
388,
1
]
},
{
"code": "lemma ih3_of_ih (h24 : IH24 x₁ x₂ y) (h4 : IH4 x₁ x₂ y) (hl : MulOptionsLTMul x₂ y) (i j) :\n IH3 x₁ (x₂.moveLeft i) x₂ (y.moveLeft j) y :=\n have ml := @IsOption.moveLeft\n have h24 := (@h24 _).2.1 (ml i)\n ⟨(h4 <| ml j).2 (ml i), h24.1, mulOption_lt_mul_iff_P3.1 (@hl i j), fun l ↦ (h24.2 l).1 _⟩",
"end": [
401,
93
],
"full_name": "Surreal.Multiplication.ih3_of_ih",
"kind": "lemma",
"start": [
397,
1
]
},
{
"code": "lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :\n P3 x₁ x₂ y₁ y₂ := by\n obtain (hl|he) := lt_or_equiv_of_le hl\n · exact (h.2.2.2 hl).trans h.2.2.1\n · rw [P3, h.1 he, h.2.1 he]\n exact h.2.2.1",
"end": [
408,
18
],
"full_name": "Surreal.Multiplication.P3_of_le_left",
"kind": "lemma",
"start": [
403,
1
]
},
{
"code": "theorem P3_of_lt {y₁ y₂} (h : ∀ i, IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)\n (hs : ∀ i, IH3 (-x₂) ((-x₁).moveLeft i) (-x₁) y₁ y₂) (hl : x₁ < x₂) :\n P3 x₁ x₂ y₁ y₂",
"end": [
419,
45
],
"full_name": "Surreal.Multiplication.P3_of_lt",
"kind": "commanddeclaration",
"start": [
410,
1
]
},
{
"code": "theorem main (a : Args) : a.Numeric → P124 a",
"end": [
448,
50
],
"full_name": "Surreal.Multiplication.main",
"kind": "commanddeclaration",
"start": [
421,
1
]
},
{
"code": "theorem Numeric.mul : Numeric (x * y)",
"end": [
459,
80
],
"full_name": "SetTheory.PGame.Numeric.mul",
"kind": "commanddeclaration",
"start": [
459,
1
]
},
{
"code": "theorem P24 : P24 x₁ x₂ y",
"end": [
461,
75
],
"full_name": "SetTheory.PGame.P24",
"kind": "commanddeclaration",
"start": [
461,
1
]
},
{
"code": "theorem Equiv.mul_congr_left (he : x₁ ≈ x₂) : x₁ * y ≈ x₂ * y",
"end": [
464,
47
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_left",
"kind": "commanddeclaration",
"start": [
463,
1
]
},
{
"code": "theorem Equiv.mul_congr_right (he : y₁ ≈ y₂) : x * y₁ ≈ x * y₂",
"end": [
467,
92
],
"full_name": "SetTheory.PGame.Equiv.mul_congr_right",
"kind": "commanddeclaration",
"start": [
466,
1
]
},
{
"code": "theorem Equiv.mul_congr (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ * y₁ ≈ x₂ * y₂",
"end": [
470,
74
],
"full_name": "SetTheory.PGame.Equiv.mul_congr",
"kind": "commanddeclaration",
"start": [
469,
1
]
},
{
"code": "theorem P3_of_lt_of_lt (hx : x₁ < x₂) (hy : y₁ < y₂) : P3 x₁ x₂ y₁ y₂",
"end": [
489,
72
],
"full_name": "SetTheory.PGame.P3_of_lt_of_lt",
"kind": "commanddeclaration",
"start": [
474,
1
]
},
{
"code": "theorem Numeric.mul_pos (hp₁ : 0 < x₁) (hp₂ : 0 < x₂) : 0 < x₁ * x₂",
"end": [
495,
13
],
"full_name": "SetTheory.PGame.Numeric.mul_pos",
"kind": "commanddeclaration",
"start": [
491,
1
]
}
] | 32 | Surreal.Multiplication.numeric_of_ih | [
[
318,
62
],
[
321,
57
]
] | 3 | 5 | exact (cutExpand_add_right {y}).2 <| (cutExpand_add_left {x₁}).2 cutExpand_zero | case left
x x₁ x₂ x₃ x' y y₁ y₂ y₃ y' : PGame
ih : ∀ (a : Args), ArgsRel a (Args.P1 x y) → P124 a
hx : x.Numeric
hy : y.Numeric
ih' : ∀ (a : Args), ArgsRel a (Args.P24 x₁ x₂ y) → P124 a
⊢ CutExpand IsOption (Args.P1 x₁ y).toMultiset (Args.P24 x₁ x₂ y).toMultiset | no goals |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.