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