To solve the given optimization problem, we first need to convert the natural language description into a symbolic representation. This involves defining variables and formulating the objective function and constraints.

Let's denote:
- \(x_1\) as the amount invested in company M.
- \(x_2\) as the amount invested in company P.

The objective is to maximize earnings, given that investments in company M earn 9% and investments in company P earn 12%. Thus, the objective function can be written as:
\[ \text{Maximize: } 0.09x_1 + 0.12x_2 \]

The constraints based on the problem description are:
1. The total amount invested is $100,000: \( x_1 + x_2 = 100,000 \)
2. At least three times as much money is invested in company M as in company P: \( x_1 \geq 3x_2 \)
3. At most $80,000 can be invested in company M: \( x_1 \leq 80,000 \)
4. Non-negativity constraints for both investments: \( x_1 \geq 0, x_2 \geq 0 \)

Thus, the symbolic representation of the problem is:
```json
{
  'sym_variables': [('x1', 'amount invested in company M'), ('x2', 'amount invested in company P')],
  'objective_function': '0.09*x1 + 0.12*x2',
  'constraints': ['x1 + x2 == 100000', 'x1 >= 3*x2', 'x1 <= 80000', 'x1 >= 0', 'x2 >= 0']
}
```

Now, let's translate this into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Vaccine_Investment")

# Define variables
x1 = m.addVar(lb=0, name="Investment_in_M")
x2 = m.addVar(lb=0, name="Investment_in_P")

# Set the objective function
m.setObjective(0.09*x1 + 0.12*x2, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x1 + x2 == 100000, "Total_Investment")
m.addConstr(x1 >= 3*x2, "Minimum_M_to_P_Ratio")
m.addConstr(x1 <= 80000, "Maximum_in_M")

# Optimize the model
m.optimize()

# Print the solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Investment in Company M: ${x1.x:.2f}")
    print(f"Investment in Company P: ${x2.x:.2f}")
    print(f"Maximum Earnings: ${m.objVal:.2f}")
else:
    print("No optimal solution found")
```