url
stringclasses 147
values | commit
stringclasses 147
values | file_path
stringlengths 7
101
| full_name
stringlengths 1
94
| start
stringlengths 6
10
| end
stringlengths 6
11
| tactic
stringlengths 1
11.2k
| state_before
stringlengths 3
2.09M
| state_after
stringlengths 6
2.09M
|
---|---|---|---|---|---|---|---|---|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.getF_remap
|
[174, 1]
|
[177, 15]
|
simp at h_n
|
case a
Ξ± : Type ?u.30674
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
n : β
h_n : n < length (remap l f h_f)
β’ n < length l
|
case a
Ξ± : Type ?u.30674
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
n : β
h_n : n < length l
β’ n < length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.getF_remap
|
[174, 1]
|
[177, 15]
|
apply h_n
|
case a
Ξ± : Type ?u.30674
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
n : β
h_n : n < length l
β’ n < length l
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.getF_remap
|
[174, 1]
|
[177, 15]
|
simp [remap]
|
Ξ± : Type u_1
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
n : β
h_n : n < length (remap l f h_f)
β’ getF (remap l f h_f) n h_n = getF l (f n) (_ : f n < length l)
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.remap_remap
|
[179, 1]
|
[183, 22]
|
simp [Function.comp] at *
|
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
h_g : β (n : β), n < length (remap l f h_f) β g n < length (remap l f h_f)
n : β
h : n < length l
β’ Function.comp f g n < length l
|
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ f (g n) < length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.remap_remap
|
[179, 1]
|
[183, 22]
|
apply h_f
|
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ f (g n) < length l
|
case a
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ g n < length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.remap_remap
|
[179, 1]
|
[183, 22]
|
apply h_g
|
case a
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ g n < length l
|
case a.a
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ n < length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.remap_remap
|
[179, 1]
|
[183, 22]
|
apply h
|
case a.a
Ξ± : Type ?u.31376
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
n : β
h : n < length l
h_g : β (n : β), n < length l β g n < length l
β’ n < length l
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Util/List.lean
|
List.remap_remap
|
[179, 1]
|
[183, 22]
|
apply extF <;> simp
|
Ξ± : Type u_1
l : List Ξ±
f : β β β
h_f : β (n : β), n < length l β f n < length l
g : β β β
h_g : β (n : β), n < length (remap l f h_f) β g n < length (remap l f h_f)
β’ remap (remap l f h_f) g h_g = remap l (f β g) (_ : β (n : β), n < length l β Function.comp f g n < length l)
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
induction l
|
l : List TensorElem
Ο : MLIRTy
β’ hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
|
case nil
Ο : MLIRTy
β’ hasType (nested []) Ο = true β (List.all [] fun x => hasType x Ο) = true
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : hasType (nested tailβ) Ο = true β (List.all tailβ fun x => hasType x Ο) = true
β’ hasType (nested (headβ :: tailβ)) Ο = true β (List.all (headβ :: tailβ) fun x => hasType x Ο) = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
simp
|
case nil
Ο : MLIRTy
β’ hasType (nested []) Ο = true β (List.all [] fun x => hasType x Ο) = true
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : hasType (nested tailβ) Ο = true β (List.all tailβ fun x => hasType x Ο) = true
β’ hasType (nested (headβ :: tailβ)) Ο = true β (List.all (headβ :: tailβ) fun x => hasType x Ο) = true
|
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : hasType (nested tailβ) Ο = true β (List.all tailβ fun x => hasType x Ο) = true
β’ hasType (nested (headβ :: tailβ)) Ο = true β (List.all (headβ :: tailβ) fun x => hasType x Ο) = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
case cons e l ih' =>
simp [hasType, List.all_cons]
intro h' h
constructor <;> simp
assumption
simp[h, h']
sorry
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
β’ hasType (nested (e :: l)) Ο = true β (List.all (e :: l) fun x => hasType x Ο) = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
simp [hasType, List.all_cons]
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
β’ hasType (nested (e :: l)) Ο = true β (List.all (e :: l) fun x => hasType x Ο) = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
β’ hasType e Ο = true β hasType (nested l) Ο = true β hasType e Ο = true β§ β (x : TensorElem), x β l β hasType x Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
intro h' h
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
β’ hasType e Ο = true β hasType (nested l) Ο = true β hasType e Ο = true β§ β (x : TensorElem), x β l β hasType x Ο = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ hasType e Ο = true β§ β (x : TensorElem), x β l β hasType x Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
constructor <;> simp
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ hasType e Ο = true β§ β (x : TensorElem), x β l β hasType x Ο = true
|
case left
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ hasType e Ο = true
case right
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
assumption
|
case left
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ hasType e Ο = true
case right
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
case right
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_1
|
[108, 1]
|
[117, 10]
|
sorry
|
case right
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih' : hasType (nested l) Ο = true β (List.all l fun x => hasType x Ο) = true
h' : hasType e Ο = true
h : hasType (nested l) Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
induction l
|
l : List TensorElem
Ο : MLIRTy
β’ (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
|
case nil
Ο : MLIRTy
β’ (List.all [] fun x => hasType x Ο) = true β hasType (nested []) Ο = true
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : (List.all tailβ fun x => hasType x Ο) = true β hasType (nested tailβ) Ο = true
β’ (List.all (headβ :: tailβ) fun x => hasType x Ο) = true β hasType (nested (headβ :: tailβ)) Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
simp [hasType]
|
case nil
Ο : MLIRTy
β’ (List.all [] fun x => hasType x Ο) = true β hasType (nested []) Ο = true
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : (List.all tailβ fun x => hasType x Ο) = true β hasType (nested tailβ) Ο = true
β’ (List.all (headβ :: tailβ) fun x => hasType x Ο) = true β hasType (nested (headβ :: tailβ)) Ο = true
|
case cons
Ο : MLIRTy
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ : (List.all tailβ fun x => hasType x Ο) = true β hasType (nested tailβ) Ο = true
β’ (List.all (headβ :: tailβ) fun x => hasType x Ο) = true β hasType (nested (headβ :: tailβ)) Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
case cons e l ih =>
simp [hasType, List.all_cons]
intro h2 h
simp [h2]
apply ih
simp[h]
assumption
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
β’ (List.all (e :: l) fun x => hasType x Ο) = true β hasType (nested (e :: l)) Ο = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
simp [hasType, List.all_cons]
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
β’ (List.all (e :: l) fun x => hasType x Ο) = true β hasType (nested (e :: l)) Ο = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
β’ hasType e Ο = true β
(β (x : TensorElem), x β l β hasType x Ο = true) β hasType e Ο = true β§ hasType (nested l) Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
intro h2 h
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
β’ hasType e Ο = true β
(β (x : TensorElem), x β l β hasType x Ο = true) β hasType e Ο = true β§ hasType (nested l) Ο = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ hasType e Ο = true β§ hasType (nested l) Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
simp [h2]
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ hasType e Ο = true β§ hasType (nested l) Ο = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ hasType (nested l) Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
apply ih
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ hasType (nested l) Ο = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ (List.all l fun x => hasType x Ο) = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
simp[h]
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ (List.all l fun x => hasType x Ο) = true
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasType_list_2
|
[120, 1]
|
[129, 15]
|
assumption
|
Ο : MLIRTy
e : TensorElem
l : List TensorElem
ih : (List.all l fun x => hasType x Ο) = true β hasType (nested l) Ο = true
h2 : hasType e Ο = true
h : β (x : TensorElem), x β l β hasType x Ο = true
β’ β (x : TensorElem), x β l β hasType x Ο = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons
|
[167, 1]
|
[175, 52]
|
intros head tail s_head s_tail H1 H2
|
β’ β (head : TensorElem) (tail : List TensorElem) (s_head : β) (s_tail : List β),
inferredShape (nested tail) = some (s_head :: s_tail) β
inferredShape head = some s_tail β inferredShape (nested (head :: tail)) = some ((s_head + 1) :: s_tail)
|
head : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
H1 : inferredShape (nested tail) = some (s_head :: s_tail)
H2 : inferredShape head = some s_tail
β’ inferredShape (nested (head :: tail)) = some ((s_head + 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons
|
[167, 1]
|
[175, 52]
|
cases tail
|
head : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
H1 : inferredShape (nested tail) = some (s_head :: s_tail)
H2 : inferredShape head = some s_tail
β’ inferredShape (nested (head :: tail)) = some ((s_head + 1) :: s_tail)
|
case nil
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
H1 : inferredShape (nested []) = some (s_head :: s_tail)
β’ inferredShape (nested [head]) = some ((s_head + 1) :: s_tail)
case cons
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
headβ : TensorElem
tailβ : List TensorElem
H1 : inferredShape (nested (headβ :: tailβ)) = some (s_head :: s_tail)
β’ inferredShape (nested (head :: headβ :: tailβ)) = some ((s_head + 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons
|
[167, 1]
|
[175, 52]
|
. simp [inferredShape, H2, bind, Option.bind] at *; simp[H1.1];
|
case nil
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
H1 : inferredShape (nested []) = some (s_head :: s_tail)
β’ inferredShape (nested [head]) = some ((s_head + 1) :: s_tail)
case cons
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
headβ : TensorElem
tailβ : List TensorElem
H1 : inferredShape (nested (headβ :: tailβ)) = some (s_head :: s_tail)
β’ inferredShape (nested (head :: headβ :: tailβ)) = some ((s_head + 1) :: s_tail)
|
case cons
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
headβ : TensorElem
tailβ : List TensorElem
H1 : inferredShape (nested (headβ :: tailβ)) = some (s_head :: s_tail)
β’ inferredShape (nested (head :: headβ :: tailβ)) = some ((s_head + 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons
|
[167, 1]
|
[175, 52]
|
. simp [inferredShape, H2, bind, Option.bind, H1]
|
case cons
head : TensorElem
s_head : β
s_tail : List β
H2 : inferredShape head = some s_tail
headβ : TensorElem
tailβ : List TensorElem
H1 : inferredShape (nested (headβ :: tailβ)) = some (s_head :: s_tail)
β’ inferredShape (nested (head :: headβ :: tailβ)) = some ((s_head + 1) :: s_tail)
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
intros head mid tail s_head s_tail
|
β’ β {head mid : TensorElem} {tail : List TensorElem} {s_head : β} {s_tail : List β},
inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail) β
s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
β’ inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail) β
s_head > 0 β§ inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
simp [inferredShape, bind, Option.bind]
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
β’ inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail) β
s_head > 0 β§ inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
β’ (match inferredShape head, fun s1 =>
match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail) β
0 < s_head β§ inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
cases inferredShape head <;> simp
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail : List β
β’ (match inferredShape head, fun s1 =>
match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail) β
0 < s_head β§ inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
case some
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail valβ : List β
β’ (match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if valβ = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail) β
0 < s_head β§ valβ = s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
case some head_shape =>
cases inferredShape (.nested (mid :: tail)) <;> simp
case some tail_shape =>
cases tail_shape <;> simp
case cons s_head' s_tail' =>
apply dite (head_shape = s_tail')
. intros Heq; rw [Heq]; simp
intros H H'; rw [βH, Nat.add_sub_self_right, βH']
exact β¨by simp_arith, rfl, rfl, rflβ©
. intros Hne; simp [Hne]
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
β’ (match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if head_shape = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
cases inferredShape (.nested (mid :: tail)) <;> simp
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
β’ (match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if head_shape = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail)
|
case some
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape valβ : List β
β’ (match valβ with
| [] => none
| head :: tail => if head_shape = tail then some ((head + 1) :: tail) else none) =
some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ valβ = (s_head - 1) :: s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
case some tail_shape =>
cases tail_shape <;> simp
case cons s_head' s_tail' =>
apply dite (head_shape = s_tail')
. intros Heq; rw [Heq]; simp
intros H H'; rw [βH, Nat.add_sub_self_right, βH']
exact β¨by simp_arith, rfl, rfl, rflβ©
. intros Hne; simp [Hne]
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape tail_shape : List β
β’ (match tail_shape with
| [] => none
| head :: tail => if head_shape = tail then some ((head + 1) :: tail) else none) =
some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ tail_shape = (s_head - 1) :: s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
cases tail_shape <;> simp
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape tail_shape : List β
β’ (match tail_shape with
| [] => none
| head :: tail => if head_shape = tail then some ((head + 1) :: tail) else none) =
some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ tail_shape = (s_head - 1) :: s_tail
|
case cons
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
headβ : β
tailβ : List β
β’ (if head_shape = tailβ then some ((headβ + 1) :: tailβ) else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ headβ = s_head - 1 β§ tailβ = s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
case cons s_head' s_tail' =>
apply dite (head_shape = s_tail')
. intros Heq; rw [Heq]; simp
intros H H'; rw [βH, Nat.add_sub_self_right, βH']
exact β¨by simp_arith, rfl, rfl, rflβ©
. intros Hne; simp [Hne]
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ (if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
apply dite (head_shape = s_tail')
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ (if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
case t
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
case e
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ Β¬head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
. intros Heq; rw [Heq]; simp
intros H H'; rw [βH, Nat.add_sub_self_right, βH']
exact β¨by simp_arith, rfl, rfl, rflβ©
|
case t
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
case e
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ Β¬head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
case e
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ Β¬head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
. intros Hne; simp [Hne]
|
case e
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
β’ Β¬head_shape = s_tail' β
(if head_shape = s_tail' then some ((s_head' + 1) :: s_tail') else none) = some (s_head :: s_tail) β
0 < s_head β§ head_shape = s_tail β§ s_head' = s_head - 1 β§ s_tail' = s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_cons_inv
|
[177, 1]
|
[194, 27]
|
simp_arith
|
head mid : TensorElem
tail : List TensorElem
s_head : β
s_tail head_shape : List β
s_head' : β
s_tail' : List β
Heq : head_shape = s_tail'
H : s_head' + 1 = s_head
H' : s_tail' = s_tail
β’ 0 < s_head' + 1
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
revert head tail
|
l : List TensorElem
head : β
tail : List β
β’ inferredShape (nested l) = some (head :: tail) β
head = List.length l β§ (List.all l fun x => decide (inferredShape x = some tail)) = true
|
l : List TensorElem
β’ β {head : β} {tail : List β},
inferredShape (nested l) = some (head :: tail) β
head = List.length l β§ (List.all l fun x => decide (inferredShape x = some tail)) = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
induction l <;> simp
|
l : List TensorElem
β’ β {head : β} {tail : List β},
inferredShape (nested l) = some (head :: tail) β
head = List.length l β§ (List.all l fun x => decide (inferredShape x = some tail)) = true
|
case nil
β’ β {head : β} {tail : List β}, inferredShape (nested []) = some (head :: tail) β head = 0
case cons
headβ : TensorElem
tailβ : List TensorElem
tail_ihβ :
β {head : β} {tail : List β},
inferredShape (nested tailβ) = some (head :: tail) β
head = List.length tailβ β§ (List.all tailβ fun x => decide (inferredShape x = some tail)) = true
β’ β {head : β} {tail : List β},
inferredShape (nested (headβ :: tailβ)) = some (head :: tail) β
head = Nat.succ (List.length tailβ) β§
inferredShape headβ = some tail β§ β (x : TensorElem), x β tailβ β inferredShape x = some tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
case nil =>
intros head tile H; simp [inferredShape, List.all_nil] at *; simp [H.1]
|
β’ β {head : β} {tail : List β}, inferredShape (nested []) = some (head :: tail) β head = 0
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
case cons head tail ih =>
intros s_head s_tail H
cases tail
case nil =>
simp [inferredShape, List.all_one]
simp [inferredShape, bind, Option.bind, List.all_one] at H
split at H; trivial; simp at H
case h_2 _ s_mid H' =>
simp [βH.1, H', H.2]
case cons mid tail =>
let H' := inferredShape_cons_inv H
specialize (ih H'.2.2)
constructor
. have helper: forall {n m}, n > 0 β n - 1 = m β n = m + 1 := by
sorry
simp [helper H'.1 ih.1]
. sorry
|
head : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested tail) = some (head :: tail_1) β
head = List.length tail β§ (List.all tail fun x => decide (inferredShape x = some tail_1)) = true
β’ β {head_1 : β} {tail_1 : List β},
inferredShape (nested (head :: tail)) = some (head_1 :: tail_1) β
head_1 = Nat.succ (List.length tail) β§
inferredShape head = some tail_1 β§ β (x : TensorElem), x β tail β inferredShape x = some tail_1
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
intros head tile H
|
β’ β {head : β} {tail : List β}, inferredShape (nested []) = some (head :: tail) β head = 0
|
head : β
tile : List β
H : inferredShape (nested []) = some (head :: tile)
β’ head = 0
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp [inferredShape, List.all_nil] at *
|
head : β
tile : List β
H : inferredShape (nested []) = some (head :: tile)
β’ head = 0
|
head : β
tile : List β
H : 0 = head β§ [] = tile
β’ head = 0
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp [H.1]
|
head : β
tile : List β
H : 0 = head β§ [] = tile
β’ head = 0
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
intros s_head s_tail H
|
head : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested tail) = some (head :: tail_1) β
head = List.length tail β§ (List.all tail fun x => decide (inferredShape x = some tail_1)) = true
β’ β {head_1 : β} {tail_1 : List β},
inferredShape (nested (head :: tail)) = some (head_1 :: tail_1) β
head_1 = Nat.succ (List.length tail) β§
inferredShape head = some tail_1 β§ β (x : TensorElem), x β tail β inferredShape x = some tail_1
|
head : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested tail) = some (head :: tail_1) β
head = List.length tail β§ (List.all tail fun x => decide (inferredShape x = some tail_1)) = true
s_head : β
s_tail : List β
H : inferredShape (nested (head :: tail)) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length tail) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β tail β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
cases tail
|
head : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested tail) = some (head :: tail_1) β
head = List.length tail β§ (List.all tail fun x => decide (inferredShape x = some tail_1)) = true
s_head : β
s_tail : List β
H : inferredShape (nested (head :: tail)) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length tail) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β tail β inferredShape x = some s_tail
|
case nil
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested [head]) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length []) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β [] β inferredShape x = some s_tail
case cons
head : TensorElem
s_head : β
s_tail : List β
headβ : TensorElem
tailβ : List TensorElem
ih :
β {head : β} {tail : List β},
inferredShape (nested (headβ :: tailβ)) = some (head :: tail) β
head = List.length (headβ :: tailβ) β§
(List.all (headβ :: tailβ) fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested (head :: headβ :: tailβ)) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length (headβ :: tailβ)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β headβ :: tailβ β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
case nil =>
simp [inferredShape, List.all_one]
simp [inferredShape, bind, Option.bind, List.all_one] at H
split at H; trivial; simp at H
case h_2 _ s_mid H' =>
simp [βH.1, H', H.2]
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested [head]) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length []) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β [] β inferredShape x = some s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
case cons mid tail =>
let H' := inferredShape_cons_inv H
specialize (ih H'.2.2)
constructor
. have helper: forall {n m}, n > 0 β n - 1 = m β n = m + 1 := by
sorry
simp [helper H'.1 ih.1]
. sorry
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested (mid :: tail)) = some (head :: tail_1) β
head = List.length (mid :: tail) β§ (List.all (mid :: tail) fun x => decide (inferredShape x = some tail_1)) = true
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp [inferredShape, List.all_one]
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested [head]) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length []) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β [] β inferredShape x = some s_tail
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested [head]) = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp [inferredShape, bind, Option.bind, List.all_one] at H
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H : inferredShape (nested [head]) = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H :
(match inferredShape head, fun __do_lift => some (1 :: __do_lift) with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
split at H
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
H :
(match inferredShape head, fun __do_lift => some (1 :: __do_lift) with
| none, x => none
| some a, b => b a) =
some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
case h_1
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
heqβ : inferredShape head = none
H : none = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
case h_2
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
aβ : List β
heqβ : inferredShape head = some aβ
H : (fun __do_lift => some (1 :: __do_lift)) aβ = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
trivial
|
case h_1
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
heqβ : inferredShape head = none
H : none = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
case h_2
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
aβ : List β
heqβ : inferredShape head = some aβ
H : (fun __do_lift => some (1 :: __do_lift)) aβ = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
case h_2
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
aβ : List β
heqβ : inferredShape head = some aβ
H : (fun __do_lift => some (1 :: __do_lift)) aβ = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp at H
|
case h_2
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
aβ : List β
heqβ : inferredShape head = some aβ
H : (fun __do_lift => some (1 :: __do_lift)) aβ = some (s_head :: s_tail)
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
case h_2
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
aβ : List β
heqβ : inferredShape head = some aβ
H : 1 = s_head β§ aβ = s_tail
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
case h_2 _ s_mid H' =>
simp [βH.1, H', H.2]
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
s_mid : List β
H' : inferredShape head = some s_mid
H : 1 = s_head β§ s_mid = s_tail
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
simp [βH.1, H', H.2]
|
head : TensorElem
s_head : β
s_tail : List β
ih :
β {head : β} {tail : List β},
inferredShape (nested []) = some (head :: tail) β
head = List.length [] β§ (List.all [] fun x => decide (inferredShape x = some tail)) = true
xβΒΉ : Option (List β)
xβ : List β β Option (List β)
s_mid : List β
H' : inferredShape head = some s_mid
H : 1 = s_head β§ s_mid = s_tail
β’ s_head = Nat.succ 0 β§ inferredShape head = some s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
let H' := inferredShape_cons_inv H
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested (mid :: tail)) = some (head :: tail_1) β
head = List.length (mid :: tail) β§ (List.all (mid :: tail) fun x => decide (inferredShape x = some tail_1)) = true
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested (mid :: tail)) = some (head :: tail_1) β
head = List.length (mid :: tail) β§ (List.all (mid :: tail) fun x => decide (inferredShape x = some tail_1)) = true
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
specialize (ih H'.2.2)
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
ih :
β {head : β} {tail_1 : List β},
inferredShape (nested (mid :: tail)) = some (head :: tail_1) β
head = List.length (mid :: tail) β§ (List.all (mid :: tail) fun x => decide (inferredShape x = some tail_1)) = true
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
constructor
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ s_head = Nat.succ (List.length (mid :: tail)) β§
inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
case left
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ s_head = Nat.succ (List.length (mid :: tail))
case right
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
. have helper: forall {n m}, n > 0 β n - 1 = m β n = m + 1 := by
sorry
simp [helper H'.1 ih.1]
|
case left
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ s_head = Nat.succ (List.length (mid :: tail))
case right
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
case right
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
. sorry
|
case right
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ inferredShape head = some s_tail β§ β (x : TensorElem), x β mid :: tail β inferredShape x = some s_tail
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list
|
[196, 1]
|
[218, 14]
|
sorry
|
head : TensorElem
s_head : β
s_tail : List β
mid : TensorElem
tail : List TensorElem
H : inferredShape (nested (head :: mid :: tail)) = some (s_head :: s_tail)
H' : s_head > 0 β§
inferredShape head = some s_tail β§ inferredShape (nested (mid :: tail)) = some ((s_head - 1) :: s_tail) :=
inferredShape_cons_inv H
ih :
s_head - 1 = List.length (mid :: tail) β§
(List.all (mid :: tail) fun x => decide (inferredShape x = some s_tail)) = true
β’ β {n m : β}, n > 0 β n - 1 = m β n = m + 1
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases s <;> simp [inferredShape]
|
l : List TensorElem
s : List β
β’ inferredShape (nested l) = some s β β tail, s = List.length l :: tail
|
case nil
l : List TensorElem
β’ inferredShape (nested l) = some [] β False
case cons
l : List TensorElem
headβ : β
tailβ : List β
β’ inferredShape (nested l) = some (headβ :: tailβ) β headβ = List.length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case nil =>
cases l <;> simp [inferredShape]
case cons head tail =>
cases tail <;> simp [inferredShape]
case nil =>
cases inferredShape head <;> simp [bind, Option.bind]
case cons mid tail =>
cases inferredShape head <;> simp [bind, Option.bind]
cases inferredShape (.nested (mid :: tail)) <;> simp [Option.bind]
case some.some s1 s2 =>
cases s2 <;> simp
case cons s2_head s2_tail =>
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
l : List TensorElem
β’ inferredShape (nested l) = some [] β False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case cons s_head s_tail =>
intro H
let H' := inferredShape_list H
exact H'.1
|
l : List TensorElem
s_head : β
s_tail : List β
β’ inferredShape (nested l) = some (s_head :: s_tail) β s_head = List.length l
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases l <;> simp [inferredShape]
|
l : List TensorElem
β’ inferredShape (nested l) = some [] β False
|
case cons
headβ : TensorElem
tailβ : List TensorElem
β’ inferredShape (nested (headβ :: tailβ)) = some [] β False
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case cons head tail =>
cases tail <;> simp [inferredShape]
case nil =>
cases inferredShape head <;> simp [bind, Option.bind]
case cons mid tail =>
cases inferredShape head <;> simp [bind, Option.bind]
cases inferredShape (.nested (mid :: tail)) <;> simp [Option.bind]
case some.some s1 s2 =>
cases s2 <;> simp
case cons s2_head s2_tail =>
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
head : TensorElem
tail : List TensorElem
β’ inferredShape (nested (head :: tail)) = some [] β False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases tail <;> simp [inferredShape]
|
head : TensorElem
tail : List TensorElem
β’ inferredShape (nested (head :: tail)) = some [] β False
|
case nil
head : TensorElem
β’ (do
let __do_lift β inferredShape head
some (1 :: __do_lift)) =
some [] β
False
case cons
head headβ : TensorElem
tailβ : List TensorElem
β’ (do
let s1 β inferredShape head
let s2 β inferredShape (nested (headβ :: tailβ))
match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case nil =>
cases inferredShape head <;> simp [bind, Option.bind]
|
head : TensorElem
β’ (do
let __do_lift β inferredShape head
some (1 :: __do_lift)) =
some [] β
False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case cons mid tail =>
cases inferredShape head <;> simp [bind, Option.bind]
cases inferredShape (.nested (mid :: tail)) <;> simp [Option.bind]
case some.some s1 s2 =>
cases s2 <;> simp
case cons s2_head s2_tail =>
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
head mid : TensorElem
tail : List TensorElem
β’ (do
let s1 β inferredShape head
let s2 β inferredShape (nested (mid :: tail))
match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases inferredShape head <;> simp [bind, Option.bind]
|
head : TensorElem
β’ (do
let __do_lift β inferredShape head
some (1 :: __do_lift)) =
some [] β
False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases inferredShape head <;> simp [bind, Option.bind]
|
head mid : TensorElem
tail : List TensorElem
β’ (do
let s1 β inferredShape head
let s2 β inferredShape (nested (mid :: tail))
match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
case some
head mid : TensorElem
tail : List TensorElem
valβ : List β
β’ (match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if valβ = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a) =
some [] β
False
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases inferredShape (.nested (mid :: tail)) <;> simp [Option.bind]
|
case some
head mid : TensorElem
tail : List TensorElem
valβ : List β
β’ (match inferredShape (nested (mid :: tail)), fun s2 =>
match s2 with
| [] => none
| head :: tail => if valβ = tail then some ((head + 1) :: tail) else none with
| none, x => none
| some a, b => b a) =
some [] β
False
|
case some.some
head mid : TensorElem
tail : List TensorElem
valβΒΉ valβ : List β
β’ (match valβ with
| [] => none
| head :: tail => if valβΒΉ = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case some.some s1 s2 =>
cases s2 <;> simp
case cons s2_head s2_tail =>
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
head mid : TensorElem
tail : List TensorElem
s1 s2 : List β
β’ (match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
cases s2 <;> simp
|
head mid : TensorElem
tail : List TensorElem
s1 s2 : List β
β’ (match s2 with
| [] => none
| head :: tail => if s1 = tail then some ((head + 1) :: tail) else none) =
some [] β
False
|
case cons
head mid : TensorElem
tail : List TensorElem
s1 : List β
headβ : β
tailβ : List β
β’ (if s1 = tailβ then some ((headβ + 1) :: tailβ) else none) = some [] β False
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
case cons s2_head s2_tail =>
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
head mid : TensorElem
tail : List TensorElem
s1 : List β
s2_head : β
s2_tail : List β
β’ (if s1 = s2_tail then some ((s2_head + 1) :: s2_tail) else none) = some [] β False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
apply dite (s1 = s2_tail) <;> intros H <;> simp [H]
|
head mid : TensorElem
tail : List TensorElem
s1 : List β
s2_head : β
s2_tail : List β
β’ (if s1 = s2_tail then some ((s2_head + 1) :: s2_tail) else none) = some [] β False
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
intro H
|
l : List TensorElem
s_head : β
s_tail : List β
β’ inferredShape (nested l) = some (s_head :: s_tail) β s_head = List.length l
|
l : List TensorElem
s_head : β
s_tail : List β
H : inferredShape (nested l) = some (s_head :: s_tail)
β’ s_head = List.length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
let H' := inferredShape_list H
|
l : List TensorElem
s_head : β
s_tail : List β
H : inferredShape (nested l) = some (s_head :: s_tail)
β’ s_head = List.length l
|
l : List TensorElem
s_head : β
s_tail : List β
H : inferredShape (nested l) = some (s_head :: s_tail)
H' : s_head = List.length l β§ (List.all l fun x => decide (inferredShape x = some s_tail)) = true :=
inferredShape_list H
β’ s_head = List.length l
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.inferredShape_list_to_cons
|
[220, 1]
|
[240, 15]
|
exact H'.1
|
l : List TensorElem
s_head : β
s_tail : List β
H : inferredShape (nested l) = some (s_head :: s_tail)
H' : s_head = List.length l β§ (List.all l fun x => decide (inferredShape x = some s_tail)) = true :=
inferredShape_list H
β’ s_head = List.length l
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
intro e
|
β’ β (e : TensorElem) (shape : List β), inferredShape e = some shape β hasShape e shape = true
|
e : TensorElem
β’ β (shape : List β), inferredShape e = some shape β hasShape e shape = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
apply @TensorElem.recOn
(motive_1 := fun e =>
βs, e.inferredShape = some s β e.hasShape s)
(motive_2 := fun l =>
βs, l.all (TensorElem.inferredShape . = some s) β
l.all (TensorElem.hasShape . s))
|
e : TensorElem
β’ β (shape : List β), inferredShape e = some shape β hasShape e shape = true
|
case int
e : TensorElem
β’ β (a : β€) (s : List β), inferredShape (int a) = some s β hasShape (int a) s = true
case float
e : TensorElem
β’ β (a : Float) (s : List β), inferredShape (float a) = some s β hasShape (float a) s = true
case bool
e : TensorElem
β’ β (a : Bool) (s : List β), inferredShape (bool a) = some s β hasShape (bool a) s = true
case nested
e : TensorElem
β’ β (a : List TensorElem),
(β (s : List β),
(List.all a fun x => decide (inferredShape x = some s)) = true β (List.all a fun x => hasShape x s) = true) β
β (s : List β), inferredShape (nested a) = some s β hasShape (nested a) s = true
case empty
e : TensorElem
β’ β (s : List β), inferredShape empty = some s β hasShape empty s = true
case nil
e : TensorElem
β’ β (s : List β),
(List.all [] fun x => decide (inferredShape x = some s)) = true β (List.all [] fun x => hasShape x s) = true
case cons
e : TensorElem
β’ β (head : TensorElem) (tail : List TensorElem),
(β (s : List β), inferredShape head = some s β hasShape head s = true) β
(β (s : List β),
(List.all tail fun x => decide (inferredShape x = some s)) = true β
(List.all tail fun x => hasShape x s) = true) β
β (s : List β),
(List.all (head :: tail) fun x => decide (inferredShape x = some s)) = true β
(List.all (head :: tail) fun x => hasShape x s) = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case int =>
intros _ s H; cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
β’ β (a : β€) (s : List β), inferredShape (int a) = some s β hasShape (int a) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case bool =>
intros _ s H; cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
β’ β (a : Bool) (s : List β), inferredShape (bool a) = some s β hasShape (bool a) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case float =>
intros _ s H; cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
β’ β (a : Float) (s : List β), inferredShape (float a) = some s β hasShape (float a) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case nested =>
intros l motive_2 s H
let H' := inferredShape_list_to_cons H
cases H'; case intro s_tail Hs =>
rw [Hs]; rw [Hs] at H; clear Hs H'
let H' := inferredShape_list H
simp [hasShape, motive_2 _ H'.2]
|
e : TensorElem
β’ β (a : List TensorElem),
(β (s : List β),
(List.all a fun x => decide (inferredShape x = some s)) = true β (List.all a fun x => hasShape x s) = true) β
β (s : List β), inferredShape (nested a) = some s β hasShape (nested a) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case empty =>
simp [inferredShape]
|
e : TensorElem
β’ β (s : List β), inferredShape empty = some s β hasShape empty s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case nil =>
intros s H; simp [List.all_nil]
|
e : TensorElem
β’ β (s : List β),
(List.all [] fun x => decide (inferredShape x = some s)) = true β (List.all [] fun x => hasShape x s) = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
case cons =>
intros head tail motive_1 ih s H; simp [List.all_cons] at *
simp [motive_1 _ H.1, ih _ H.2]
sorry
|
e : TensorElem
β’ β (head : TensorElem) (tail : List TensorElem),
(β (s : List β), inferredShape head = some s β hasShape head s = true) β
(β (s : List β),
(List.all tail fun x => decide (inferredShape x = some s)) = true β
(List.all tail fun x => hasShape x s) = true) β
β (s : List β),
(List.all (head :: tail) fun x => decide (inferredShape x = some s)) = true β
(List.all (head :: tail) fun x => hasShape x s) = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
intros _ s H
|
e : TensorElem
β’ β (a : β€) (s : List β), inferredShape (int a) = some s β hasShape (int a) s = true
|
e : TensorElem
aβ : β€
s : List β
H : inferredShape (int aβ) = some s
β’ hasShape (int aβ) s = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
aβ : β€
s : List β
H : inferredShape (int aβ) = some s
β’ hasShape (int aβ) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
intros _ s H
|
e : TensorElem
β’ β (a : Bool) (s : List β), inferredShape (bool a) = some s β hasShape (bool a) s = true
|
e : TensorElem
aβ : Bool
s : List β
H : inferredShape (bool aβ) = some s
β’ hasShape (bool aβ) s = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
aβ : Bool
s : List β
H : inferredShape (bool aβ) = some s
β’ hasShape (bool aβ) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
intros _ s H
|
e : TensorElem
β’ β (a : Float) (s : List β), inferredShape (float a) = some s β hasShape (float a) s = true
|
e : TensorElem
aβ : Float
s : List β
H : inferredShape (float aβ) = some s
β’ hasShape (float aβ) s = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
cases s <;> simp [inferredShape, hasShape] at *
|
e : TensorElem
aβ : Float
s : List β
H : inferredShape (float aβ) = some s
β’ hasShape (float aβ) s = true
|
no goals
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
intros l motive_2 s H
|
e : TensorElem
β’ β (a : List TensorElem),
(β (s : List β),
(List.all a fun x => decide (inferredShape x = some s)) = true β (List.all a fun x => hasShape x s) = true) β
β (s : List β), inferredShape (nested a) = some s β hasShape (nested a) s = true
|
e : TensorElem
l : List TensorElem
motive_2 :
β (s : List β),
(List.all l fun x => decide (inferredShape x = some s)) = true β (List.all l fun x => hasShape x s) = true
s : List β
H : inferredShape (nested l) = some s
β’ hasShape (nested l) s = true
|
https://github.com/opencompl/lean-mlir.git
|
e43d21592801e5e40477b14b7a554e356060c40c
|
MLIR/Semantics/TensorElem.lean
|
MLIR.AST.TensorElem.hasShape_inferredShape
|
[244, 1]
|
[276, 10]
|
let H' := inferredShape_list_to_cons H
|
e : TensorElem
l : List TensorElem
motive_2 :
β (s : List β),
(List.all l fun x => decide (inferredShape x = some s)) = true β (List.all l fun x => hasShape x s) = true
s : List β
H : inferredShape (nested l) = some s
β’ hasShape (nested l) s = true
|
e : TensorElem
l : List TensorElem
motive_2 :
β (s : List β),
(List.all l fun x => decide (inferredShape x = some s)) = true β (List.all l fun x => hasShape x s) = true
s : List β
H : inferredShape (nested l) = some s
H' : β tail, s = List.length l :: tail := inferredShape_list_to_cons H
β’ hasShape (nested l) s = true
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.