math / data /lean /OAI /Algorithms /SubexponentialSAT /SqrtLog /BucketProgramProducedRankTables.lean
Download data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/BucketProgramProducedRankTables.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.75 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/BucketProgramProducedRankTables.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/BucketProgramProducedRankTables.lean
-
curl -L -o BucketProgramProducedRankTables.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/SqrtLog/BucketProgramProducedRankTables.lean
4.75 kB
| import OAI.Algorithms.SubexponentialSAT.LeanCompat | |
| import OAI.Algorithms.SubexponentialSAT.SqrtLog.BucketProgramProducedRankMatrix | |
| import OAI.Algorithms.SubexponentialSAT.SqrtLog.LeafHeadSetupProgramLoop | |
| import OAI.Algorithms.SubexponentialSAT.SqrtLog.CostAssemblyInventory | |
| namespace OAI.Algorithms | |
| /-! Rank-sensitive cardinality of the actual attained Cartesian inventory. | |
| The hypotheses constrain entry values, not the cardinalities of head tables. -/ | |
| noncomputable section | |
| namespace SubexponentialSAT.SqrtLog.BucketProgram.ProducedRank | |
| open LeafHeadSetupProgram | |
| open scoped BigOperators | |
| def headRank (C : β β β β β€) (D n : β) | |
| (rows : List (List Bool)) (low : List Bool) (z : β) : β := | |
| LayoutRank.rowRank (selectedMatrix C D (selectedHeads n rows low z)) | |
| def commonBase (n H : β) : β := 2*n*H+1 | |
| theorem commonBase_pos (n H : β) : 1 β€ commonBase n H := by unfold commonBase; omega | |
| theorem producedHead_length_le_rank {base : Data} {n N D : β} | |
| {rows : List (List Bool)} {low : List Bool} | |
| {Rel : β β β β LayoutMatrixProgram.Pair β Prop} {B z : β} | |
| {table : BucketTupleProgram.HeadTable} | |
| (hp : ProducedHead base n N D rows low Rel B z table) | |
| (C : β β β β β€) (H : β) | |
| (hrel : β j v p,j < Dβv < nβRel j v pβ | |
| SubexponentialSAT.BinaryArithmetic.toNat p.2 β€ SubexponentialSAT.BinaryArithmetic.toNat (base.stacks 141) β§ | |
| (SubexponentialSAT.BinaryArithmetic.toNat p.1 : β€)-(SubexponentialSAT.BinaryArithmetic.toNat p.2 : β€)=C j v) | |
| (hbound : β j v p,j < Dβv < nβRel j v pβ|C j v| β€ (H:β€)) : | |
| table.buckets.length β€ (commonBase n H)^headRank C D n rows low z := by | |
| obtain β¨mr,ys,hr,hy,rflβ© := hp | |
| have hj := HeadIdentifierProgram.chosenIds_bound (HeadIdentifierProgram.predicate rows low z) n | |
| have ht := actualBuckets_length_le_rank (base.stacks 141) n H C hr hy | |
| (fun j v p hj' hv hp=>hrel j v p hj' (hj v hv) hp) | |
| (fun j v p hj' hv hp=>hbound j v p hj' (hj v hv) hp) | |
| apply ht.trans | |
| apply Nat.pow_le_pow_left | |
| have hc := HeadIdentifierProgram.count_le (HeadIdentifierProgram.predicate rows low z) n | |
| change 2*(selectedHeads n rows low z).length*H+1 β€ 2*n*H+1 | |
| have hc' : (selectedHeads n rows low z).length β€ n := hc | |
| gcongr | |
| private theorem sum_succ (f : β β β) (z k : β) : | |
| (β i : Fin (k+1),f (z+i.val))=f z+β i : Fin k,f ((z+1)+i.val) := by | |
| rw [Fin.sum_univ_succ] | |
| simp [Nat.add_left_comm,Nat.add_comm] | |
| /-- The product in `enumerate_length` is bounded using the rank of every | |
| literal selected matrix, in the producer's consecutive head order. -/ | |
| theorem producedHeads_product_le_rankSum {base : Data} {n N D : β} | |
| {rows : List (List Bool)} {low : List Bool} | |
| {Rel : β β β β LayoutMatrixProgram.Pair β Prop} {B z : β} | |
| {tables : List BucketTupleProgram.HeadTable} | |
| (hp : ProducedHeads base n N D rows low Rel B z tables) | |
| (C : β β β β β€) (H : β) | |
| (hrel : β j v p,j < Dβv < nβRel j v pβ | |
| SubexponentialSAT.BinaryArithmetic.toNat p.2 β€ SubexponentialSAT.BinaryArithmetic.toNat (base.stacks 141) β§ | |
| (SubexponentialSAT.BinaryArithmetic.toNat p.1 : β€)-(SubexponentialSAT.BinaryArithmetic.toNat p.2 : β€)=C j v) | |
| (hbound : β j v p,j < Dβv < nβRel j v pβ|C j v| β€ (H:β€)) : | |
| (tables.map fun table=>table.buckets.length).prod β€ | |
| (commonBase n H)^(β i : Fin tables.length,headRank C D n rows low (z+i.val)) := by | |
| induction hp with | |
| | nil => simp | |
| | @cons z table tables hh ht ih => | |
| have hh' := producedHead_length_le_rank hh C H hrel hbound | |
| simp only [List.map_cons,List.prod_cons,List.length_cons,sum_succ,pow_add] | |
| exact Nat.mul_le_mul hh' ih | |
| theorem producedHeads_enumerate_le_rankSum {base : Data} {n N D : β} | |
| {rows : List (List Bool)} {low : List Bool} | |
| {Rel : β β β β LayoutMatrixProgram.Pair β Prop} {B z : β} | |
| {tables : List BucketTupleProgram.HeadTable} | |
| (hp : ProducedHeads base n N D rows low Rel B z tables) | |
| (C : β β β β β€) (H : β) | |
| (hrel : β j v p,j < Dβv < nβRel j v pβ | |
| SubexponentialSAT.BinaryArithmetic.toNat p.2 β€ SubexponentialSAT.BinaryArithmetic.toNat (base.stacks 141) β§ | |
| (SubexponentialSAT.BinaryArithmetic.toNat p.1 : β€)-(SubexponentialSAT.BinaryArithmetic.toNat p.2 : β€)=C j v) | |
| (hbound : β j v p,j < Dβv < nβRel j v pβ|C j v| β€ (H:β€)) : | |
| (BucketTupleProgram.enumerate tables).length β€ | |
| (commonBase n H)^(β i : Fin tables.length,headRank C D n rows low (z+i.val)) := by | |
| rw [BucketTupleProgram.enumerate_length] | |
| exact producedHeads_product_le_rankSum hp C H hrel hbound | |
| end SubexponentialSAT.SqrtLog.BucketProgram.ProducedRank | |
| end | |
| end OAI.Algorithms | |