import JaxLean.Stdlib import examples.tensor_puzzles.generated.PuzzlesBincountset_option maxRecDepth 4096set_option maxHeartbeats 2000000namespace JaxLean.Puzzles.Bincounttheorem matches_loop (a : Tensor Int32 [3]) : Array.bincount (R := ℝ) a = Loop.bincount (R := ℝ) a := a:Tensor Int32 [3]⊢ Array.bincount a = Loop.bincount a a:Tensor Int32 [3]i:Fin 3u:Index []⊢ Array.bincount a (i, u) = Loop.bincount a (i, u) a:Tensor Int32 [3]i:Fin 3⊢ Array.bincount a (i, PUnit.unit) = Loop.bincount a (i, PUnit.unit) a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨0, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨0, ⋯⟩, PUnit.unit)a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨1, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨1, ⋯⟩, PUnit.unit)a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨2, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨2, ⋯⟩, PUnit.unit) a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨0, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨0, ⋯⟩, PUnit.unit)a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨1, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨1, ⋯⟩, PUnit.unit)a:Tensor Int32 [3]⊢ Array.bincount a ((fun i => i) ⟨2, ⋯⟩, PUnit.unit) = Loop.bincount a ((fun i => i) ⟨2, ⋯⟩, PUnit.unit) a:Tensor Int32 [3]⊢ (if decide (↑(a (0, ())).toInt = ↑2) = true then 1 else 0) + ((if decide (↑(a (Fin.succ 0, ())).toInt = ↑2) = true then 1 else 0) + ((if decide (↑(a ((Fin.succ 0).succ, ())).toInt = ↑2) = true then 1 else 0) + ∑ x, if decide (↑(a (x.succ.succ.succ, ())).toInt = ↑2) = true then 1 else 0)) = if ⟨2, ⋯⟩ = 2 then ((0 + if decide (↑(a (⟨0 + 1 * ↑0, ⋯⟩, ())).toInt = 2) = true then 1 else 0) + if decide (↑(a (⟨1 + 1 * ↑0, ⋯⟩, ())).toInt = 2) = true then 1 else 0) + if decide (↑(a (⟨2 + 1 * ↑0, ⋯⟩, ())).toInt = 2) = true then 1 else 0 else if ⟨2, ⋯⟩ = 1 then ((0 + if decide (↑(a (⟨0 + 1 * ↑0, ⋯⟩, ())).toInt = 1) = true then 1 else 0) + if decide (↑(a (⟨1 + 1 * ↑0, ⋯⟩, ())).toInt = 1) = true then 1 else 0) + if decide (↑(a (⟨2 + 1 * ↑0, ⋯⟩, ())).toInt = 1) = true then 1 else 0 else if ⟨2, ⋯⟩ = 0 then ((0 + if decide (↑(a (⟨0 + 1 * ↑0, ⋯⟩, ())).toInt = 0) = true then 1 else 0) + if decide (↑(a (⟨1 + 1 * ↑0, ⋯⟩, ())).toInt = 0) = true then 1 else 0) + if decide (↑(a (⟨2 + 1 * ↑0, ⋯⟩, ())).toInt = 0) = true then 1 else 0 else 0 all_goals a:Tensor Int32 [3]⊢ (if ↑(a (0, ())).toInt = 2 then 1 else 0) + ((if ↑(a (1, ())).toInt = 2 then 1 else 0) + if ↑(a (2, ())).toInt = 2 then 1 else 0) = ((if ↑(a (0, ())).toInt = 2 then 1 else 0) + if ↑(a (1, ())).toInt = 2 then 1 else 0) + if ↑(a (⟨2, ⋯⟩, ())).toInt = 2 then 1 else 0 all_goals a:Tensor Int32 [3]⊢ (if ↑(a (0, ())).toInt = 2 then 1 else 0) + ((if ↑(a (1, ())).toInt = 2 then 1 else 0) + if ↑(a (2, ())).toInt = 2 then 1 else 0) = ((if ↑(a (0, ())).toInt = 2 then 1 else 0) + if ↑(a (1, ())).toInt = 2 then 1 else 0) + if ↑(a (2, ())).toInt = 2 then 1 else 0 all_goals All goals completed! 🐙a:Tensor Int32 [3]⊢ Array.bincount a = Loop.bincount a All goals completed! 🐙end JaxLean.Puzzles.Bincount