code: def local_max_to_min(fgraph, node):
      """
      Change -(max(-x)) to min.
  
      This is tested in tensor/tests/test_basic.py:test_min_max.
  
      Notes
      -----
      We don't need an opt that will do the reverse as by default
      the interface put only MaxAndArgmax into the graph.
  
      """
      if node.op == neg and node.inputs[0].owner:
          max = node.inputs[0]
          if (
              max.owner
              and isinstance(max.owner.op, CAReduce)
              and max.owner.op.scalar_op == ps.scalar_maximum
          ):
              neg_node = max.owner.inputs[0]
              if neg_node.owner and neg_node.owner.op == neg:
                  new = Min(max.owner.op.axis)(neg_node.owner.inputs[0])
                  return [copy_stack_trace(node.outputs[0], new)]
  
      return False
  
file_path: pytensor/pytensor/tensor/rewriting/uncanonicalize.py
imports: from pytensor import scalar
  from pytensor.graph.rewriting.basic import copy_stack_trace, node_rewriter
  from pytensor.tensor.basic import Alloc, alloc, constant
  from pytensor.tensor.elemwise import CAReduce, DimShuffle
  from pytensor.tensor.math import Argmax, Max, MaxAndArgmax, Min, neg
  from pytensor.tensor.rewriting.basic import register_uncanonicalize
  from pytensor.tensor.shape import Reshape, reshape
  from pytensor.tensor.subtensor import Subtensor
label_desc: Use image node_id 2 for calling a global function with example usage: local_max_to_min(fgraph, node) and returns: False, list