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/Semantics/TensorElem.lean
MLIR.AST.TensorElem.hasShape_inferredShape
[244, 1]
[276, 10]
cases 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 H' : βˆƒ tail, s = List.length l :: tail := inferredShape_list_to_cons H ⊒ hasShape (nested l) s = true
case intro 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 w✝ : List β„• h✝ : s = List.length l :: w✝ ⊒ 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]
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 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 s_tail : List β„• Hs : s = List.length l :: s_tail ⊒ hasShape (nested l) 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]
rw [Hs]
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 s_tail : List β„• Hs : s = List.length l :: s_tail ⊒ 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 s_tail : List β„• Hs : s = List.length l :: s_tail ⊒ hasShape (nested l) (List.length l :: s_tail) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.hasShape_inferredShape
[244, 1]
[276, 10]
rw [Hs] at 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 H' : βˆƒ tail, s = List.length l :: tail := inferredShape_list_to_cons H s_tail : List β„• Hs : s = List.length l :: s_tail ⊒ hasShape (nested l) (List.length l :: s_tail) = 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✝ s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) Hs : s = List.length l :: s_tail ⊒ hasShape (nested l) (List.length l :: s_tail) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.hasShape_inferredShape
[244, 1]
[276, 10]
clear Hs 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 H' : βˆƒ tail, s = List.length l :: tail := inferredShape_list_to_cons H✝ s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) Hs : s = List.length l :: s_tail ⊒ hasShape (nested l) (List.length l :: s_tail) = 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 s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) ⊒ hasShape (nested l) (List.length l :: s_tail) = 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 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 s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) ⊒ hasShape (nested l) (List.length l :: s_tail) = 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 s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) H' : List.length l = List.length l ∧ (List.all l fun x => decide (inferredShape x = some s_tail)) = true := inferredShape_list H ⊒ hasShape (nested l) (List.length l :: s_tail) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.hasShape_inferredShape
[244, 1]
[276, 10]
simp [hasShape, motive_2 _ H'.2]
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 s_tail : List β„• H : inferredShape (nested l) = some (List.length l :: s_tail) H' : List.length l = List.length l ∧ (List.all l fun x => decide (inferredShape x = some s_tail)) = true := inferredShape_list H ⊒ hasShape (nested l) (List.length l :: s_tail) = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.hasShape_inferredShape
[244, 1]
[276, 10]
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]
intros s H
e : TensorElem ⊒ βˆ€ (s : List β„•), (List.all [] fun x => decide (inferredShape x = some s)) = true β†’ (List.all [] fun x => hasShape x s) = true
e : TensorElem s : List β„• H : (List.all [] fun x => decide (inferredShape x = some s)) = true ⊒ (List.all [] 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]
simp [List.all_nil]
e : TensorElem s : List β„• H : (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]
intros head tail motive_1 ih s H
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
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true ih : βˆ€ (s : List β„•), (List.all tail fun x => decide (inferredShape x = some s)) = true β†’ (List.all tail fun x => hasShape x s) = true s : List β„• H : (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]
simp [List.all_cons] at *
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true ih : βˆ€ (s : List β„•), (List.all tail fun x => decide (inferredShape x = some s)) = true β†’ (List.all tail fun x => hasShape x s) = true s : List β„• H : (List.all (head :: tail) fun x => decide (inferredShape x = some s)) = true ⊒ (List.all (head :: tail) fun x => hasShape x s) = true
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true s : List β„• ih : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s) β†’ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true H : inferredShape head = some s ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s ⊒ hasShape head s = true ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ 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]
simp [motive_1 _ H.1, ih _ H.2]
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true s : List β„• ih : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s) β†’ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true H : inferredShape head = some s ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s ⊒ hasShape head s = true ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true s : List β„• ih : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s) β†’ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true H : inferredShape head = some s ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s ⊒ βˆ€ (x : TensorElem), x ∈ tail β†’ 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]
sorry
e head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), inferredShape head = some s β†’ hasShape head s = true s : List β„• ih : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s) β†’ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true H : inferredShape head = some s ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ inferredShape x = some s ⊒ βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_lift_refines
[332, 1]
[334, 35]
induction S <;> simp
S : List β„• ⊒ shapeRefines S (List.map Dimension.Known S) = true
case cons head✝ : β„• tail✝ : List β„• tail_ih✝ : shapeRefines tail✝ (List.map Dimension.Known tail✝) = true ⊒ shapeRefines tail✝ (List.map Dimension.Known tail✝) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_lift_refines
[332, 1]
[334, 35]
assumption
case cons head✝ : β„• tail✝ : List β„• tail_ih✝ : shapeRefines tail✝ (List.map Dimension.Known tail✝) = true ⊒ shapeRefines tail✝ (List.map Dimension.Known tail✝) = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_refines
[336, 1]
[340, 43]
intros h <;> induction D <;> simp
D : DimList ⊒ known D = true β†’ shapeRefines (project D) D = true
case cons head✝ : Dimension tail✝ : List Dimension tail_ih✝ : known tail✝ = true β†’ shapeRefines (project tail✝) tail✝ = true h : known (head✝ :: tail✝) = true ⊒ shapeRefines (project (head✝ :: tail✝)) (head✝ :: tail✝) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_refines
[336, 1]
[340, 43]
case cons head tail ih => cases head <;> simp at *; apply (ih h)
head : Dimension tail : List Dimension ih : known tail = true β†’ shapeRefines (project tail) tail = true h : known (head :: tail) = true ⊒ shapeRefines (project (head :: tail)) (head :: tail) = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_refines
[336, 1]
[340, 43]
cases head <;> simp at *
head : Dimension tail : List Dimension ih : known tail = true β†’ shapeRefines (project tail) tail = true h : known (head :: tail) = true ⊒ shapeRefines (project (head :: tail)) (head :: tail) = true
case Known tail : List Dimension ih : known tail = true β†’ shapeRefines (project tail) tail = true a✝ : β„• h : known tail = true ⊒ shapeRefines (project tail) tail = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_refines
[336, 1]
[340, 43]
apply (ih h)
case Known tail : List Dimension ih : known tail = true β†’ shapeRefines (project tail) tail = true a✝ : β„• h : known tail = true ⊒ shapeRefines (project tail) tail = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
intros Hknown
D : DimList S : List β„• ⊒ known D = true β†’ shapeRefines S D = true β†’ D = List.map Dimension.Known S
D : DimList S : List β„• Hknown : known D = true ⊒ shapeRefines S D = true β†’ D = List.map Dimension.Known S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
revert S
D : DimList S : List β„• Hknown : known D = true ⊒ shapeRefines S D = true β†’ D = List.map Dimension.Known S
D : DimList Hknown : known D = true ⊒ βˆ€ {S : List β„•}, shapeRefines S D = true β†’ D = List.map Dimension.Known S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
induction D <;> intros S Hrefines
D : DimList Hknown : known D = true ⊒ βˆ€ {S : List β„•}, shapeRefines S D = true β†’ D = List.map Dimension.Known S
case nil Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ [] = List.map Dimension.Known S case cons head✝ : Dimension tail✝ : List Dimension tail_ih✝ : known tail✝ = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail✝ = true β†’ tail✝ = List.map Dimension.Known S Hknown : known (head✝ :: tail✝) = true S : List β„• Hrefines : shapeRefines S (head✝ :: tail✝) = true ⊒ head✝ :: tail✝ = List.map Dimension.Known S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
case nil => cases S; simp [List.map]; simp at Hrefines
Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ [] = List.map Dimension.Known S
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
case cons head tail ih => cases S; simp at Hrefines simp [List.map]; cases head <;> simp at * rw [Hrefines.1, ←ih Hknown]; apply Hrefines.2
head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true S : List β„• Hrefines : shapeRefines S (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known S
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
cases S
Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ [] = List.map Dimension.Known S
case nil Hknown : known [] = true Hrefines : shapeRefines [] [] = true ⊒ [] = List.map Dimension.Known [] case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ [] = List.map Dimension.Known (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
simp [List.map]
case nil Hknown : known [] = true Hrefines : shapeRefines [] [] = true ⊒ [] = List.map Dimension.Known [] case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ [] = List.map Dimension.Known (head✝ :: tail✝)
case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ [] = List.map Dimension.Known (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
simp at Hrefines
case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ [] = List.map Dimension.Known (head✝ :: tail✝)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
cases S
head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true S : List β„• Hrefines : shapeRefines S (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known S
case nil head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true Hrefines : shapeRefines [] (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known [] case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
simp at Hrefines
case nil head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true Hrefines : shapeRefines [] (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known [] case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known (head✝ :: tail✝)
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
simp [List.map]
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = List.map Dimension.Known (head✝ :: tail✝)
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = Dimension.Known head✝ :: List.map Dimension.Known tail✝
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
cases head <;> simp at *
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ head :: tail = Dimension.Known head✝ :: List.map Dimension.Known tail✝
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ Dimension.Known a✝ :: tail = Dimension.Known head✝ :: List.map Dimension.Known tail✝
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
rw [Hrefines.1, ←ih Hknown]
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ Dimension.Known a✝ :: tail = Dimension.Known head✝ :: List.map Dimension.Known tail✝
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ shapeRefines tail✝ tail = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_refines_inv
[342, 1]
[350, 50]
apply Hrefines.2
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ tail = List.map Dimension.Known S head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ shapeRefines tail✝ tail = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_eq
[352, 1]
[357, 35]
intros Hknown Hrefines
S : List β„• D : DimList ⊒ known D = true β†’ shapeRefines S D = true β†’ project D = S
S : List β„• D : DimList Hknown : known D = true Hrefines : shapeRefines S D = true ⊒ project D = S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_eq
[352, 1]
[357, 35]
rw [dim_known_refines_inv Hknown Hrefines]
S : List β„• D : DimList Hknown : known D = true Hrefines : shapeRefines S D = true ⊒ project D = S
S : List β„• D : DimList Hknown : known D = true Hrefines : shapeRefines S D = true ⊒ project (List.map Dimension.Known S) = S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_eq
[352, 1]
[357, 35]
clear D Hknown Hrefines
S : List β„• D : DimList Hknown : known D = true Hrefines : shapeRefines S D = true ⊒ project (List.map Dimension.Known S) = S
S : List β„• ⊒ project (List.map Dimension.Known S) = S
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_eq
[352, 1]
[357, 35]
induction S <;> simp
S : List β„• ⊒ project (List.map Dimension.Known S) = S
case cons head✝ : β„• tail✝ : List β„• tail_ih✝ : project (List.map Dimension.Known tail✝) = tail✝ ⊒ project (List.map Dimension.Known tail✝) = tail✝
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_project_eq
[352, 1]
[357, 35]
assumption
case cons head✝ : β„• tail✝ : List β„• tail_ih✝ : project (List.map Dimension.Known tail✝) = tail✝ ⊒ project (List.map Dimension.Known tail✝) = tail✝
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
intros Hknown
S : List β„• D : DimList ⊒ known D = true β†’ shapeRefines S D = true β†’ shapeProd S = prod D
S : List β„• D : DimList Hknown : known D = true ⊒ shapeRefines S D = true β†’ shapeProd S = prod D
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
revert S
S : List β„• D : DimList Hknown : known D = true ⊒ shapeRefines S D = true β†’ shapeProd S = prod D
D : DimList Hknown : known D = true ⊒ βˆ€ {S : List β„•}, shapeRefines S D = true β†’ shapeProd S = prod D
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
induction D <;> intros S Hrefines <;> simp
D : DimList Hknown : known D = true ⊒ βˆ€ {S : List β„•}, shapeRefines S D = true β†’ shapeProd S = prod D
case nil Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ shapeProd S = 1 case cons head✝ : Dimension tail✝ : List Dimension tail_ih✝ : known tail✝ = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail✝ = true β†’ shapeProd S = prod tail✝ Hknown : known (head✝ :: tail✝) = true S : List β„• Hrefines : shapeRefines S (head✝ :: tail✝) = true ⊒ shapeProd S = prod (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
case nil => cases S; simp; simp at Hrefines
Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ shapeProd S = 1
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
case cons head tail ih => cases S; simp at Hrefines cases head <;> simp at * rw [←Hrefines.1, ←ih Hknown Hrefines.2]
head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true S : List β„• Hrefines : shapeRefines S (head :: tail) = true ⊒ shapeProd S = prod (head :: tail)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
cases S
Hknown : known [] = true S : List β„• Hrefines : shapeRefines S [] = true ⊒ shapeProd S = 1
case nil Hknown : known [] = true Hrefines : shapeRefines [] [] = true ⊒ shapeProd [] = 1 case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ shapeProd (head✝ :: tail✝) = 1
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
simp
case nil Hknown : known [] = true Hrefines : shapeRefines [] [] = true ⊒ shapeProd [] = 1 case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ shapeProd (head✝ :: tail✝) = 1
case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ shapeProd (head✝ :: tail✝) = 1
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
simp at Hrefines
case cons Hknown : known [] = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) [] = true ⊒ shapeProd (head✝ :: tail✝) = 1
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
cases S
head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true S : List β„• Hrefines : shapeRefines S (head :: tail) = true ⊒ shapeProd S = prod (head :: tail)
case nil head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true Hrefines : shapeRefines [] (head :: tail) = true ⊒ shapeProd [] = prod (head :: tail) case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ shapeProd (head✝ :: tail✝) = prod (head :: tail)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
simp at Hrefines
case nil head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true Hrefines : shapeRefines [] (head :: tail) = true ⊒ shapeProd [] = prod (head :: tail) case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ shapeProd (head✝ :: tail✝) = prod (head :: tail)
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ shapeProd (head✝ :: tail✝) = prod (head :: tail)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
cases head <;> simp at *
case cons head : Dimension tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail Hknown : known (head :: tail) = true head✝ : β„• tail✝ : List β„• Hrefines : shapeRefines (head✝ :: tail✝) (head :: tail) = true ⊒ shapeProd (head✝ :: tail✝) = prod (head :: tail)
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ head✝ * shapeProd tail✝ = a✝ * prod tail
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.dim_known_prod_refines
[359, 1]
[367, 44]
rw [←Hrefines.1, ←ih Hknown Hrefines.2]
case cons.Known tail : List Dimension ih : known tail = true β†’ βˆ€ {S : List β„•}, shapeRefines S tail = true β†’ shapeProd S = prod tail head✝ : β„• tail✝ : List β„• a✝ : β„• Hknown : known tail = true Hrefines : head✝ = a✝ ∧ shapeRefines tail✝ tail = true ⊒ head✝ * shapeProd tail✝ = a✝ * prod tail
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.defaultRefinement_refines
[374, 1]
[378, 37]
induction D <;> simp
D : DimList ⊒ shapeRefines (defaultRefinement D) D = true
case cons head✝ : Dimension tail✝ : List Dimension tail_ih✝ : shapeRefines (defaultRefinement tail✝) tail✝ = true ⊒ shapeRefines (defaultRefinement (head✝ :: tail✝)) (head✝ :: tail✝) = true
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.defaultRefinement_refines
[374, 1]
[378, 37]
case cons head _ ih => cases head <;> simp <;> apply ih
head : Dimension tail✝ : List Dimension ih : shapeRefines (defaultRefinement tail✝) tail✝ = true ⊒ shapeRefines (defaultRefinement (head :: tail✝)) (head :: tail✝) = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
DimList.defaultRefinement_refines
[374, 1]
[378, 37]
cases head <;> simp <;> apply ih
head : Dimension tail✝ : List Dimension ih : shapeRefines (defaultRefinement tail✝) tail✝ = true ⊒ shapeRefines (defaultRefinement (head :: tail✝)) (head :: tail✝) = true
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
revert h
Ο„ : MLIRTy l : List TensorElem h : hasType (nested l) Ο„ = true ⊒ flatten (nested l) h = List.join (mapWithType l flatten h)
Ο„ : MLIRTy l : List TensorElem ⊒ βˆ€ (h : hasType (nested l) Ο„ = true), flatten (nested l) h = List.join (mapWithType l flatten h)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
induction l <;> intros h
Ο„ : MLIRTy l : List TensorElem ⊒ βˆ€ (h : hasType (nested l) Ο„ = true), flatten (nested l) h = List.join (mapWithType l flatten h)
case nil Ο„ : MLIRTy h : hasType (nested []) Ο„ = true ⊒ flatten (nested []) h = List.join (mapWithType [] flatten h) case cons Ο„ : MLIRTy head✝ : TensorElem tail✝ : List TensorElem tail_ih✝ : βˆ€ (h : hasType (nested tail✝) Ο„ = true), flatten (nested tail✝) h = List.join (mapWithType tail✝ flatten h) h : hasType (nested (head✝ :: tail✝)) Ο„ = true ⊒ flatten (nested (head✝ :: tail✝)) h = List.join (mapWithType (head✝ :: tail✝) flatten h)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
case nil => simp [flatten, mapWithType, List.join]
Ο„ : MLIRTy h : hasType (nested []) Ο„ = true ⊒ flatten (nested []) h = List.join (mapWithType [] flatten h)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
case cons _ _ ih => simp [flatten, mapWithType, List.join, ih]
Ο„ : MLIRTy head✝ : TensorElem tail✝ : List TensorElem ih : βˆ€ (h : hasType (nested tail✝) Ο„ = true), flatten (nested tail✝) h = List.join (mapWithType tail✝ flatten h) h : hasType (nested (head✝ :: tail✝)) Ο„ = true ⊒ flatten (nested (head✝ :: tail✝)) h = List.join (mapWithType (head✝ :: tail✝) flatten h)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
simp [flatten, mapWithType, List.join]
Ο„ : MLIRTy h : hasType (nested []) Ο„ = true ⊒ flatten (nested []) h = List.join (mapWithType [] flatten h)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_list
[403, 1]
[410, 47]
simp [flatten, mapWithType, List.join, ih]
Ο„ : MLIRTy head✝ : TensorElem tail✝ : List TensorElem ih : βˆ€ (h : hasType (nested tail✝) Ο„ = true), flatten (nested tail✝) h = List.join (mapWithType tail✝ flatten h) h : hasType (nested (head✝ :: tail✝)) Ο„ = true ⊒ flatten (nested (head✝ :: tail✝)) h = List.join (mapWithType (head✝ :: tail✝) flatten h)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
revert shape
Ο„ : MLIRTy e : TensorElem shape : List β„• ⊒ hasShape e shape = true β†’ βˆ€ (h : hasType e Ο„ = true), List.length (flatten e h) = shapeProd shape
Ο„ : MLIRTy e : TensorElem ⊒ βˆ€ (shape : List β„•), hasShape e shape = true β†’ βˆ€ (h : hasType e Ο„ = true), List.length (flatten e h) = shapeProd shape
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
apply @TensorElem.recOn (motive_1 := fun e => βˆ€s, e.hasShape s β†’ (h: e.hasType Ο„) β†’ (e.flatten h).length = shapeProd s) (motive_2 := fun l => βˆ€s, l.all (TensorElem.hasShape . s) β†’ (h: l.all (hasType . Ο„)) β†’ (mapWithType l flatten (hasType_list_2 h)).join.length = l.length * shapeProd s) <;> simp <;> clear e
Ο„ : MLIRTy e : TensorElem ⊒ βˆ€ (shape : List β„•), hasShape e shape = true β†’ βˆ€ (h : hasType e Ο„ = true), List.length (flatten e h) = shapeProd shape
case int Ο„ : MLIRTy ⊒ βˆ€ (a : β„€) (s : List β„•), hasShape (int a) s = true β†’ βˆ€ (h : hasType (int a) Ο„ = true), List.length (flatten (int a) h) = shapeProd s case float Ο„ : MLIRTy ⊒ βˆ€ (a : Float) (s : List β„•), hasShape (float a) s = true β†’ βˆ€ (h : hasType (float a) Ο„ = true), List.length (flatten (float a) h) = shapeProd s case bool Ο„ : MLIRTy ⊒ (βˆ€ (s : List β„•), hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s) ∧ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s case nested Ο„ : MLIRTy ⊒ βˆ€ (a : List TensorElem), (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ a β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all a fun x => hasType x Ο„) = true), List.length (List.join (mapWithType a flatten (_ : hasType (nested a) Ο„ = true))) = List.length a * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape (nested a) s = true β†’ βˆ€ (h : hasType (nested a) Ο„ = true), List.length (flatten (nested a) h) = shapeProd s case empty Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape empty s = true β†’ βˆ€ (h : hasType empty Ο„ = true), List.length (flatten empty h) = shapeProd s case cons Ο„ : MLIRTy ⊒ βˆ€ (head : TensorElem) (tail : List TensorElem), (βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s) β†’ (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape head s = true β†’ (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all (head :: tail) fun x => hasType x Ο„) = true), List.length (flatten head (_ : hasType head Ο„ = true)) + List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = Nat.succ (List.length tail) * shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case int => intros i s Hshape Htype; cases Ο„ <;> simp [hasType] at Htype cases s <;> simp [flatten, hasShape] at *
Ο„ : MLIRTy ⊒ βˆ€ (a : β„€) (s : List β„•), hasShape (int a) s = true β†’ βˆ€ (h : hasType (int a) Ο„ = true), List.length (flatten (int a) h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case float => intros i s Hshape Htype; cases Ο„ <;> simp [hasType] at Htype cases s <;> simp [flatten, hasShape] at *
Ο„ : MLIRTy ⊒ βˆ€ (a : Float) (s : List β„•), hasShape (float a) s = true β†’ βˆ€ (h : hasType (float a) Ο„ = true), List.length (flatten (float a) h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case bool => constructor; intros s; intros Hshape; intros Htype; cases Ο„ <;> simp [hasType] at Htype cases s <;> simp [flatten, hasShape] at * sorry
Ο„ : MLIRTy ⊒ (βˆ€ (s : List β„•), hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s) ∧ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case nested => intros l motive_2 s Hshape Htype cases s <;> simp [hasShape] at Hshape case cons s_head s_tail => simp [TensorElem.flatten_list, shapeProd, List.foldr] simp [motive_2 s_tail Hshape.2 (hasType_list_1 Htype)] simp [shapeProd, Nat.mul_comm, Hshape.1]
Ο„ : MLIRTy ⊒ βˆ€ (a : List TensorElem), (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ a β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all a fun x => hasType x Ο„) = true), List.length (List.join (mapWithType a flatten (_ : hasType (nested a) Ο„ = true))) = List.length a * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape (nested a) s = true β†’ βˆ€ (h : hasType (nested a) Ο„ = true), List.length (flatten (nested a) h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case empty => intros s Hshape Htype simp [hasType] at Htype
Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape empty s = true β†’ βˆ€ (h : hasType empty Ο„ = true), List.length (flatten empty h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case cons => intros head tail motive_1 IH2 s Hshape1 Hshape2 Htype1 simp [List.map, List.join] rw [Nat.add_comm] simp [Nat.succ_eq_add_one, Nat.right_distrib] simp [List.all_cons] at Hshape1 simp [List.all_cons] at Htype1 sorry
Ο„ : MLIRTy ⊒ βˆ€ (head : TensorElem) (tail : List TensorElem), (βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s) β†’ (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape head s = true β†’ (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all (head :: tail) fun x => hasType x Ο„) = true), List.length (flatten head (_ : hasType head Ο„ = true)) + List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = Nat.succ (List.length tail) * shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros i s Hshape Htype
Ο„ : MLIRTy ⊒ βˆ€ (a : β„€) (s : List β„•), hasShape (int a) s = true β†’ βˆ€ (h : hasType (int a) Ο„ = true), List.length (flatten (int a) h) = shapeProd s
Ο„ : MLIRTy i : β„€ s : List β„• Hshape : hasShape (int i) s = true Htype : hasType (int i) Ο„ = true ⊒ List.length (flatten (int i) Htype) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases Ο„ <;> simp [hasType] at Htype
Ο„ : MLIRTy i : β„€ s : List β„• Hshape : hasShape (int i) s = true Htype : hasType (int i) Ο„ = true ⊒ List.length (flatten (int i) Htype) = shapeProd s
case int i : β„€ s : List β„• Hshape : hasShape (int i) s = true a✝¹ : Signedness a✝ : β„• Htype✝ : hasType (int i) (MLIRType.int a✝¹ a✝) = true Htype : FinInt.isInBounds a✝¹ a✝ i = true ⊒ List.length (flatten (int i) Htype✝) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases s <;> simp [flatten, hasShape] at *
case int i : β„€ s : List β„• Hshape : hasShape (int i) s = true a✝¹ : Signedness a✝ : β„• Htype✝ : hasType (int i) (MLIRType.int a✝¹ a✝) = true Htype : FinInt.isInBounds a✝¹ a✝ i = true ⊒ List.length (flatten (int i) Htype✝) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros i s Hshape Htype
Ο„ : MLIRTy ⊒ βˆ€ (a : Float) (s : List β„•), hasShape (float a) s = true β†’ βˆ€ (h : hasType (float a) Ο„ = true), List.length (flatten (float a) h) = shapeProd s
Ο„ : MLIRTy i : Float s : List β„• Hshape : hasShape (float i) s = true Htype : hasType (float i) Ο„ = true ⊒ List.length (flatten (float i) Htype) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases Ο„ <;> simp [hasType] at Htype
Ο„ : MLIRTy i : Float s : List β„• Hshape : hasShape (float i) s = true Htype : hasType (float i) Ο„ = true ⊒ List.length (flatten (float i) Htype) = shapeProd s
case float i : Float s : List β„• Hshape : hasShape (float i) s = true a✝ : β„• Htype✝ : hasType (float i) (MLIRType.float a✝) = true Htype : True ⊒ List.length (flatten (float i) Htype✝) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases s <;> simp [flatten, hasShape] at *
case float i : Float s : List β„• Hshape : hasShape (float i) s = true a✝ : β„• Htype✝ : hasType (float i) (MLIRType.float a✝) = true Htype : True ⊒ List.length (flatten (float i) Htype✝) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
constructor
Ο„ : MLIRTy ⊒ (βˆ€ (s : List β„•), hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s) ∧ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case left Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros s
case left Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case left Ο„ : MLIRTy s : List β„• ⊒ hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros Hshape
case left Ο„ : MLIRTy s : List β„• ⊒ hasShape (bool false) s = true β†’ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case left Ο„ : MLIRTy s : List β„• Hshape : hasShape (bool false) s = true ⊒ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros Htype
case left Ο„ : MLIRTy s : List β„• Hshape : hasShape (bool false) s = true ⊒ βˆ€ (h : hasType (bool false) Ο„ = true), List.length (flatten (bool false) h) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case left Ο„ : MLIRTy s : List β„• Hshape : hasShape (bool false) s = true Htype : hasType (bool false) Ο„ = true ⊒ List.length (flatten (bool false) Htype) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases Ο„ <;> simp [hasType] at Htype
case left Ο„ : MLIRTy s : List β„• Hshape : hasShape (bool false) s = true Htype : hasType (bool false) Ο„ = true ⊒ List.length (flatten (bool false) Htype) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case left.int s : List β„• Hshape : hasShape (bool false) s = true a✝¹ : Signedness a✝ : β„• Htype : hasType (bool false) (MLIRType.int a✝¹ a✝) = true ⊒ List.length (flatten (bool false) Htype) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases s <;> simp [flatten, hasShape] at *
case left.int s : List β„• Hshape : hasShape (bool false) s = true a✝¹ : Signedness a✝ : β„• Htype : hasType (bool false) (MLIRType.int a✝¹ a✝) = true ⊒ List.length (flatten (bool false) Htype) = shapeProd s case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
sorry
case right Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape (bool true) s = true β†’ βˆ€ (h : hasType (bool true) Ο„ = true), List.length (flatten (bool true) h) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros l motive_2 s Hshape Htype
Ο„ : MLIRTy ⊒ βˆ€ (a : List TensorElem), (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ a β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all a fun x => hasType x Ο„) = true), List.length (List.join (mapWithType a flatten (_ : hasType (nested a) Ο„ = true))) = List.length a * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape (nested a) s = true β†’ βˆ€ (h : hasType (nested a) Ο„ = true), List.length (flatten (nested a) h) = shapeProd s
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s s : List β„• Hshape : hasShape (nested l) s = true Htype : hasType (nested l) Ο„ = true ⊒ List.length (flatten (nested l) Htype) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
cases s <;> simp [hasShape] at Hshape
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s s : List β„• Hshape : hasShape (nested l) s = true Htype : hasType (nested l) Ο„ = true ⊒ List.length (flatten (nested l) Htype) = shapeProd s
case cons Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true head✝ : β„• tail✝ : List β„• Hshape : List.length l = head✝ ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x tail✝ = true ⊒ List.length (flatten (nested l) Htype) = shapeProd (head✝ :: tail✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
case cons s_head s_tail => simp [TensorElem.flatten_list, shapeProd, List.foldr] simp [motive_2 s_tail Hshape.2 (hasType_list_1 Htype)] simp [shapeProd, Nat.mul_comm, Hshape.1]
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length (flatten (nested l) Htype) = shapeProd (s_head :: s_tail)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [TensorElem.flatten_list, shapeProd, List.foldr]
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length (flatten (nested l) Htype) = shapeProd (s_head :: s_tail)
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length (List.join (mapWithType l flatten Htype)) = s_head * List.foldr (fun x x_1 => x * x_1) 1 s_tail
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [motive_2 s_tail Hshape.2 (hasType_list_1 Htype)]
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length (List.join (mapWithType l flatten Htype)) = s_head * List.foldr (fun x x_1 => x * x_1) 1 s_tail
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length l * shapeProd s_tail = s_head * List.foldr (fun x x_1 => x * x_1) 1 s_tail
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [shapeProd, Nat.mul_comm, Hshape.1]
Ο„ : MLIRTy l : List TensorElem motive_2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all l fun x => hasType x Ο„) = true), List.length (List.join (mapWithType l flatten (_ : hasType (nested l) Ο„ = true))) = List.length l * shapeProd s Htype : hasType (nested l) Ο„ = true s_head : β„• s_tail : List β„• Hshape : List.length l = s_head ∧ βˆ€ (x : TensorElem), x ∈ l β†’ hasShape x s_tail = true ⊒ List.length l * shapeProd s_tail = s_head * List.foldr (fun x x_1 => x * x_1) 1 s_tail
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros s Hshape Htype
Ο„ : MLIRTy ⊒ βˆ€ (s : List β„•), hasShape empty s = true β†’ βˆ€ (h : hasType empty Ο„ = true), List.length (flatten empty h) = shapeProd s
Ο„ : MLIRTy s : List β„• Hshape : hasShape empty s = true Htype : hasType empty Ο„ = true ⊒ List.length (flatten empty Htype) = shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [hasType] at Htype
Ο„ : MLIRTy s : List β„• Hshape : hasShape empty s = true Htype : hasType empty Ο„ = true ⊒ List.length (flatten empty Htype) = shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
intros head tail motive_1 IH2 s Hshape1 Hshape2 Htype1
Ο„ : MLIRTy ⊒ βˆ€ (head : TensorElem) (tail : List TensorElem), (βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s) β†’ (βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s) β†’ βˆ€ (s : List β„•), hasShape head s = true β†’ (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all (head :: tail) fun x => hasType x Ο„) = true), List.length (flatten head (_ : hasType head Ο„ = true)) + List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = Nat.succ (List.length tail) * shapeProd s
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (flatten head (_ : hasType head Ο„ = true)) + List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = Nat.succ (List.length tail) * shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
rw [Nat.add_comm]
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (flatten head (_ : hasType head Ο„ = true)) + List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = Nat.succ (List.length tail) * shapeProd s
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = Nat.succ (List.length tail) * shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [Nat.succ_eq_add_one, Nat.right_distrib]
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = Nat.succ (List.length tail) * shapeProd s
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = List.length tail * shapeProd s + shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
simp [List.all_cons] at Htype1
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1 : (List.all (head :: tail) fun x => hasType x Ο„) = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = List.length tail * shapeProd s + shapeProd s
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1✝ : (List.all (head :: tail) fun x => hasType x Ο„) = true Htype1 : hasType head Ο„ = true ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ hasType x Ο„ = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = List.length tail * shapeProd s + shapeProd s
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Semantics/TensorElem.lean
MLIR.AST.TensorElem.flatten_size
[413, 1]
[462, 10]
sorry
Ο„ : MLIRTy head : TensorElem tail : List TensorElem motive_1 : βˆ€ (s : List β„•), hasShape head s = true β†’ βˆ€ (h : hasType head Ο„ = true), List.length (flatten head h) = shapeProd s IH2 : βˆ€ (s : List β„•), (βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true) β†’ βˆ€ (h : (List.all tail fun x => hasType x Ο„) = true), List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) = List.length tail * shapeProd s s : List β„• Hshape1 : hasShape head s = true Hshape2 : βˆ€ (x : TensorElem), x ∈ tail β†’ hasShape x s = true Htype1✝ : (List.all (head :: tail) fun x => hasType x Ο„) = true Htype1 : hasType head Ο„ = true ∧ βˆ€ (x : TensorElem), x ∈ tail β†’ hasType x Ο„ = true ⊒ List.length (List.join (mapWithType tail flatten (_ : hasType (nested tail) Ο„ = true))) + List.length (flatten head (_ : hasType head Ο„ = true)) = List.length tail * shapeProd s + shapeProd s
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
th1.equivalent
[364, 1]
[373, 26]
simp [LHS, RHS, run, StateT.run, denoteOp, bind, List.mapM, StateT.bind, denoteOpArgs, List.mapM, List.mapM.loop, Except.bind, TopM.get, StateT.get, pure, Except.pure, StateT.pure, TopM.mapDenoteRegion, OpM.toTopM, TopM.set, StateT.set, MLIRType.eval, SSAEnv.get, SSAEnv.getT, cast]
n m : FinInt 32 ⊒ run ⟦ LHS ⟧ (SSAEnv.One [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m })]) = run ⟦ RHS ⟧ (SSAEnv.One [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m })])
n m : FinInt 32 ⊒ FinInt.add n m = FinInt.add m n ∧ [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m }), (SSAVal.SSAVal "r", { fst := MLIRType.int Signedness.Signless 32, snd := FinInt.add n m })] = [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m }), (SSAVal.SSAVal "r", { fst := MLIRType.int Signedness.Signless 32, snd := FinInt.add m n })]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
th1.equivalent
[364, 1]
[373, 26]
simp [FinInt.add_comm']
n m : FinInt 32 ⊒ FinInt.add n m = FinInt.add m n ∧ [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m }), (SSAVal.SSAVal "r", { fst := MLIRType.int Signedness.Signless 32, snd := FinInt.add n m })] = [(SSAVal.SSAVal "n", { fst := MLIRType.i32, snd := n }), (SSAVal.SSAVal "m", { fst := MLIRType.i32, snd := m }), (SSAVal.SSAVal "r", { fst := MLIRType.int Signedness.Signless 32, snd := FinInt.add m n })]
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
FinInt.sub_add_dist
[409, 1]
[415, 41]
intros C X C2
sz : β„• ⊒ βˆ€ (C X C2 : FinInt sz), C - (X + C2) = C - C2 - X
sz : β„• C X C2 : FinInt sz ⊒ C - (X + C2) = C - C2 - X
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
FinInt.sub_add_dist
[409, 1]
[415, 41]
apply eq_of_toUint_cong2
sz : β„• C X C2 : FinInt sz ⊒ C - (X + C2) = C - C2 - X
case a sz : β„• C X C2 : FinInt sz ⊒ toUint (C - (X + C2)) ≑ toUint (C - C2 - X) [2^sz]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
FinInt.sub_add_dist
[409, 1]
[415, 41]
simp [cong2, FinInt.sub_toUint, FinInt.add_toUint]
case a sz : β„• C X C2 : FinInt sz ⊒ toUint (C - (X + C2)) ≑ toUint (C - C2 - X) [2^sz]
case a sz : β„• C X C2 : FinInt sz ⊒ mod2 (toUint C - (toUint X + toUint C2)) sz = mod2 (toUint C - toUint C2 - toUint X) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ArithSemantics.lean
FinInt.sub_add_dist
[409, 1]
[415, 41]
apply FinInt.mod2_fequal
case a sz : β„• C X C2 : FinInt sz ⊒ mod2 (toUint C - (toUint X + toUint C2)) sz = mod2 (toUint C - toUint C2 - toUint X) sz
case a.a sz : β„• C X C2 : FinInt sz ⊒ toUint C - (toUint X + toUint C2) = toUint C - toUint C2 - toUint X