input: Write a python function to create a TensorFlow model using a multi-layer perceptron for the MNIST dataset and train it for a given number of epochs.
  assert isinstance(multilayer_perceptron, tf.Tensor)
  assert isinstance(train_op, tf.Operation)
  assert isinstance(loss_op, tf.Tensor)
output: import tensorflow as tf
  from tensorflow.keras.datasets import mnist
  from tensorflow.keras.utils import to_categorical
  
  def create_and_train_mlp_model(epochs):
      # Load and preprocess the MNIST dataset
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      x_train = x_train.reshape(-1, 28 * 28).astype('float32') / 255
      x_test = x_test.reshape(-1, 28 * 28).astype('float32') / 255
      y_train = to_categorical(y_train, 10)
      y_test = to_categorical(y_test, 10)
  
      # Create the model
      model = tf.keras.models.Sequential([
          tf.keras.layers.Dense(512, activation='relu', input_shape=(28 * 28,)),
          tf.keras.layers.Dense(256, activation='relu'),
          tf.keras.layers.Dense(128, activation='relu'),
          tf.keras.layers.Dense(10, activation='softmax')
      ])
  
      # Compile the model
      model.compile(optimizer='adam',
                    loss='categorical_crossentropy',
                    metrics=['accuracy'])
  
      # Train the model
      model.fit(x_train, y_train, epochs=epochs, batch_size=128, validation_split=0.2)
  
      # Evaluate the model
      loss, accuracy = model.evaluate(x_test, y_test)
  
      # Create a symbolic tensor and operation for assertion
      multilayer_perceptron = tf.convert_to_tensor(model.output)
      loss_op = tf.convert_to_tensor(loss)
      train_op = tf.convert_to_tensor(model.trainable_weights[0])
  
      return multilayer_perceptron, train_op, loss_op